Skip to content

ci(gitleaks): add Gitleaks secret scanning, pre-commit hook and allowlist - #421

Open
DoloresGarciaE wants to merge 3 commits into
openscan-explorer:devfrom
DoloresGarciaE:feat/gitleaks-secret-scanning
Open

DoloresGarciaE wants to merge 3 commits into
openscan-explorer:devfrom
DoloresGarciaE:feat/gitleaks-secret-scanning

Conversation

@DoloresGarciaE

Copy link
Copy Markdown

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

Screenshots (if applicable)

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

Add a Gitleaks workflow that scans the commits of every push and pull
request to dev/main and the full history weekly. The official
gitleaks-action runs when the GITLEAKS_LICENSE secret is available;
pull requests from forks and Dependabot, which do not receive secrets,
are scanned with the pinned gitleaks binary instead and get inline
annotations through workflow commands. Both paths block on findings.

.gitleaks.toml extends the default rules with Infura/Alchemy URL
detectors and allowlists EVM addresses and the documented test
placeholder. .gitleaksignore records the four historical findings
accepted after the initial full-history scan; the Kleros subgraph key,
documented in the source as a domain-restricted public key, carries an
inline gitleaks:allow marker.

Refs openscan-explorer#394
Install hooks through husky (bun install runs the prepare script).
The pre-commit hook runs biome check on the staged files, replacing the
manual .git/hooks recipe, and gitleaks on the staged diff when the
binary is installed. .gitattributes pins LF line endings so the hook
and biome check work on Windows checkouts with core.autocrlf=true.

Refs openscan-explorer#394

This branch has not been deployed

No deployments
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