Skip to content

[awf] ARC/DinD chroot: 7 gaps remain after v0.75.0 fix requiring workflow-level workarounds #4787

Description

@lpcox

Problem

On ARC/DinD runners with (redacted) DOCKER_HOST`, AWF v0.25.53 chroot mode still forces 7 workflow-level workarounds despite gh-aw #30840 being closed as fixed in v0.75.0.

Context

Upstream report: github/gh-aw#34896

Root Cause

Seven distinct deficiencies in the firewall agent:

  1. Chroot rejects Alpine/musl DinDentrypoint.sh requires capsh + glibc on the daemon host; stock docker:dind (Alpine) fails (chroot: No such file or directory)
  2. engine.env identity vars clobbered by capshHOME/USER/LOGNAME are reset by the user-switch in entrypoint.sh; engine.env overrides are lost, breaking Copilot
  3. TCP DOCKER_HOST doesn't resolve daemon filesystemhost-env.ts infers the bind-mountable root from the DOCKER_HOST URL scheme; TCP hosts have no unix-socket path to derive the daemon rootfs from
  4. Runner-installed binaries invisible in chrootagent-volumes.ts mounts the daemon's /usr:ro, not the runner's, so runner-installed copilot is absent
  5. INTERNAL_SERVERS hardcodes "github"mount_mcp_as_cli.cjs always excludes github MCP from CLI shimming when --disable-builtin-mcps is active
  6. No identity/hosts synthesis — AWF doesn't generate a minimal /etc/passwd//etc/group//etc/hosts for the target UID
  7. Threat-detection job silently no-ops — runs without pre-agent-steps; ENOENT on copilot is swallowed by GH_AW_DETECTION_CONTINUE_ON_ERROR default, masking the failure as green

Proposed Solution

  • containers/agent/entrypoint.sh: stage a glibc chroot-runtime bundle; apply engine.env identity vars post-capsh; synthesize /etc/passwd, /etc/group, /etc/hosts for the target UID
  • src/host-env.ts: add resolveDaemonFilesystem() using Docker API inspect (MergedDir/UpperDir) instead of DOCKER_HOST URL inference
  • src/services/agent-volumes.ts: include engine binary staging into chroot overlay for both agent and detection jobs
  • containers/agent/Dockerfile: bundle capsh, /bin/sh, busybox applets, and libutil.so.1 as a chroot-runtime tarball
  • Fix INTERNAL_SERVERS hardcoding and reconsider GH_AW_DETECTION_CONTINUE_ON_ERROR default to surface setup failures

Generated by Firewall Issue Dispatcher ·

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions