Commit 1fc44b3
Pin Semgrep CI image by digest and drop security-events from the container job
The Semgrep workflow runs a third-party container on a daily cron with
`security-events: write` and the repository checked out. Two hardening changes
(CWE-829, Inclusion of Functionality from Untrusted Control Sphere):
1. Pin `returntocorp/semgrep` by immutable digest instead of the `1.166.0` tag.
A version tag on Docker Hub is still mutable — it can be re-pointed at new
content upstream, and the next scheduled run would execute unreviewed code
with no PR gate. The digest is the same image that tag resolves to today
(multi-arch index, pushed 2026-06-11), so this is a no-op for behaviour.
2. Move the SARIF upload into its own job. `security-events: write` is now held
only by a job that runs no third-party code; the container job keeps
`contents: read`. If the image is ever compromised it can no longer forge
entries in the code-scanning dashboard. The SARIF crosses between jobs as a
workflow artifact, uploaded with `if: always()` because `semgrep ci` exits
non-zero when it has blocking findings.
Also adds a Dependabot config for `github-actions` so the action SHA pins do not
go stale. Dependabot cannot bump a workflow `container:` digest
(dependabot/dependabot-core#5819), so the refresh command for the image pin is
recorded next to it.
Ref: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 55b79c4 commit 1fc44b3
2 files changed
Lines changed: 57 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
| |||
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
40 | | - | |
| 49 | + | |
41 | 50 | | |
42 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
43 | 80 | | |
44 | 81 | | |
45 | 82 | | |
46 | 83 | | |
47 | | - | |
| |||
0 commit comments