Skip to content

Commit 6cd4f31

Browse files
dorlugasigalCopilot
andcommitted
docs(ci): teach security-autofix that npm audit does not cover the Docker image
The first run assumed a passing npm audit meant the Docker image was clean and missed adm-zip (vendored inside @github/copilot). Make the prompt explicit: the Trivy Docker-image scan cannot be reproduced in the sandbox and npm audit does not see dependencies bundled inside third-party CLIs, so the agent must read the failing Trivy (Docker image) log and remediate each finding via a bump or a justified .trivyignore entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2e044186-b7f4-4228-b0c9-89ffe9e2922c
1 parent f0cdb19 commit 6cd4f31

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/security-autofix.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/security-autofix.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,18 @@ Reproduce every failing scan so you fix real findings, not guesses.
143143
job log from the most recent failing Security run (use the GitHub tools) to get the
144144
exact `Library`, `Installed Version`, and `Fixed Version` for each HIGH/CRITICAL
145145
finding, and which lockfile it came from.
146-
3. **Trivy Docker image.** Read the failing `Trivy (Docker image)` job log the same way.
147-
Note the file **path** Trivy reports for each finding (e.g.
148-
`app/node_modules/@github/copilot/...`) — the path tells you whether the vulnerable
149-
package lives in a lockfile you control or is **vendored inside a third-party package**.
146+
3. **Trivy Docker image.** **You cannot run this scan in your sandbox** (there is no
147+
Docker daemon and no Trivy vulnerability database), and — critically — **`npm audit`
148+
does NOT cover it.** The Docker image is built with `npm ci --omit=dev`, so it contains
149+
production dependencies _and everything they bundle_, including third-party CLIs that
150+
vendor their own `node_modules` which `npm audit` cannot see. **Do not assume the image
151+
is clean just because `npm audit` passes.** Instead, read the most recent failing
152+
`Trivy (Docker image)` job log via the GitHub tools and record every HIGH/CRITICAL
153+
finding with its `Library`, `Installed Version`, `Fixed Version`, and the **file path**
154+
Trivy reports. In particular, dependencies bundled under
155+
`node_modules/@github/copilot/**` (the Copilot CLI, pulled in transitively by the
156+
`@github/copilot-sdk` production dependency — e.g. `adm-zip`, `sharp`) are a recurring
157+
source of image-only findings that are **not** in any lockfile you control.
150158

151159
## Step 3 — Remediate each finding by category
152160

@@ -205,6 +213,11 @@ these categories:
205213
- Run `npm ci` in the root and `cd src/frontend && npm ci && npm run build` to confirm the
206214
refreshed lockfiles still install and the frontend still builds.
207215
- Run `npm run format` so lockfile/manifest formatting matches the repo style.
216+
- **You cannot re-run the Trivy Docker-image scan locally.** For image-only findings,
217+
trust the findings you read from the failing `Trivy (Docker image)` log and make sure
218+
each one is either resolved by a bump you made or listed in `.trivyignore` with
219+
justification — do not leave an image finding unhandled on the assumption that
220+
`npm audit` covers it (it does not).
208221

209222
## Step 6 — Open the pull request
210223

0 commit comments

Comments
 (0)