Fix IAM Policy Reader Revocation Check in Static Secrets Validation
I corrected the regex that detects reader_access = false in the static checks script so the pipeline reliably preserves IAM policy assignments when revoking secret readers. The previous fixed-string match missed lines with extra whitespace, causing the check to pass incorrectly.
Tightened the reader_access detection pattern
In scripts/ci/static-checks.sh the ripgrep invocation changed from rg -Fq 'reader_access = false' to rg -q '^[[:space:]]*reader_access[[:space:]]*=[[:space:]]*false$'. The new pattern anchors to line boundaries, tolerates any amount of whitespace around the equals sign, and no longer relies on a fixed-string match. This ensures the script catches every parameter block that explicitly disables reader access, regardless of formatting.
Commit context confirms the preservation goal
The commit message fix(secrets): preserve IAM policy assignment during reader revocation (#2367) indicates the intent: when a secret’s reader access is revoked, the associated IAM policy assignment must remain intact. The regex fix makes that guarantee enforceable in CI.
Pattern for platform teams validating secret metadata
When secret metadata includes toggle fields like reader_access, write the validation regex to match the full line with flexible whitespace. Anchor the pattern and avoid fixed-string flags so that formatting differences in generated or hand-edited files don’t create false negatives. Run the check in the pipeline to catch drift before it reaches the cluster.