docs: add secret exposure scan report#10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e526843089
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ## Commands Used | ||
| - `rg -n --hidden --glob '!.git' '(AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z\-_]{35}|-----BEGIN (RSA|EC|OPENSSH|DSA|PRIVATE) KEY-----|xox[baprs]-[0-9A-Za-z-]{10,}|ghp_[0-9A-Za-z]{36}|github_pat_[0-9A-Za-z_]{82}|SECRET_KEY|DATABASE_URL|TOKEN=|password\s*=)' .` | ||
| - `git grep -n -I -e 'AKIA[0-9A-Z]{16}' $(git rev-list --all)` |
There was a problem hiding this comment.
Use extended regex in history secret scans
These history-scan commands use git grep without -E/-P, but git grep defaults to basic POSIX regex (-G), so quantifiers like {16}, {36}, {82}, and {10,} are treated literally instead of as repetition operators. As a result, real tokens in commit history can be missed and the reported “no high-confidence leaked secrets” conclusion becomes unreliable whenever secrets match those intended patterns. I verified the CLI semantics from git grep -h, which explicitly shows -G as default and -E for extended regex.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds a repository security/audit artifact documenting a credential/secret exposure scan of the working tree and Git history, including scope, commands used, findings, and recommended mitigations.
Changes:
- Add
SECRET_SCAN_REPORT.mddocumenting secret-scanning scope, commands, findings, and hardening recommendations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `git grep -n -I -e 'AIza[0-9A-Za-z\-_]{35}' $(git rev-list --all)` | ||
| - `git grep -n -I -e '-----BEGIN [A-Z ]*PRIVATE KEY-----' $(git rev-list --all)` | ||
| - `git grep -n -I -e 'xox[baprs]-[0-9A-Za-z-]{10,}' $(git rev-list --all)` | ||
| - `git log --name-only --pretty=format: -- . | rg '^\.env($|\.)'` |
There was a problem hiding this comment.
The .env spot-check command likely misses env files committed in subdirectories because it only matches paths that start with .env. git log --name-only outputs paths like some/dir/.env, which won’t match ^\.env($|\.). Consider updating the pattern to match .env anywhere in the path (e.g., (^|/)\.env($|\.)) so the audit scope matches the claim.
| - `git log --name-only --pretty=format: -- . | rg '^\.env($|\.)'` | |
| - `git log --name-only --pretty=format: -- . | rg '(^|/)\.env($|\.)'` |
| - `config.js` defines `SECRET_KEY` from environment variable with random fallback for local runtime. | ||
| - `.env.example` and `README.md` contain documented placeholder values. | ||
|
|
||
| No committed `.env` file was found; only `.env.example` appears in history. |
There was a problem hiding this comment.
This conclusion depends on the .env history scan command above; as written, it won’t detect .env files in subdirectories, so it may overstate the finding. After adjusting the regex/command, re-run and update this line if needed.
Motivation
Description
SECRET_SCAN_REPORT.mdthat records the scan scope, exact commands used, findings (no high-confidence leaked secrets found for the scanned patterns), risk assessment, and recommended mitigations.Testing
rg -n --hidden --glob '!.git' '(AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z\-_]{35}|-----BEGIN (RSA|EC|OPENSSH|DSA|PRIVATE) KEY-----|xox[baprs]-[0-9A-Za-z-]{10,}|ghp_[0-9A-Za-z]{36}|github_pat_[0-9A-Za-z_]{82}|SECRET_KEY|DATABASE_URL|TOKEN=|password\s*=)' ., history-widegit grep -n -I -e 'AKIA[0-9A-Z]{16}' $(git rev-list --all), andgit log --name-only --pretty=format: -- . | rg '^\.env($|\.)') and created the report withgit commit; all scans and the commit completed successfully.Codex Task