Skip to content

Add secret scanning and credential leak detection in CI/CD pipeline #606

Description

@Smartdevs17

Context

Credentials (API keys, database passwords, Stellar secret keys) have been committed to git repositories in the past. No automated detection exists to prevent future leaks.

Current Limitation/Problem

No pre-commit or CI secret scanning. Leaked credentials remain in git history indefinitely and are only discovered post-breach.

Expected Outcome

GitLeaks-based secret scanning in pre-commit hook and CI pipeline, with custom regex patterns for Stellar keys, API keys, and JWTs. Automatic alerting and revocation on detection.

Acceptance Criteria

  • GitLeaks configuration (.gitleaks.toml) with custom rules for Stellar secret keys (S...), API keys (sk_live_, sk_test_), JWTs, private keys (BEGIN RSA, BEGIN EC)
  • Pre-commit hook: scan staged files with GitLeaks, block commit if secret detected
  • CI step: full git history scan on push to main and release branches
  • Baselines file: known false positives committed to repo and excluded from scan
  • Alert: Slack webhook notification to security team on detection
  • Automated revocation: if Stellar secret key detected, trigger key rotation via Stellar API
  • Remediation guide: auto-comment on PR with steps to remove secret from git history
  • Edge case: binary files scanned with entropy detection (>4.5 bits/byte)

Technical Scope

  • .gitleaks.toml - GitLeaks configuration with custom rules
  • .pre-commit-config.yaml - pre-commit hook configuration
  • .github/workflows/secret-scan.yml - CI secret scanning workflow
  • scripts/revoke-stellar-key.sh - automated key revocation script
  • docs/SECURITY.md - credential management best practices guide

Metadata

Metadata

Assignees

Labels

200-points200 point issueStellar WaveIssues in the Stellar wave programdrips-waveIssues in the Drips Wave programhighHigh complexity issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions