Commit b2f0af2
fix: fail explicitly when Docker scan fails to prevent fail-open bypass
docker run ... 2>/dev/null || true suppresses all stderr and forces
exit 0 in every case. If TruffleHog or Docker fails at runtime (image
pull error, OOM, container crash), SCAN_OUTPUT is empty → VERIFIED_COUNT=0
→ job passes silently — a fail-open that bypasses the required ruleset check.
Fix: capture the exit code without || true. TruffleHog exits 0 (no
secrets) or 183 (secrets found) on a successful run. Any other code
means the scanner itself failed — fail the job explicitly with ::error
rather than silently passing with zero findings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 107b04c commit b2f0af2
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
133 | 143 | | |
134 | 144 | | |
135 | 145 | | |
| |||
0 commit comments