Skip to content

fix: resolve High/Critical CVEs in agent, api-proxy, and cli-proxy container images#6545

Merged
lpcox merged 7 commits into
mainfrom
copilot/fix-gh-aw-firewall-cves
Jul 23, 2026
Merged

fix: resolve High/Critical CVEs in agent, api-proxy, and cli-proxy container images#6545
lpcox merged 7 commits into
mainfrom
copilot/fix-gh-aw-firewall-cves

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The supply-chain scan gate (grype --fail-on high) has been red on every PR since it was added — all three mutable images (agent, api-proxy, cli-proxy) ship packages with High/Critical CVEs. squid is clean.

agent — Go 1.18 stdlib (44 findings, 3 Critical)

Ubuntu 22.04's apt gosu package is compiled with the system Go 1.18 toolchain, producing 44 stdlib CVEs. Replaced with gosu 1.19 from the official GitHub release (compiled with Go 1.24.6). SHA-256 verified for all 8 architectures.

# Before: PKGS="... gosu ..."  ← built with Go 1.18 by Ubuntu
# After: download gosu 1.19 from GitHub releases, verify SHA-256, install to /usr/local/bin
GOSU_VERSION="1.19"
case "$GOSU_ARCH" in
  amd64)   GOSU_SHA256="52c8749d..." ;;
  arm64)   GOSU_SHA256="3a8ef022..." ;;
  ...
esac

api-proxy — @opentelemetry/propagator-jaeger 1.30.1 (GHSA-45rx-2jwx-cxfr)

Transitive dep of sdk-trace-node@^1.30.1, not directly used by the proxy code. Used npm overrides to force it to the patched 2.x release without touching sdk-trace-node (API-compatible — same JaegerPropagator export, same @opentelemetry/api peer dep range).

Also switched the npm upgrade from npm install -g (leaves stale 10.x bundles) to the same clean tarball-extraction approach used in the agent image.

cli-proxy — curl, npm bundled deps, Go modules in gh binary

Three separate issues in the unpinned node:22-alpine base:

  • curl 8.20.0-r1 (8 Criticals): pinned base to node:22.23.1-alpine3.24, added apk add "curl>=8.21.0-r0".
  • npm 10.x bundled deps (tar 7.5.11, sigstore 3.x, picomatch 4.0.3, brace-expansion 2.x): clean-install npm 11.18.0 from the registry tarball — same approach as agent, avoids stale 10.x remnants. npm 11.18.0 bundles the fixed versions of all four packages.
  • Alpine github-cli (older Go toolchain): replaced with the official gh 2.96.0 release tarball (Go 1.26.4 → fixes GO-2026-5037; rekor 1.5.2 → fixes GHSA-47q9-m4ww-924m). SHA-256 verified for amd64/arm64/armv6.

Unresolvable CVEs — .grype.yaml suppressions

Two findings cannot be fixed at the image layer; each entry has an inline justification and a "revisit when" condition:

Advisory Rationale
CVE-2023-44487 / CVE-2026-45447 on nodejs NodeSource deb lacks "patched" metadata; Node 22 ships with the fix, and 22.23.1 is the latest available 22.x build
GHSA-hrxh-6v49-42gf (google.golang.org/grpc in gh binary) gh 2.96.0 embeds grpc 1.81.1; no newer gh release with grpc ≥ 1.82.1 exists yet

The supply-chain-scan workflow now mounts .grype.yaml into the grype container (-v $cwd/.grype.yaml:/root/.grype.yaml:ro) so suppressions are scoped to justified exceptions only.

Copilot AI changed the title [WIP] Fix High/Critical CVEs in gh-aw-firewall container images fix: resolve High/Critical CVEs in agent, api-proxy, and cli-proxy container images Jul 23, 2026
Copilot finished work on behalf of lpcox July 23, 2026 19:10
Copilot AI requested a review from lpcox July 23, 2026 19:10
@lpcox
lpcox marked this pull request as ready for review July 23, 2026 19:22
Copilot AI review requested due to automatic review settings July 23, 2026 19:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens container images against High/Critical CVEs and configures justified Grype exceptions.

Changes:

  • Replaces vulnerable gosu, gh, npm, curl, and Jaeger dependencies.
  • Pins and verifies downloaded artifacts.
  • Adds Grype suppressions and workflow configuration.
Show a summary per file
File Description
.grype.yaml Adds vulnerability exceptions.
.github/workflows/supply-chain-scan.yml Mounts Grype configuration.
containers/agent/Dockerfile Installs verified gosu 1.19.
containers/api-proxy/Dockerfile Cleanly installs npm 11.18.0.
containers/api-proxy/package.json Overrides the Jaeger propagator.
containers/api-proxy/package-lock.json Locks patched OpenTelemetry packages.
containers/cli-proxy/Dockerfile Pins Alpine and installs patched curl, gh, and npm.
containers/cli-proxy/package-lock.json Updates generated lock metadata.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Files not reviewed (2)
  • containers/api-proxy/package-lock.json: Generated file
  • containers/cli-proxy/package-lock.json: Generated file
  • Files reviewed: 6/8 changed files
  • Comments generated: 4
  • Review effort level: Medium

Comment thread .grype.yaml Outdated
Comment on lines +23 to +25
package:
name: nodejs
type: deb
Comment thread .grype.yaml Outdated
Comment on lines +34 to +36
package:
name: nodejs
type: deb
Comment thread .grype.yaml
Comment on lines +51 to +53
package:
name: google.golang.org/grpc
type: go-module
Comment on lines +78 to 80
'-v', f'{cwd}/.grype.yaml:/root/.grype.yaml:ro',
'anchore/grype@sha256:fd4ab4d1042b522c896e73bdf09ab8bf384fa417df99d6dd0d6e1008c7e7c821',
f'registry:{image}', '--fail-on', 'high',
@lpcox

