feat: AURSCAN_DISABLE=1 to skip scanning entirely - #67
Conversation
|
Greetings @HaleTom. Is this really needed? How often will one run /w Your call, its team effort after all. Best and cheers! One more concern: how do we harden this against being exploited? I have seen to many "this can never happens" in my life. |
|
My use case: I wanted to remove aurscan as it was greatly slowing down my most common workflow -- update my AUR packages. With this shell env disable, I can skip any PKGBUILDs that need a "second look" and then aurscan on the remainder. Re security: If the current shell is compromised to be able to set variables, then it could also be compromised to run arbitrary commands. Can you be clearer about the threat model where this could be set without a much larger compromise? |
|
Greetings @HaleTom. Thank you for the explanation, I clearly understand your use-case now. While it may not be relevant for "average Joe", you have contribute so much that your certainly shall get every additional comfort.
So, ready to merge when you are. |
|
I've not actually done a review on this yet (it should have been in my private fork, but my agent got ambitious!) I'm dogfooding and it tastes good so far. I hope to review and merge in the next few days. |
Production-ready bar for this PR
Findings1. Correctness & functional completeness
2. Architecture & boundary integrity
3. Code clarity, clean code & maintainability
4. Comments & code documentation
5. Tests & validation
6. Performance
7. Operational risk
8. Adversarial review
What I could not fully verify
Final verdict✅ Ready to merge — no blocking issues. |
|
Almost ready for final review / merge. EDIT -- actually, I should manually test the changes that came out of code review... marked as draft again. |
|
Greetings @HaleTom. Close, but three things before we merge: 1. 2. 3. On hardening. Your answer holds for the interactive case, but env vars Minor: squash the 22 identical commits; add a test that a disabled run neither The five enforcement points I can live with -- forgetting one means we scan, Best and cheers! |
What
Adds
AURSCAN_DISABLE=1, a build-hook and plain-scan kill switch. Disabled packages receive an immediateSKIPPEDverdict and pass through with exit0; no directory collection, AUR lookup/snapshot fetch, static rules, or model call runs.--scoreis deliberately different: it is an explicit scoring query, ignoresAURSCAN_DISABLE, and always produces a real score.Why
How
The early exits are at the actual work boundaries: standalone scans skip before
CollectDir, recursive AUR scans skip before RPC/snapshot access, and yay/paru hooks skip before directory collection.pipeline.Runretains a defence-in-depth gate;RunScoredbypasses it for--score.SKIPPEDhas a dimmed badge, an inline disabled message, and is explicitly allowed through the gates/hooks. It is not a trust verdict, so--scorenever emits it.Verification
make test(go vet ./...andgo test ./...) cleanSKIPPED, exit0, no collection errorSKIPPED, exit0, no collection errorSKIPPED, exits cleanly and chains to/bin/trueAURSCAN_DISABLE=1 AURSCAN_RULES_ONLY=1 aurscan --score ./PKGBUILD: real score80, exit80PR template not found, looked in:
.github/pull_request_template.md,.github/PULL_REQUEST_TEMPLATE/*.md.