fix(gosec): enforce G104, drop dead G704, record kept exclusions #751

Merged
hexajon merged 1 commit from issue-717-gosec-exclusion-adr into main 2026-10-13 00:38:21 +00:00
Owner

Summary

scripts/gosec.sh excluded seven rule classes with the rationale only in the script header. ADR 0044 set the rule that a gate opt-out carries a record, so I re-ran gosec with no exclusions (108 findings, all within those classes) and triaged each.

Dropped two:

  • G104 (unhandled errors): the header called these infallible buffer writes. They were best-effort git, API, and config calls in the orchestrate pipeline and bisect, a reviewer request after PR creation, and local git-config writes. Each is now an explicit ignore with a reason at the call site, so G104 is enforced with no exclusion - a future bare unhandled error fails the gate.
  • G704 (SSRF taint): no findings, so the exclusion suppressed nothing.

Kept five, each by-design, now recorded with accurate rationales in ADR 0053: G204 (subprocess: fixed-binary calls plus the user's own command via orchestrate verify, secretexec, and the commandRunner seam), G304 (file reads of user-supplied or madtea-derived paths), G301/G302/G306 (output-dir, executable-bit, and generated-doc permissions). scripts/gosec.sh now excludes exactly G204,G301,G302,G304,G306.

ADR 0053 is proposed. It is accepted once a second contributor assents (ADR 0047), which also closes the tracking issue. Full gate green.

Refs #717

Refs #717

## Summary scripts/gosec.sh excluded seven rule classes with the rationale only in the script header. ADR 0044 set the rule that a gate opt-out carries a record, so I re-ran gosec with no exclusions (108 findings, all within those classes) and triaged each. Dropped two: - G104 (unhandled errors): the header called these infallible buffer writes. They were best-effort git, API, and config calls in the orchestrate pipeline and bisect, a reviewer request after PR creation, and local git-config writes. Each is now an explicit ignore with a reason at the call site, so G104 is enforced with no exclusion - a future bare unhandled error fails the gate. - G704 (SSRF taint): no findings, so the exclusion suppressed nothing. Kept five, each by-design, now recorded with accurate rationales in ADR 0053: G204 (subprocess: fixed-binary calls plus the user's own command via orchestrate verify, secretexec, and the commandRunner seam), G304 (file reads of user-supplied or madtea-derived paths), G301/G302/G306 (output-dir, executable-bit, and generated-doc permissions). scripts/gosec.sh now excludes exactly G204,G301,G302,G304,G306. ADR 0053 is proposed. It is accepted once a second contributor assents (ADR 0047), which also closes the tracking issue. Full gate green. Refs #717 Refs #717
fix(gosec): enforce G104, drop dead G704, record kept exclusions
All checks were successful
drift / govulncheck (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 5m7s
drift / forgejo-smoke (pull_request) Has been skipped
ci / mcp-conformance (pull_request) Successful in 8m50s
ci / mcp-conformance (push) Successful in 7m22s
drift / govulncheck (push) Has been skipped
drift / surface-diff (push) Successful in 47s
drift / forgejo-smoke (push) Has been skipped
ci / gate (pull_request) Successful in 38m50s
ci / gate (push) Successful in 34m6s
c3d5a96de6
Refs #717
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!751
No description provided.