lpcox commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed all three review threads in commit fix: scope grype suppressions to exact versions; add PR image build+scan step:

.grype.yaml version scoping — added version: to all three suppression entries:

  • CVE-2023-44487 and CVE-2026-45447 now match only nodejs version "22.23.1-1nodesource1" (the verified-patched NodeSource deb)
  • GHSA-hrxh-6v49-42gf now matches only google.golang.org/grpc version "v1.81.1" (the version embedded in gh 2.96.0)

Workflow — scan PR Dockerfiles — added a new "Build and scan PR container images" step that:

  1. Builds agent, api-proxy, and cli-proxy from the Dockerfiles in the branch
  2. Saves each to a /tmp/*.tar and scans it with grype using the docker-archive: scheme (no Docker socket exposure)
  3. Fails the job if any High/Critical CVE is found

This step sits between the existing lock-manifest scan and the Grant license check, so both published images (regression guard) and the PR's built images (fix validation) are exercised.

Also bumped timeout-minutes from 20 → 40 to accommodate the three container builds.

Copilot finished work on behalf of lpcox July 23, 2026 19:32
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.96% 98.99% 📈 +0.03%
Statements 98.88% 98.91% 📈 +0.03%
Functions 99.41% 99.41% ➡️ +0.00%
Branches 95.30% 95.30% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

The 'Scan images for CVEs' step scanned the immutable image digests recorded
in the compiled .lock.yml gh-aw-manifest headers. Those are already-published
first-party images (pre-PR, cannot be rebuilt by a PR) plus upstream
third-party images (playwright, github-mcp-server, gh-aw-node, mcpg, ...) that
this repo cannot patch. So the step failed on every PR with CVEs the PR's
Dockerfile fixes could never clear, and it ran before the new build+scan step
that actually validates the fixes.

Split blocking vs. report-only:
- BLOCKING gate: 'Build and scan PR container images' rebuilds agent/api-proxy/
  cli-proxy from the PR Dockerfiles and fails on High/Critical. This is the only
  scan that reflects a PR's changes.
- REPORT-ONLY: the Grype (manifest digests) and Grant scans now surface findings
  as ::warning:: annotations but exit 0, since they target immutable/third-party
  images a PR cannot fix.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fc43a66c-c49d-46ef-b9f0-02527a9102fb
@lpcox
lpcox enabled auto-merge (squash) July 23, 2026 19:58
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT reports failed. PAT auth path may have issues...

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

Smoke test progress: File and Bash tests passed. Connectivity and MCP tools are currently failing. Investigating connectivity details.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing reports failed. OTel tracing regression detected. ⚠️

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Security Guard failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK reports failed. BYOK mode investigation needed...

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Chroot tests failed Smoke Chroot failed - See logs for details.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT reports failed. PAT auth path may have issues...

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Contribution Check failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK reports failed. BYOK mode investigation needed...

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

Smoke test completed with a FAIL status due to connectivity issues. Comment added to PR #6545.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Build Test Failed Build Test Suite - See logs for details

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
gh check ✅ PASS
File status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #6545 · haiku45 59.5 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test Results

Test Status
GitHub MCP ✅ Connected (secrecy policy filtered PR data — expected)
GitHub.com HTTP ✅ 200 OK
File Write/Read ✅ Pre-step verified

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 AWF Network Isolation Smoke Test

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com) — HTTP 200
  • ✅ Blocked domain (example.com) — connection denied (403 from proxy)

Overall: PASS — egress enforcement is working as expected.

@lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

✅ ci: add required supply-chain scan on every PR
✅ chore: upgrade gh-aw extension to v0.83.0 (pre-release)
✅ GitHub title check
✅ file write/read
✅ build
PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox
MCP tool: ✅
GitHub.com: ✅
File R/W test: ❌
BYOK inference: ✅

Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra

Overall: FAIL

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

GitHub MCP Testing: ✅
GitHub.com Connectivity: ✅
Agent I/O test: ✅
BYOK Inference Test: ✅

Overall: PASS

@lpcox

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Smoke Test: Docker Sbx — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity
File write/read ✅ (smoke-test-docker-sbx-30048451525.txt confirmed)

Overall: ✅ PASS

@lpcox — all smoke tests passed.

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 9bfc726 into main Jul 23, 2026
136 of 145 checks passed
@lpcox
lpcox deleted the copilot/fix-gh-aw-firewall-cves branch July 23, 2026 22:17
lpcox added a commit that referenced this pull request Jul 24, 2026
PR #6545 (CVE cleanup) reworked the agent image's package install and
switched Node.js from the NodeSource apt package to the official static
tarball. That inadvertently dropped python3, which had been present
transitively and is used by the release-time seccomp regression check
(scripts/ci/check-agent-seccomp-syscalls.sh) to fire the
name_to_handle_at/open_by_handle_at syscalls via python3+ctypes.

As a result the "Verify seccomp blocks name_to_handle_at/open_by_handle_at"
release step failed with "Image does not contain python3".

Restore python3 by adding it to the agent image's package list. python3 is
also commonly needed by agent workflows, matching GitHub runner images.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b5e69791-2bb7-4379-938e-464e9b83c056
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supply-chain scan: High/Critical CVEs in gh-aw-firewall container images (agent, api-proxy, cli-proxy)

3 participants