Skip to content

ci: add secret-scan gate to block hardcoded credentials (refs #151) - #3

Merged
cultron merged 1 commit into
mainfrom
fix/151-secret-scan-guard
Jul 29, 2026
Merged

ci: add secret-scan gate to block hardcoded credentials (refs #151)#3
cultron merged 1 commit into
mainfrom
fix/151-secret-scan-guard

Conversation

@cultron

@cultron cultron commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Refs apsoai/apso-platform-server#151. Parallel to apsoai/service-template-ts#20 (the TypeScript template's gate).

Why

Issue #151: a hardcoded Stripe test secret shipped in a scaffolded template, blocking user deploys via GitHub push protection and leaking the key into every generated repo. This template is cloned verbatim into users' services, so any committed secret reaches every customer.

Scan result for this repo

This template is clean of provider secrets. The only credential-shaped literals are local-dev defaults (docker-compose / localhost postgres passwords), which are not provider secrets and are intentionally out of the gate's scope. No source change was needed — this PR is the preventive gate only.

What

  • scripts/secret-scan.sh: scans tracked files for high-confidence provider secret patterns — Stripe sk_/rk_, AWS AKIA, GitHub gh*_, Slack xox*, PEM private keys. Publishable pk_ keys are allowed by design. Portable to bash 3.2 (macOS) and 4+ (CI).
  • .github/workflows/secret-scan.yml: runs the scan on push and PR. This repo had no CI, so the workflow is standalone.

Verified locally

  • Clean tree: secret-scan: clean, exit 0.
  • Injected sk_test_…: scan fails (exit 1) with a pointed error.

Scope

Preventive half only — it stops recurrence in this template path. The already-exposed key (S3 starter zip, archived v1 template history, previously-scaffolded repos) needs rotation, which is flagged to Matt and out of an agent's scope.

🤖 Generated with Claude Code

This template is cloned verbatim into every user's service repo, so any
committed provider secret ships to every customer and trips GitHub push
protection on their deploy (apsoai/apso-platform-server#151, first seen in the
v1 TypeScript template's hardcoded Stripe key).

- scripts/secret-scan.sh: scans tracked files for high-confidence provider
  secret patterns (Stripe sk_/rk_, AWS AKIA, GitHub gh*_, Slack xox*, PEM
  private keys). Publishable pk_ keys and local-dev defaults are intentionally
  not flagged. Portable to bash 3.2 and 4+.
- .github/workflows/secret-scan.yml: runs the scan on push and pull_request.
  This repo had no CI; this is a standalone gate.

Scan is clean on the current template. Parallel to apsoai/service-template-ts#20.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cultron
cultron merged commit 03c0eca into main Jul 29, 2026
2 checks passed
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