Skip to content

Expose RHEL/Amazon Linux CA roots in chroot mode#6460

Merged
lpcox merged 3 commits into
mainfrom
copilot/resolve-ca-bundle-issue
Jul 21, 2026
Merged

Expose RHEL/Amazon Linux CA roots in chroot mode#6460
lpcox merged 3 commits into
mainfrom
copilot/resolve-ca-bundle-issue

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Amazon Linux and RHEL runners could still lose access to the system CA bundle after entering the chroot, even with bundle copy logic present. The missing /etc/pki visibility left native TLS clients without trusted roots and caused Copilot CLI requests to fail before the first model call.

  • Mount policy

    • Add the RHEL-family CA locations to the chroot-visible /etc allowlist:
      • /etc/pki/ca-trust
      • /etc/pki/tls
    • This makes both direct bundle paths and /etc/ssl symlink targets under /etc/pki resolvable inside /host.
  • Entrypoint CA detection

    • Treat /etc/pki/ca-trust/* and /etc/pki/tls/* the same as existing mounted CA paths.
    • Preserve the existing fallback behavior: if the detected bundle is still not chroot-visible, stage it under /tmp/awf-lib/system-ca-certificates.crt and point TLS env vars at the staged copy.
  • Regression coverage

    • Extend mount-policy and agent-volume tests to assert the new /etc/pki mounts.
    • Extend the entrypoint phase test to assert that mounted RHEL/Amazon Linux CA paths are recognized as already accessible in chroot.
case "$CHROOT_RELATIVE" in
  /etc/ssl/*|/etc/ca-certificates/*|/etc/pki/ca-trust/*|/etc/pki/tls/*)
    export SSL_CERT_FILE="$CHROOT_RELATIVE"
    export NODE_EXTRA_CA_CERTS="$CHROOT_RELATIVE"
    ;;
esac

Copilot AI changed the title [WIP] Fix CA bundle availability in chroot for Amazon Linux Expose RHEL/Amazon Linux CA roots in chroot mode Jul 21, 2026
Copilot finished work on behalf of lpcox July 21, 2026 02:36
Copilot AI requested a review from lpcox July 21, 2026 02:36
@lpcox
lpcox marked this pull request as ready for review July 21, 2026 05:06
Copilot AI review requested due to automatic review settings July 21, 2026 05:06

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

Exposes RHEL/Amazon Linux CA bundles inside Docker chroot mode to restore native TLS trust.

Changes:

  • Adds /etc/pki CA paths to the mount policy.
  • Recognizes mounted RHEL-family CA bundles in the entrypoint.
  • Updates documentation and regression assertions.
Show a summary per file
File Description
containers/agent/entrypoint.sh Recognizes mounted RHEL CA paths.
docs/chroot-mode.md Documents new CA mounts.
src/config/mount-policy.test.ts Tests policy entries.
src/config/sandbox-mount-policy.json Adds RHEL CA mounts.
src/services/agent-volumes-basic.test.ts Tests generated agent volumes.
src/services/agent-volumes/etc-mounts.test.ts Tests /etc mount generation.
tests/entrypoint-phase-functions.test.sh Checks entrypoint CA-path handling.

Review details

Tip

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

  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • Review effort level: Medium

Comment thread src/config/sandbox-mount-policy.json Outdated
"sysroot": ["/sys", "/dev"]
},
"etc": ["/etc/ssl", "/etc/ca-certificates", "/etc/alternatives", "/etc/ld.so.cache", "/etc/nsswitch.conf"]
"etc": ["/etc/ssl", "/etc/ca-certificates", "/etc/pki/ca-trust", "/etc/pki/tls", "/etc/alternatives", "/etc/ld.so.cache", "/etc/nsswitch.conf"]
Comment thread src/config/sandbox-mount-policy.json Outdated
"sysroot": ["/sys", "/dev"]
},
"etc": ["/etc/ssl", "/etc/ca-certificates", "/etc/alternatives", "/etc/ld.so.cache", "/etc/nsswitch.conf"]
"etc": ["/etc/ssl", "/etc/ca-certificates", "/etc/pki/ca-trust", "/etc/pki/tls", "/etc/alternatives", "/etc/ld.so.cache", "/etc/nsswitch.conf"]
Comment on lines +152 to +155
if printf '%s\n' "${COPY_SYSTEM_CA_BUNDLE_BLOCK}" | grep -Fq '/etc/pki/ca-trust/*|/etc/pki/tls/*)'; then
pass "copy_system_ca_bundle() treats mounted RHEL/Amazon Linux CA paths as chroot-accessible"
else
fail "copy_system_ca_bundle() does not recognize mounted RHEL/Amazon Linux CA paths as chroot-accessible"
@lpcox

lpcox commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review thread.

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, app...

Implemented in commit 57a8460 with all linked review-thread items addressed: narrowed /etc/pki CA mounts to CA-only paths, skipped unavailable optional /etc/pki mounts (including split-filesystem prefix handling), and added executable entrypoint fixture coverage for direct /etc/pki and /etc/ssl symlink CA readability in chroot.

Copilot finished work on behalf of lpcox July 21, 2026 05:52
@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

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit 8488acc

@lpcox
lpcox enabled auto-merge (squash) July 21, 2026 05:55
@github-actions

github-actions Bot commented Jul 21, 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 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Security Guard failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

Contribution check complete: PR #6460 follows the documented contribution guidelines. It includes tests for the new CA mount behavior, updates docs, places changes in the appropriate source and test directories, and the PR description is clear with a related issue reference. No comment needed.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

Copilot BYOK (Direct) Smoke Test: PASS

✅ GitHub MCP connectivity (API responsive)
✅ GitHub.com connectivity (HTTP 200)
✅ BYOK inference path active (agent → api-proxy sidecar → api.githubcopilot.com)

Running in direct BYOK mode with COPILOT_PROVIDER_API_KEY routing through api-proxy.

@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 #6460 · 54.3 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis PING: ❌ (host.docker.internal DNS resolution failed)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (DNS resolution failed)

Overall: FAILhost.docker.internal is not resolvable in this environment.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions github-actions Bot mentioned this pull request Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test Results

Test Status
GitHub MCP connectivity ✅ Connected (filtered response received)
GitHub.com HTTP ✅ (pre-step: N/A — template unresolved)
File write/read ⚠️ Template variables not resolved by runner

Overall: PASS (core connectivity confirmed)

Triggered on PR #6460 by @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor
  • fix(docs-site): migrate to astro v6 content collections config ✅
  • fix(docs-site): resolve high-severity js-yaml npm audit finding ✅
  • GitHub reads ✅
  • Playwright ✅
  • File write/read ✅
  • Discussion query/comment ✅
  • Build ✅
  • Overall: 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
${{ steps.smoke-data.outputs.SMOKE_PR_DATA }} ✅
GitHub.com connectivity ✅
File write/read test ✅
BYOK inference test ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
PASS

🔑 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 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

@lpcox

Smoke Test Status:
• GitHub MCP Testing: ✅
• GitHub.com Connectivity: ✅
• File Write/Read Test: ✅
• BYOK Inference Test: ✅

Running in direct BYOK mode via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra

Overall: PASS

🪪 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

Chroot Runtime Version Check ✅

All runtimes match between host and chroot environments.

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13
Node.js v24.18.0 v24.18.0
Go go1.22.12 go1.22.12

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing — Results

Scenario Status Notes
1. Module Loading ✅ Pass otel.js loads successfully; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled + test helpers
2. Test Suite ✅ Pass 39 tests passed, 0 failed (otel.test.js — covers ProxyAwareOtlpExporter, FileSpanExporter, FanOutSpanExporter, span lifecycle, shutdown)
3. Env Var Forwarding ✅ Pass src/services/api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME to the api-proxy container
4. Token Tracker Integration ✅ Pass onUsage callback exists in token-tracker-http.js (line 343); invoked after normalized usage extraction — confirmed OTEL hook point is wired
5. OTEL Diagnostics ✅ Pass Module initializes with isEnabled: true; falls back to FileSpanExporter (/var/log/api-proxy/otel.jsonl) when no OTLP endpoint is configured — graceful degradation confirmed

All 5 scenarios pass. OTEL tracing integration is fully functional with fan-out export, parent context propagation, GenAI semantic conventions, and graceful no-op fallback when unconfigured.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for #6460 · 43.3 AIC · ⊞ 8.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results — Docker Sbx

Test Result
GitHub MCP connectivity
GitHub.com HTTP ✅ 200
File write/read ⚠️ template vars unexpanded

Overall: PASS (core connectivity verified; file test skipped due to unexpanded template vars in pre-step)

cc @lpcox

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

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.

RHEL/Amazon Linux system CA bundle remains unavailable in chroot after #5783

3 participants