Commit 28fdf19
fix(secret-scanner): honor pragma + .shell-secrets-ignore + skip param-expansion (#236)
## Summary
- Adds inline pragma support to `shell-secrets` job: `# scanner-allow:
shell-secrets` or `# hypatia: allow security_errors/secret_detected` on
same or preceding line suppresses the hit.
- Adds `.shell-secrets-ignore` file support: gitignore-style path globs
in repo root to exclude entire files from scanning.
- Adds automatic param-expansion skip: assignments whose RHS is
`${VAR}`, `${VAR:-…}`, `${VAR:?…}`, or `$VAR` are never real secrets and
are skipped without any pragma.
## Motivation
Two estate repos (`hypatia/main`, `gitbot-fleet/main`) had persistent
`scan / shell-secrets` failures from three false-positive classes — test
fixtures, param-expansion defaults, and a remediation script that
documents the patterns it rewrites. The scanner had no exemption
mechanism, so every false positive required either deleting the scanner
or ignoring the failure.
## Test plan
- [x] Local smoke test: all three failing patterns (`export
ARANGODB_PASSWORD="testpassword"` with pragma,
`CICD_CACHE_PASSWORD="${CICD_CACHE_PASSWORD:-}"` param-expansion,
`fix-hardcoded-secrets.sh` comment with pragma) → all skip cleanly.
- [x] Real-secret smoke test: `export
API_TOKEN="ghp_abcdefghijklmnopqrstuvwxyz123456"` still caught.
- [ ] CI green on this PR (no `.sh` files in standards itself trigger
the scanner).
Downstream: after this merges, bump SHA pin in `hypatia` and
`gitbot-fleet` callers + add pragmas.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e964bd8 commit 28fdf19
1 file changed
Lines changed: 95 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
130 | 142 | | |
131 | 143 | | |
132 | 144 | | |
| |||
143 | 155 | | |
144 | 156 | | |
145 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
146 | 191 | | |
147 | 192 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
152 | 239 | | |
153 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
154 | 244 | | |
155 | 245 | | |
156 | 246 | | |
| |||
0 commit comments