-
Notifications
You must be signed in to change notification settings - Fork 531
Add repository-level grype ignore policy for no-fix libc6 CVEs #52924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2046190
Initial plan
Copilot fb0ea9e
Apply repository .grype.yaml ignore policy for no-fix libc6 CVEs
Copilot 14a3e82
Add draft ADR-52924: repository-level grype config for risk-accepted …
github-actions[bot] 1a7818e
Merge branch 'main' into copilot/container-image-scan-fix-issues
github-actions[bot] 558f715
Fix Grype cache config isolation
Copilot a56d53b
Scope Grype exceptions to libc6 version
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Grype configuration used by `gh aw compile --grype`. | ||
| # | ||
| # Ignore rules below are documented risk acceptances for findings that have no | ||
| # upstream fix available. Each rule is scoped to a specific vulnerability ID, | ||
| # package, and version so other builds remain reported. Remove a rule as soon as | ||
| # the upstream base image ships a fix; the daily | ||
| # `--force-refresh-container-pins` scan picks the fix up automatically. | ||
| ignore: | ||
| # Debian glibc advisories affecting the Debian base layer of | ||
| # ghcr.io/github/github-mcp-server. Debian lists no fixed version for these | ||
| # CVEs, so there is nothing to upgrade to; gh-aw only runs this image as an | ||
| # MCP server and does not redistribute glibc. Re-evaluate when Debian | ||
| # publishes a patched libc6. | ||
| - vulnerability: CVE-2026-5450 | ||
| reason: "Debian lists no fixed libc6 version; risk-accepted until a patched base image ships." | ||
| package: | ||
| name: libc6 | ||
| version: 2.36-9+deb12u14 | ||
| type: deb | ||
| - vulnerability: CVE-2026-5928 | ||
| reason: "Debian lists no fixed libc6 version; risk-accepted until a patched base image ships." | ||
| package: | ||
| name: libc6 | ||
| version: 2.36-9+deb12u14 | ||
| type: deb | ||
| - vulnerability: CVE-2026-5435 | ||
| reason: "Debian lists no fixed libc6 version; risk-accepted until a patched base image ships." | ||
| package: | ||
| name: libc6 | ||
| version: 2.36-9+deb12u14 | ||
| type: deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
docs/adr/52924-grype-repository-config-for-risk-accepted-cves.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # ADR-52924: Repository-Level Grype Config for Risk-Accepted CVEs | ||
|
|
||
| **Date**: 2026-08-15 | ||
| **Status**: Draft | ||
| **Deciders**: pelikhan, copilot-swe-agent | ||
|
|
||
| --- | ||
|
|
||
| ### Context | ||
|
|
||
| The `gh aw compile --grype` scanner gates CI on `[Critical]` vulnerability findings. Three glibc CVEs (CVE-2026-5450, CVE-2026-5928, CVE-2026-5435) are present in the Debian base layer of `ghcr.io/github/github-mcp-server:v1.9.0`. Debian has published no fixed `libc6` version for any of these CVEs, so there is no upgrade path available. The daily container scan was failing consistently with findings that cannot be remediated, blocking the pipeline with no actionable next step. gh-aw only runs this image as an MCP server and does not redistribute glibc. | ||
|
|
||
| ### Decision | ||
|
|
||
| We will add optional repository-level grype configuration support to `pkg/cli/grype.go`. When `.grype.yaml` exists at the repository root it is mounted read-only into the grype scanner container and passed via `--config`, applying its `ignore` rules to the scan. The `.grype.yaml` file is reserved for documented, CVE-scoped risk acceptances where no upstream fix exists, mirroring the existing pattern used by `--grant` with `.grant.yaml`. Each ignore rule is scoped to a specific CVE ID, package, and affected version so newly disclosed vulnerabilities and rebuilt packages remain visible. Rules carry a `reason` field for auditability and must be removed as soon as Debian ships a patched base image. | ||
|
|
||
| ### Alternatives Considered | ||
|
|
||
| #### Alternative 1: Disable the Critical gate for the affected image | ||
|
|
||
| Remove or relax the `[Critical]` severity gate for `ghcr.io/github/github-mcp-server` entirely so the scan passes without further changes. This was rejected because it would suppress all future Critical findings in that image, not just the three unfixable CVEs, removing meaningful signal for vulnerabilities that do have fixes available. | ||
|
|
||
| #### Alternative 2: Suppress findings via CLI flags at the call site (not checked in) | ||
|
|
||
| Pass grype `--ignore-wont-fix` or ad-hoc `--config` flags from the gh-aw CLI invocation code rather than committing a `.grype.yaml` file to the repository. This was rejected because the rules would not be visible to code review, would not be co-located with the codebase they protect, and would make it harder to audit which CVEs are accepted and why. Checked-in ignore rules surface through normal PR review. | ||
|
|
||
| #### Alternative 3: Pin to an older image that predates the CVEs | ||
|
|
||
| Roll back the pinned digest for `ghcr.io/github/github-mcp-server` to a tag unaffected by these CVEs. This was rejected because the CVEs affect the upstream Debian base layer across all current releases; no available tag is unaffected. Additionally, pinning to an older image would introduce other unpatched vulnerabilities and diverge from the upstream release track. | ||
|
|
||
| ### Consequences | ||
|
|
||
| #### Positive | ||
| - Daily container scans pass again without manual intervention once Debian ships patches. | ||
| - Each risk acceptance is explicitly documented with a CVE ID, package/version scope, and `reason`, making the security posture auditable via normal code review. | ||
| - Newly disclosed `libc6` vulnerabilities and rebuilt packages are still reported because rules are scoped to specific CVE IDs and versions, not to the package as a whole. | ||
| - The approach is consistent with the existing `.grant.yaml` pattern already used for license policy, reducing cognitive overhead. | ||
|
|
||
| #### Negative | ||
| - The three accepted CVEs are suppressed from scan output, reducing the visible finding count. Reviewers must consult `.grype.yaml` to understand the full risk picture. | ||
| - Ignore rules require discipline to remove: if Debian ships a fix and nobody cleans up the rule, the patched CVE continues to be silenced. The daily `--force-refresh-container-pins` scan mitigates this but does not enforce rule removal. | ||
|
|
||
| #### Neutral | ||
| - Docker arg construction was extracted into a testable `grypeDockerArgs` helper; the change is a refactor with no behaviour change when `.grype.yaml` is absent. | ||
| - The feature is opt-in: repositories without `.grype.yaml` are unaffected. | ||
|
|
||
| --- | ||
|
|
||
| *ADR created by [adr-writer agent]. Review and finalize before changing status from Draft to Accepted.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/codebase-design]
validateContainerMountPathis called ongrypeContainerConfigPath(a compile-time constant) on every invocation. This validation can never fail and adds dead-error-path noise. Consider validating it once (e.g., in aTestMainorinitguard) or asserting it at compile time with a constant-fold check.💡 Detail
grypeContainerConfigPath = "/tmp/gh-aw-grype-config.yaml"is a fixed constant that cannot change at runtime.validateContainerMountPathwill always succeed for it, so the error branch at line 262 can never be reached. Either remove the runtime call and use the constant directly (trusting the existing testTestGrypeDockerArgs_WithConfig), or add a package-levelinit()assertion:@copilot please address this.