Threat detection never runs on arc-dind: stage step deletes the rootless-installed detector before copying it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with stage_threat_detection_arc_dind.sh and trace how it handles THREAT_DETECT_BINARY and ${BIN_DIR}/threat-detect when both paths refer to the same file. Reproduce the reported rootless install scenario, then check the staging script's related tests or callers. Done means staging succeeds when source and destination are identical and the detector remains available for the following execution step.
Written by the indexing model from the issue text.
Description
Summary
On self-hosted ARC runners with runner.topology: arc-dind, threat detection never runs: the stage step deletes the detector binary it is about to copy. Because detection defaults to warn mode, the job still ends green and the safe outputs only get a "Threat detection engine error" banner, so the failure is easy to miss.
Version
gh-aw v1.3.1 (github/gh-aw-actions/setup@dfe97a19c8249d41e2adfc95f92db2b8facea58f), threat-detect v0.5.3, AWF 0.29.14.
What happens
install_threat_detect_binary.sh ... --rootless(no sudo on the runner) installs toprepare_rootless_install_dir, i.e.$RUNNER_TEMP/gh-aw/bin/threat-detect, and outputs that path asbinary-path, which the execute step receives asTHREAT_DETECT_BINARY.- In the execute step,
stage_threat_detection_arc_dind.sh stagedoes:detector="${THREAT_DETECT_BINARY:?...}" # = $RUNNER_TEMP/gh-aw/bin/threat-detect BIN_DIR="${RUNNER_TEMP}/gh-aw/bin" ... rm -f "${BIN_DIR}/threat-detect" # deletes the detector itself cp "$detector" "${BIN_DIR}/threat-detect" # cp: cannot stat ...: No such file or directory - The step exits 1;
conclude_threat_detection.shlogsthreat-detect binary not found on PATH; continuing because GH_AW_DETECTION_CONTINUE_ON_ERROR != false, and safe outputs proceed without any analysis.
Reproduced outside Actions with the pinned script (sha256 a4064e12ac694a605d8a85eff737a2cf533548ea0fab88b49b3f3ab54c6c9301): create $RUNNER_TEMP/gh-aw/bin/threat-detect, set THREAT_DETECT_BINARY to that path and run stage → cp: cannot stat.
Suggested fix
Skip the copy when source and destination are the same file, e.g.
if [ ! "$detector" -ef "${BIN_DIR}/threat-detect" ]; then
rm -f "${BIN_DIR}/threat-detect"
cp "$detector" "${BIN_DIR}/threat-detect"
fi
chmod +x "${BIN_DIR}/threat-detect"
(or install the rootless detector to a directory other than BIN_DIR). With that change applied via a threat-detection.steps pre-step, detection runs and returns a structured verdict on the same runners.
It may also be worth surfacing an engine error more loudly than a warning banner when detection is enabled, since a silently skipped detection looks identical to a green one in the run list.
- Dominant language
- Go
- Stars
- 5.7k
- Forks
- 635
- Avg merge
- 3h 43m
- Merged PRs (30d)
- 838
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-aw
-
automation backlog:reports documentation
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
ai-inspected
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
github/gh-aw#80646 · 1 comment ·
Maintainers usually reply within 1 day
-
ai-inspected
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
automated-analysis backlog:engineering-quality code-quality cookie refactoring
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Bug: arc-dind generated Copilot CLI staging step fails when source and destination are the same fileOpenai-inspected arc awf backlog:runners-tools community
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
github/gh-aw#78972 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
bug raised-by:reviewer
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
medici-finance/assay#7655 ·
Maintainers usually reply within 1 day
-
helm chart: make DaemonSet pod affinity configurable via values.yamlPossibly taken @Young-Zen claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
flannel-io/flannel#2632 ·
Maintainers usually reply within 6 days
-
go-vulnerability security-scan
Difficulty 1/5 Under an hour Newbie friendliness 72/100
teslashibe/agent-go#36 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nwverse/persona#15194 · 1 comment ·
Maintainers usually reply within 1 day
-
bug flaky-test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rosskukulinski/tailworks#411 ·
Maintainers usually reply within 1 day