Skip to content

X-Ray: real-detector controls; a disguised executable fails; allowlists match folders (Part of #7155) - #7191

Merged
squid-shepherd[bot] merged 4 commits into
mainfrom
feat/xray-firewall-control
Oct 30, 2026
Merged

squid-shepherd[bot] merged 4 commits into
mainfrom
feat/xray-firewall-control

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Part of #7155. Found #7187.

Problem

X-Ray's failure proofs mock both SecurityLens and ApertureFilter. Run for real, it failed its own banner example: an executable named logo.png passed.

What this does

  • A disguised executable now fails. XRAY_BYPASS_EXTENSIONS also silenced the header check. It now excuses dense data only: a file that doesn't start the way its type requires always counts. Short headers like MZ, which random compressed bytes contain by chance, stay excused for those types, so real images and archives pass. This covers .png, .jpg, .zip and .gz, in both the CLI and the headless audit.
  • X-Ray and the Firewall use path_allowlisted(), so tests/ no longer exempts src/latests/. A folder entry matches at a segment start or after _ or -, so unit_tests/ stays exempt. phpunit matches a folder, not any path containing the word.
  • Adds tests/security_auditing/test_xray_control.py: the real scanner over inert planted content, nothing mocked. Nothing in it runs: the payloads are random bytes.
  • Pins what X-Ray still misses as strict expected failures, tracked in X-Ray misses large encoded payloads, and its header check can pass by chance #7187.
  • Points gate_controls.py at the real control.

A control that passed by luck

The first version of the dense-payload control passed, then breaking the entropy check changed nothing. The random data contained MZ, which X-Ray reads as an executable header anywhere in the first 8 KB. The fixture now has no MZ, and is short enough for the entropy check to measure.

The investigation also found that SecurityLens._armor empties lines of 250 or more characters, so long payloads and secrets are never scanned. See #7187 and #7179.

Do the controls fail when something is broken?

Sabotage Result
Wrong entropy result key 9 failed
Header mismatch excused again 5 failed
Binary check dropped 19 failed
Test folders matched by substring 3 failed

Risk

A file with a bypassed extension and the wrong header now fails the pre-gate. X-Ray on this repo: exit 0, 0 anomalies, 5,105 files.

The golden crucible caught a stricter first version of the allowlist rule: matching whole segments dropped *_tests/ folders, moving firewall and X-Ray counts on 18 corpus files. With the rule above, no corpus file changes, so there's no re-bless.

Cost

No new workflow or job, and well under a second in full-suite.

Checks

  • Related tests (-k 'gate_controls or xray or binary or anomaly or firewall or vault or sentinel or config or resolver or workflow or classifier'): 856 passed. Not the full suite locally.
  • tests/ruff_audit.py --ci passes.

🤖 Generated with Claude Code

squid-protocol and others added 3 commits October 30, 2026 14:45
…hes whole segments (Part of #7155)

The scanner's proofs mocked the detector and the file filter, so a blind scanner would have
passed them. These run it for real over planted fakes. Its allowlist was a substring match,
so tests/ also exempted src/latests/. Known misses are strict xfails, tracked in #7179.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts match folders (Part of #7155)

X-Ray's bypass extensions also silenced its header check, so an executable named logo.png
passed, the tool's own banner example. They now excuse dense data only. X-Ray and the Firewall
use path_allowlisted. The controls run the real scanner; known misses are strict xfails (#7187).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #7191 @ 55afb21: 2 failed check(s)

== crucible-audit (full-precision) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41114229397/job/124264109046
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
⚠️ MISMATCH at /12. Scan Output Snapshots/LLM Brief: Expected ['# ARCHITECTURAL_BRIEF: data', '> INSTRUCTION: Deterministic Syntactic Analysis. Base architectural insights on Structural Magnitude, Extracted Signatures, and Risk overlays.',
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_audit (5 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/9e246a6d-ee30-4ee2-9311-c6319932cf1a' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== crucible-audit (zero-dependency) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41114229397/job/124264109324
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
⚠️ MISMATCH at /12. Scan Output Snapshots/LLM Brief: Expected ['# ARCHITECTURAL_BRIEF: data', '> INSTRUCTION: Deterministic Syntactic Analysis. Base architectural insights on Structural Magnitude, Extracted Signatures, and Risk overlays.',
2026-10-30 19:26:43,549 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_zero_dep_audit (5 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/96164fa8-6631-4d59-bd36-de35ebec6bd3' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Matching whole segments only also dropped unit_tests/-style folders, which the golden crucible
caught: 18 corpus files lost their exemption. A folder entry now matches at a segment start or
after _ or -, which still rejects latests/ and contests/, and no corpus file changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (1538dae) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft October 30, 2026 19:52
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Oct 30, 2026
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 30, 2026 19:58
@squid-shepherd squid-shepherd Bot added shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #7191 @ 1538dae: 9 failed check(s)

== crucible (failure) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215129/job/124279699357
repro: tests/tools/box/heavy-run.sh python -m pytest -q tests/cics_crucible && tests/tools/box/heavy-run.sh python tests/tools/cics_crucible.py --ci --out /tmp/gitgalaxy-scratch/ci-digest/cics
errors:
Traceback (most recent call last):
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/_temp/shards/cics-crucible-shard-*/results.json'
##[error]Process completed with exit code 1.
log tail:
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
No files were found with the provided path: /home/runner/work/_temp/cics_crucible. No artifacts will be uploaded.
##[group]Run echo "measure: cancelled, runner-tests: cancelled"
echo "measure: cancelled, runner-tests: cancelled"
[ "cancelled" = "success" ] && [ "cancelled" = "success" ]
shell: /usr/bin/bash -e {0}
env:
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
PYTHONUTF8: 1
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
measure: cancelled, runner-tests: cancelled
##[error]Process completed with exit code 1.
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/9d0a254c-3847-43c1-9e9f-6002198a652e' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== full-suite part 1/2 (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215208/job/124279508993
repro: python -m pytest -q tests
log tail:
(log unavailable: gh: HTTP 404)

== full-suite part 2/2 (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215208/job/124279508884
repro: python -m pytest -q tests
log tail:
(log unavailable: gh: HTTP 404)

== ground-truth (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215515/job/124279676488
repro: python tests/tools/pr_gates.py --ratchets --only-ratchets ground-truth (when a ground-truth part failed too, run that part's repro)
errors:
##[error]Process completed with exit code 1.
log tail:
##[endgroup]
##[group]Operating System
Ubuntu
24.04.5
LTS
##[endgroup]
##[group]Runner Image
Image: ubuntu-24.04
Version: 20261025.353.1
Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20261025.353/images/ubuntu/Ubuntu2404-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20261025.353
##[endgroup]
##[group]GITHUB_TOKEN Permissions
Contents: read
Metadata: read
##[endgroup]
Secret source: Actions
Cache mode: write
Prepare workflow directory
Prepare all required actions
Complete job name: ground-truth
##[group]Run echo "ground-truth warm: $WARM, parts: $PARTS (tested-tree skip: $SKIP, plan mode: $MODE, layout: $LAYOUT, warm planned: $PLANNED_WARM)"
echo "ground-truth warm: $WARM, parts: $PARTS (tested-tree skip: $SKIP, plan mode: $MODE, layout: $LAYOUT, warm planned: $PLANNED_WARM)"
# #4935: "skipped" is a pass only when the gate proved this tree green on the PR; otherwise it is a failure
# #5164: ... or when the plan found no ground-truth input in the PR (mode none). An empty mode is not none.
ok() { test "$1" = "success" || { test "$1" = "skipped" && { test "$SKIP" = "true" || test "$MODE" = "none"; }; }; }
# #5543: ... or when the layout needs no warm job (a cache hit on the scans, or the busy layout): the parts then warm for themselves
{ ok "$WARM" || { test "$WARM" = "skipped" && test "$PLANNED_WARM" = "false"; }; } && ok "$PARTS"
shell: /usr/bin/bash -e {0}
env:
WARM: skipped
PARTS: cancelled
SKIP:
MODE: full
PLANNED_WARM: false
LAYOUT: busy
##[endgroup]
ground-truth warm: skipped, parts: cancelled (tested-tree skip: , plan mode: full, layout: busy, warm planned: false)
##[error]Process completed with exit code 1.
Cleaning up orphan processes

== measure (shard 1/2) (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215129/job/124279683376
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== measure (shard 2/2) (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215129/job/124279683188
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== publish-history (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215515/job/124280550039
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== store the suite's durations (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215208/job/124279690946
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== suite time budget (#5166) (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41116215208/job/124279690457
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 30, 2026 20:56
@squid-shepherd squid-shepherd Bot removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md labels Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit b4b0cab into main Oct 30, 2026
123 of 142 checks passed
@squid-shepherd
squid-shepherd Bot deleted the feat/xray-firewall-control branch October 30, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant