gosec: annotate the adopted-rule false positives #45

Closed
opened 2026-10-27 13:34:44 +00:00 by sam · 0 comments
Owner

Each shipped-code site under an adopted rule gains an inline nolint naming why it is intentional, or a fix. Sites, by rule: G110 io.LimitReader already bounds the tar read; G117 structures marshalled to be sealed (container registry auth, harness secrets); G122 symlink removal the worktree tree reset performs deliberately; G124 cookie flags computed from the request TLS state, which the rule cannot evaluate; G703/G704 the tool layer confines the path, and the OAuth endpoint comes from a configured rule; G710 the redirect target already passes through the same-origin helper. Do not exclude any of these rules: a rule excluded to avoid a disposition a reviewer can check loses its signal.

Notes

Done. All 14 shipped-code sites annotated inline with rule-specific reasons. Verified with golangci-lint --enable-only=gosec: shipped-code findings 41 -> 27, and none of G110/G117/G122/G124/G703/G704/G710 is reported anywhere in shipped code. The 27 that remain are exactly G101 (9), G204 (7), G404 (1) — the rules the PRD excludes — and G306 (10), which is 2ptu.1. That is the gate's shipped-code zero once .golangci.yml carries the excludes and the _test.go exclusion.
Reverted with the approach; all of these annotations are removed.

Close reason

Closed


Imported from beads archie-core-2ptu.3 · GitHub #1486 · type task · priority P3 · created 2026-10-02 · closed 2026-10-02

Each shipped-code site under an adopted rule gains an inline nolint naming why it is intentional, or a fix. Sites, by rule: G110 io.LimitReader already bounds the tar read; G117 structures marshalled to be sealed (container registry auth, harness secrets); G122 symlink removal the worktree tree reset performs deliberately; G124 cookie flags computed from the request TLS state, which the rule cannot evaluate; G703/G704 the tool layer confines the path, and the OAuth endpoint comes from a configured rule; G710 the redirect target already passes through the same-origin helper. Do not exclude any of these rules: a rule excluded to avoid a disposition a reviewer can check loses its signal. ### Notes Done. All 14 shipped-code sites annotated inline with rule-specific reasons. Verified with golangci-lint --enable-only=gosec: shipped-code findings 41 -> 27, and none of G110/G117/G122/G124/G703/G704/G710 is reported anywhere in shipped code. The 27 that remain are exactly G101 (9), G204 (7), G404 (1) — the rules the PRD excludes — and G306 (10), which is 2ptu.1. That is the gate's shipped-code zero once .golangci.yml carries the excludes and the _test.go exclusion. Reverted with the approach; all of these annotations are removed. ### Close reason Closed --- _Imported from beads `archie-core-2ptu.3` · GitHub #1486 · type task · priority P3 · created 2026-10-02 · closed 2026-10-02_
sam added the lowtask labels 2026-10-27 13:34:44 +00:00
sam self-assigned this 2026-10-27 13:34:44 +00:00
sam closed this issue 2026-10-27 13:34:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#45