Skip to content

security: remove indexed credential material - #9

Merged
karlwaldman merged 2 commits into
masterfrom
security/remove-indexed-credential
Jul 19, 2026
Merged

karlwaldman merged 2 commits into
masterfrom
security/remove-indexed-credential

Conversation

@karlwaldman

@karlwaldman karlwaldman commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

Security prerequisite for #8.

  • removes an invalid but fully exposed API key, a personal account identifier, mutable admin-limit details, and unsupported traffic/backlink forecasts from the indexed setup record
  • replaces the record with a credential-safe publication checklist tied to the reviewed product facts
  • adds a CI secret scan that reports filenames only and validates both notebook JSON files

Verification: the exposed value returns HTTP 401; ./scripts/scan-secrets.sh, both python3 -m json.tool checks, and git diff --check pass.

History is not rewritten in this PR; the value is invalid, and destructive history rewriting requires a separate explicit decision.

Summary by CodeRabbit

  • New Features

    • Added automated validation for notebooks on pushes and pull requests.
    • Added secret scanning to detect potential credentials before changes are accepted.
  • Documentation

    • Replaced the detailed setup guide with a concise Kaggle publication checklist.
    • Added guidance for validation, product claims, and recording non-sensitive publication details.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow that scans tracked content for credential patterns and validates two notebooks as JSON. Adds the scanning script and rewrites the Kaggle setup guide as a publication checklist with secret-hygiene, claims, and receipt requirements.

Changes

Notebook validation and publication safeguards

Layer / File(s) Summary
Secret scanning and CI validation
.github/workflows/validate.yml, scripts/scan-secrets.sh
The repository gains strict-pattern secret scanning, triggered in CI on pushes and pull requests to master, alongside JSON validation for both notebooks.
Kaggle publication checklist
KAGGLE_SETUP_COMPLETE.md
The setup guide now documents reproducibility checks, secret hygiene, approved product-claim references, and recording only non-sensitive publication metadata.

Estimated code review effort: 3 (Moderate) | ~15 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing exposed credential material for security.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/remove-indexed-credential

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/validate.yml (1)

14-14: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Disable credential persistence in the checkout action.

By default, actions/checkout persists the GITHUB_TOKEN to the local git configuration. Since this workflow only performs validation and does not push changes back to the repository, it's a security best practice to disable this behavior to prevent potential credential exposure in the runner environment.

🔒️ Proposed fix to disable credential persistence
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v4
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/validate.yml at line 14, Update the actions/checkout step
in the validation workflow to disable credential persistence by configuring its
persist-credentials option as false. Keep the existing checkout action and
version unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/scan-secrets.sh`:
- Around line 7-8: Add an early ripgrep availability check before the scan logic
in scripts/scan-secrets.sh, using the existing scan function context. If rg is
unavailable, print an error and exit nonzero; otherwise preserve the current ||
true handling for rg’s no-match status.

---

Nitpick comments:
In @.github/workflows/validate.yml:
- Line 14: Update the actions/checkout step in the validation workflow to
disable credential persistence by configuring its persist-credentials option as
false. Keep the existing checkout action and version unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37491513-55bf-4d2c-a729-f9c4fed51b33

📥 Commits

Reviewing files that changed from the base of the PR and between bda6f7b and 740d7f7.

📒 Files selected for processing (3)
  • .github/workflows/validate.yml
  • KAGGLE_SETUP_COMPLETE.md
  • scripts/scan-secrets.sh

Comment thread scripts/scan-secrets.sh
Comment on lines +7 to +8
failed=0
scan() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Prevent the security scan from silently failing open if rg is missing.

Because the script uses || true to handle rg's non-zero exit status when no matches are found, it will also unintentionally mask a 127 Command not found error if ripgrep is not installed on the user's machine. This results in the script successfully exiting 0 and printing "secret scan passed", giving the user a false sense of security before publication.

Please add a check to ensure rg is installed before proceeding.

🛡️ Proposed fix to verify `rg` availability
+if ! command -v rg >/dev/null 2>&1; then
+  echo "Error: ripgrep (rg) is required but not installed." >&2
+  exit 1
+fi
+
 failed=0
 scan() {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
failed=0
scan() {
if ! command -v rg >/dev/null 2>&1; then
echo "Error: ripgrep (rg) is required but not installed." >&2
exit 1
fi
failed=0
scan() {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/scan-secrets.sh` around lines 7 - 8, Add an early ripgrep
availability check before the scan logic in scripts/scan-secrets.sh, using the
existing scan function context. If rg is unavailable, print an error and exit
nonzero; otherwise preserve the current || true handling for rg’s no-match
status.

@karlwaldman
karlwaldman merged commit 4daa738 into master Jul 19, 2026
1 of 2 checks passed
@karlwaldman
karlwaldman deleted the security/remove-indexed-credential branch July 19, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant