fix(entrypoint): bind-mount passwd/group synthesis fallback for read-only /host/etc (ARC/DinD)#4831
Conversation
When entrypoint.sh cannot append to /host/etc/passwd or /host/etc/group because the filesystem is read-only (ARC/DinD with tmpfs-backed daemon root), copy the existing file to /tmp/awf-etc/ and bind-mount it over the read-only original after appending the synthesized entry. CAP_SYS_ADMIN is still held at entrypoint time (dropped by capsh before user code runs), so mount --bind succeeds. This replaces the [WARN] + continue path that caused downstream capsh identity resolution failures. Also update docs/chroot-mode.md to describe the new bind-mount fallback. Closes #4829
There was a problem hiding this comment.
Pull request overview
This PR improves chroot-mode identity synthesis on ARC/DinD runners by adding a bind-mount fallback when /host/etc/passwd and /host/etc/group are read-only, preventing capsh from falling back to numeric UID/GID and breaking identity-dependent features.
Changes:
- Add a read-only fallback path in
containers/agent/entrypoint.shthat writes synthesized passwd/group entries to/tmp/awf-etc/and bind-mounts them over/host/etc/*. - Update chroot-mode documentation to describe the new bind-mount fallback and its
CAP_SYS_ADMINdependency.
Show a summary per file
| File | Description |
|---|---|
| containers/agent/entrypoint.sh | Adds bind-mount fallback for passwd/group synthesis when /host/etc is read-only in ARC/DinD. |
| docs/chroot-mode.md | Documents the new runtime bind-mount fallback behavior and capability requirement. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add npm overrides for esbuild (0.28.1) and vite (8.0.16) to fix: - GHSA-gv7w-rqvm-qjhr: esbuild RCE via NPM_CONFIG_REGISTRY - GHSA-g7r4-m6w7-qqqr: esbuild arbitrary file read on Windows - GHSA-j687-52p2-xcff: Astro XSS in define:vars - GHSA-xr5h-phrj-8vxv: Astro server island replay attack Remaining 5 moderate vulns are in yaml (deep transitive via @astrojs/check) with no fix available yet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
…nthesis-issue # Conflicts: # docs-site/package-lock.json # docs-site/package.json
Merge conflicts resolved. The only conflicted files were |
🔬 Smoke Test: Copilot PAT Auth — PASS
PR: fix(entrypoint): bind-mount passwd/group synthesis fallback for read-only /host/etc (ARC/DinD) Overall: PASS ✅
|
|
Smoke Test Results:
|
Smoke Test: Copilot BYOK ✅ PASS
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com
|
|
✅ feat(api-proxy): implement OTLP fan-out to multiple endpoints Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
This comment has been minimized.
This comment has been minimized.
🔥 Smoke Test Results
PR: fix(entrypoint): bind-mount passwd/group synthesis fallback for read-only /host/etc (ARC/DinD) Overall: INCONCLUSIVE — MCP test passed; 2 pre-computed tests had unresolved
|
Chroot Version Comparison Results
Overall: ❌ NOT all tests passed Python and Node.js versions differ between host and chroot environments. Go matches.
|
Smoke Test Results — FAIL
Overall: FAIL The AWF firewall explicitly blocks database/Redis ports (5432, 6379) via iptables DROP rules in
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS Version info
|
Tests: ✅ MCP ✅ GitHub.com ✅ File write/read ✅ 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: PASS cc
|
On ARC/DinD runners the Docker daemon's root filesystem is often read-only or tmpfs-backed, so
entrypoint.sh's runtime identity synthesis silently failed when appending to/host/etc/passwdand/host/etc/group. This causedcapshto fall back to numeric UID/GID — breaking threat-detection and requiring consumers to pre-seed the daemon's/etc/passwdas a workaround.Changes
containers/agent/entrypoint.shWhen appending to
/host/etc/passwd(or/host/etc/group) fails (EROFS), falls back to:/tmp/awf-etc/mount --binding the copy over the read-only originalCAP_SYS_ADMINis still held at this point in the entrypoint (dropped bycapshjust before user code runs), so the bind-mount succeeds. The mount is container-scoped and cleaned up on exit.docs/chroot-mode.md