You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: enable cli-proxy in smoke-copilot workflow (#1820)
* feat: enable cli-proxy in smoke-copilot workflow
Add features.cli-proxy: true to smoke-copilot.md and recompile with
gh-aw dev build (bda91a78) that emits --difc-proxy-host and
--difc-proxy-ca-cert flags plus Start/Stop CLI proxy steps.
Post-processed with postprocess-smoke-workflows.ts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: handle quoted paths in postprocess install step regex
The new gh-aw compiler quotes the install_awf_binary.sh path:
bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.17
The regex only matched unquoted paths, so the install step was not
replaced with npm ci / npm run build. This caused --build-local to
fail at runtime since the standalone bundle doesn't support it.
Add optional double-quote matching ("?) around the path in the regex.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: inject GH_TOKEN into cli-proxy container environment
The gh CLI inside the cli-proxy container needs a GitHub token to
authenticate API requests. Without it, gh commands hang waiting for
auth and time out after 30s.
The token is safe in the cli-proxy container: it's inside the firewall
perimeter, not accessible to the agent, and the DIFC proxy on the host
provides write-control via its guard policy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: add iptables filter ACCEPT rule for cli-proxy
The cli-proxy container (172.30.0.50) had a NAT RETURN rule so traffic
wouldn't be DNAT'd to Squid, but was missing the corresponding filter
ACCEPT rule. The final 'iptables -A OUTPUT -p tcp -j DROP' rule silently
dropped all TCP connections to cli-proxy, causing 'curl exit 28' timeouts
in the agent's gh-cli-proxy-wrapper.sh.
This matches how api-proxy is handled: both NAT RETURN (line 173) and
filter ACCEPT (line 406).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: add structured logging to cli-proxy
Add JSON-line access logging to server.js and connection logging to
tcp-tunnel.js for better observability in CI:
server.js:
- Writes structured JSON entries to /var/log/cli-proxy/access.log
(volume already mounted and preserved by docker-manager.ts)
- Also emits to stderr for docker logs capture
- Logs: server_start (config summary), exec_start (args, cwd),
exec_done (exit code, duration, output sizes), exec_denied,
exec_error, and unhandled errors
- Includes truncated stderr preview on non-zero exit for debugging
tcp-tunnel.js:
- Logs new connections and disconnects with client address
- Includes client address in error messages for correlation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: ignore agent cwd in cli-proxy execFile
The agent wrapper sends its container workspace path (e.g.
/home/runner/work/gh-aw-firewall/gh-aw-firewall) as the cwd in
/exec requests. This path doesn't exist inside the cli-proxy
container, causing Node.js execFile to throw ENOENT — which
looks like 'gh' is missing but is actually a cwd resolution
failure.
The gh CLI doesn't need the agent's workspace path — it operates
on remote GitHub resources via --repo flags. Always use the
server's own cwd (/app) instead.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: create combined CA bundle for gh CLI TLS trust
The gh CLI is a Go binary that uses the system CA store (or
SSL_CERT_FILE), not NODE_EXTRA_CA_CERTS. The DIFC proxy's
self-signed CA cert was only trusted by Node.js, causing every
gh command to fail with 'x509: certificate signed by unknown
authority'.
Create a combined CA bundle (system CAs + DIFC proxy CA) at
startup and export SSL_CERT_FILE so the gh CLI trusts the proxy.
Also add SSL_CERT_FILE to the protected env keys to prevent
agent override.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: add CLI_PROXY_POLICY to DIFC proxy startup
The DIFC proxy (mcpg) requires a --policy flag to forward API
requests. Without it, it returns 503 'proxy enforcement not
configured' for all requests. The gh-aw compiler doesn't emit
CLI_PROXY_POLICY yet, so add it directly to the lock file.
Uses a permissive allow-only policy for smoke testing:
repos=all, min-integrity=none.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments