Skip to content

ci(screenshots): scan screenshots & manifest for leaked secrets - #368

Open
yeongseon wants to merge 1 commit into
mainfrom
ci/screenshot-secret-scan-365
Open

ci(screenshots): scan screenshots & manifest for leaked secrets#368
yeongseon wants to merge 1 commit into
mainfrom
ci/screenshot-secret-scan-365

Conversation

@yeongseon

Copy link
Copy Markdown
Owner

Context

Closes #365. Mirrors the openapi hardening (yeongseon/azure-functions-openapi-python#517). Documentation screenshots and their manifest can accidentally capture live Azure secrets — subscription ids, storage/SAS keys, function code= keys, SAS signatures, or bearer tokens — which are effectively leaked once committed. The screenshot staleness checker already gates PRs, so it is the natural place to also gate secret leakage.

What changed

  • scripts/check_screenshots.py: added a narrow, high-signal secret scanner (_SECRET_PATTERNS, _scan_text_for_secrets, _scan_secrets) wired into _check() as a hard failure. Scans the manifest text and every committed screenshot's bytes. Matched secrets are redacted in output (never echoed to CI logs). Reviewed false positives can be exempted via a manifest-level secret_scan_allow list. The repo's empty-manifest (screenshots: []) allowance is preserved.
  • tests/test_screenshot_manifest.py: added regression tests for detection, non-echo redaction, and the allowlist exemption.

Verification

  • make test → 336 passed (coverage gate met)
  • make lint → All checks passed
  • make typecheck → no issues in 32 files

…ecrets

Ports the openapi secret scanner to this repository's screenshot
staleness checker so a screenshot (or its manifest) that captures an
Azure subscription id, storage/SAS key, function code= key, SAS
signature, or bearer token hard-fails CI before it can be committed.
Matched secrets are redacted in output so the scanner never re-leaks
them into CI logs. Reviewed false positives can be exempted via a
manifest-level 'secret_scan_allow' list.

Closes #365
@yeongseon yeongseon added the enhancement New feature or request label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(screenshots): add secret-leak scan gate to screenshot capture

2 participants