From af02798bd821e0b14fb70b8b8ee744cc868fadad Mon Sep 17 00:00:00 2001 From: Cristian Magherusan-Stanciu Date: Sat, 17 Oct 2026 01:52:29 +0200 Subject: [PATCH] sec(pre-commit): scan test files for private keys and drop the dead gitleaks ignore The detect-private-key hook excluded _test.go files and frontend/src/index.html. No _test.go file contains a PEM private key and frontend/ does not exist in this repo, so the exclude only hid future leaks. Remove it and update the comment. .gitleaksignore held a comment plus one entry for internal/secrets/aws_resolver_httptest_test.go, a path that does not exist here, and nothing runs gitleaks. Nothing referenced the file. Delete it. Running gitleaks in CI (item 3 of #101) stays open. Refs #101 Co-Authored-By: Claude Opus 5.5 --- .gitleaksignore | 3 --- .pre-commit-config.yaml | 7 ++----- 2 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 .gitleaksignore diff --git a/.gitleaksignore b/.gitleaksignore deleted file mode 100644 index 67185772..00000000 --- a/.gitleaksignore +++ /dev/null @@ -1,3 +0,0 @@ -# AWS official example credentials used in tests -# See: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-creds.html#sec-access-keys-and-secret-access-keys -internal/secrets/aws_resolver_httptest_test.go diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a776e4c0..be25de33 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,11 +64,8 @@ repos: name: Check for merge conflicts - id: detect-private-key name: Detect private keys - # Audit (PR5): internal/credentials/resolver.go contains zero - # private-key-shaped patterns (verified by grep). The exclusion - # was a historical artifact; removing it tightens the gate - # without breaking any legitimate code. - exclude: '(_test\.go|frontend/src/index\.html)$' + # Test files are scanned too: no _test.go file contains a PEM + # private key, so the old exclude only hid future leaks. - id: check-case-conflict name: Check for case conflicts