Pin CI actions to commit SHAs and run gosec in the lint gate #1919

Closed
opened 2026-11-12 16:07:26 +00:00 by sam · 1 comment
Owner

The release workflows run with the deploy token and the release signing key, and every action they use is referenced by a movable tag (actions/checkout@v4 and so on). Whoever controls a tag can repoint it and run code with those secrets.

A semgrep and gosec scan also showed that the security linter isn't part of task check.

Wanted:

  • Every uses: in .github/workflows references a full commit SHA.
  • gosec runs as a golangci-lint linter in task check. Rule families that are noise for this codebase are excluded in config: G104 (errcheck already covers it), G304, G115 and G204 (running commands is the product). Each remaining finding is either fixed or suppressed at the site with the reason.

Done when no workflow references an action by tag, and task check passes with gosec enabled.

The release workflows run with the deploy token and the release signing key, and every action they use is referenced by a movable tag (`actions/checkout@v4` and so on). Whoever controls a tag can repoint it and run code with those secrets. A semgrep and gosec scan also showed that the security linter isn't part of `task check`. Wanted: - Every `uses:` in `.github/workflows` references a full commit SHA. - gosec runs as a golangci-lint linter in `task check`. Rule families that are noise for this codebase are excluded in config: G104 (errcheck already covers it), G304, G115 and G204 (running commands is the product). Each remaining finding is either fixed or suppressed at the site with the reason. Done when no workflow references an action by tag, and `task check` passes with gosec enabled.
sam added the in-progresstaskmedium labels 2026-11-12 16:07:26 +00:00
Author
Owner

Done in a3d4b751, db346b15 and 7c7129ee.

  • Every uses: in the workflows is pinned to a commit SHA.
  • gosec runs in golangci-lint, tests included. G104, G115, G204 and G304 are excluded in config; every other finding is fixed or suppressed at the site with its reason.
  • Fixed along the way: dashboard cookies took Secure from r.TLS, which is nil behind a TLS-terminating proxy. All cookies now go through one builder that reads the forwarded scheme, with a table test that failed before the fix.
  • The worktree reset and the agent worker's chown walk go through os.Root, so a symlink swapped in mid-walk can't point them outside the worktree.
  • AGENTS.md says how tests are written.

task check passes. The pinned actions are first exercised by the next pull request or release.

Done in a3d4b751, db346b15 and 7c7129ee. - Every `uses:` in the workflows is pinned to a commit SHA. - gosec runs in golangci-lint, tests included. G104, G115, G204 and G304 are excluded in config; every other finding is fixed or suppressed at the site with its reason. - Fixed along the way: dashboard cookies took `Secure` from `r.TLS`, which is nil behind a TLS-terminating proxy. All cookies now go through one builder that reads the forwarded scheme, with a table test that failed before the fix. - The worktree reset and the agent worker's chown walk go through `os.Root`, so a symlink swapped in mid-walk can't point them outside the worktree. - AGENTS.md says how tests are written. `task check` passes. The pinned actions are first exercised by the next pull request or release.
sam removed the in-progress label 2026-11-12 16:16:24 +00:00
sam closed this issue 2026-11-12 16:16:25 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1919