Repository navigation
Add Betterleaks secret scanning to CI - #1564
shubham-s-pandey wants to merge 2 commits into
Conversation
|
Why? |
|
@kingthorin The goal was to add Betterleaks as a secret-scanning check for CI. It is intended to detect accidental commits of credentials or tokens and fail the workflow before those changes are merged. WSTG is a large, actively contributed repository, so an automated check provides a consistent safeguard across pull requests from different contributors. The workflow uses read-only permissions, requires no API keys, and scans the repository history with a pinned scanner version. This improves the repository’s overall security posture and helps maintain good security hygiene for both the project and its contributors. |
There was a problem hiding this comment.
🟡 Changes recommended
The security check can be modified by the PR itself, and its scanner image is not pinned immutably.
3 open findings
What changed in this PR
Adds Betterleaks secret scanning to CI using the repository configuration and full Git history.
Changes:
- Runs scans for pull requests,
masterpushes, and manual dispatches. - Uses a read-only checkout and restricted permissions.
- Executes Betterleaks through its container image.
| File | Description |
|---|---|
.github/workflows/betterleaks.yml |
Defines the Betterleaks CI workflow. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Thanks for the idea but this has never been a problem for us. There are issues with the implementation and this came out of the blue. |
|
@kingthorin I'll fix this issues. This is proactive security approach for CI. |
|
It's okay, I'll consider some other/similar controls to implement by the team. Thanks |


Summary
Adds Betterleaks-based secret scanning to detect credentials that may be accidentally committed to pull requests or repository history. This is an additive security control.
Security impact
A leaked GitHub, Cloudflare, or OAuth credential could allow unauthorized
access to repositories, certificate-generation workflows, or deployment
resources. Detecting these values before merge reduces the time a credential
can remain exposed and gives maintainers an actionable CI failure.
What this PR adds
config/betterleaks.toml.github/workflows/betterleaks.ymlmain.contents: read.Validation
config/betterleaks.toml.