Skip to content

Add stack secret scanning guardrails#4

Merged
thecolormaroun merged 1 commit into
mainfrom
codex/secret-guard
Jun 20, 2026
Merged

Add stack secret scanning guardrails#4
thecolormaroun merged 1 commit into
mainfrom
codex/secret-guard

Conversation

@thecolormaroun

Copy link
Copy Markdown
Owner

Summary

  • Add a Security scan workflow that runs Gitleaks and a stack-specific sensitive content scanner on pull requests and pushes to main.
  • Add .gitleaks.toml and .pre-commit-config.yaml so local hooks and CI share the same secret-scanning policy.
  • Add scripts/security/scan-sensitive-content.sh for repo-specific leak risks: local machine paths, Codex session artifacts, credential-looking config assignments, and household or finance-lane references.
  • Convert stack-refresh-pr-mode docs from absolute local paths to portable ~ paths.

Verification

  • scripts/security/scan-sensitive-content.sh
  • go run github.com/zricethezav/gitleaks/[email protected] dir --redact --config .gitleaks.toml .
  • pipx run pre-commit run --all-files
  • git diff --cached --check
  • Negative fixture test confirmed the custom scanner fails on a fake untracked secret without printing the value.

Notes

  • A full Gitleaks git-history scan still reports older local-path findings already present in published history. This PR cleans the current tree and prevents new current-tree leaks, but it does not rewrite public git history.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d635e94915

ℹ️ 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".

local file="$1"

ignored_path "$file" && return 0
binary_or_unreadable "$file" || return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move filename checks before binary skips

Because binary_or_unreadable is evaluated before scan_path_name, any binary credential file that the filename rules explicitly list (.p12, .pfx, .kdbx, etc.) returns here before its extension is reported. In a PR that adds a real binary cert/key store, this job would pass even though the filename rule intends to block it; run scan_path_name before the text/binary guard and only skip scan_line for binary files.

Useful? React with 👍 / 👎.

}

if (!placeholder($0) &&
lower ~ /(api[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret|password|private[_-]?key)[[:space:]]*[:=][[:space:]]*["'\''"]?[a-z0-9_.\/+=-]{16,}/) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow quoted JSON secret keys in assignment scan

The assignment regex requires : or = immediately after the key name, so a normal JSON config line like "api_key": "..." has a quote between api_key and : and is not flagged. In a PR adding generic tokens/passwords to JSON files that do not match a provider-specific pattern, both the stack scanner and the matching Gitleaks rule miss the secret-looking assignment; allow an optional closing quote before the separator.

Useful? React with 👍 / 👎.

@thecolormaroun thecolormaroun merged commit 18b76fc into main Jun 20, 2026
2 checks passed
@thecolormaroun thecolormaroun deleted the codex/secret-guard branch June 20, 2026 18:28
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