feat: add Gitleaks config and CI workflow#22
feat: add Gitleaks config and CI workflow#22stevefulme1 wants to merge 2 commits intoredhat-cop:mainfrom
Conversation
Adds .gitleaks.toml with custom rules for Ansible-specific credential patterns (OpenShift API keys, Automation Hub tokens, container registry passwords) and allowlists for placeholder values and Jinja2 templates. Adds a GitHub Actions workflow to run Gitleaks on pushes and PRs. Resolves: MFG-376 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@luizfao @jeffcpullen Would you be able to review the content of this PR? |
|
Not an expert it GitHub actions or Gitleaks, but it looks like what I would expect to see. I appreciate the carve out on specific files with specific criteria "changeme" password placeholders. Going to let this run to review the output. |
|
Ok, the run failed with 11 false positives. 10 of the 11 were looking at README.md files that do not contain secrets, but instead are documenting variables. For example, this line triggered Gitleaks. The last one triggered the 'create_mf_aap_token_openshift_api_key' variable becuase it uses a multi-line YAML format. |
Add allowlists for docsible-generated README.md variable documentation (HTML bold tags), multi-line YAML block scalars (>- / |) where values are Jinja2 templates on the following line, and task files that reference credential variable names without containing actual secrets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@jeffcpullen Thanks for running it and flagging those! I've pushed a fix ( Changes to
Verified locally: |
Summary
.gitleaks.tomlwith default rules extended by custom Ansible-specific credential detection patterns (OpenShift API keys, Automation Hub tokens, container registry passwords)changeme), Jinja2 template variables ({{ }}), Ansible Vault references, example domains, and YAML commentsdefaults/main.ymlandinventory.ymlwhere variable declarations use block scalar indicators.github/workflows/gitleaks.ymlGitHub Actions workflow to run Gitleaks on pushes to main and all PRs.pre-commit-config.yamlRelated
Test plan
gitleaks detect --config .gitleaks.toml --no-gitreports no false positives on the current codebase🤖 Generated with Claude Code