Skip to content

Add setenv-guard lint check (Phase 2c, #1193) - #1206

Open
ptone wants to merge 2 commits into
scion/ci-linter-frameworkfrom
scion/ci-linter-setenv-guard
Open

Add setenv-guard lint check (Phase 2c, #1193)#1206
ptone wants to merge 2 commits into
scion/ci-linter-frameworkfrom
scion/ci-linter-setenv-guard

Conversation

@ptone

@ptone ptone commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 2c of the CI custom linter framework (#1193). Adds a formatting-grade lint
script that flags _ = os.Setenv(...) where the environment variable name
contains TOKEN, SECRET, KEY, or AUTH (case-insensitive).

  • hack/check-setenv-guard.sh — grep + allowlist lint script following LINT-CONVENTIONS.md
  • Makefilecheck-setenv-guard target, wired into check-custom
  • CI workflow — new step in .github/workflows/ci.yml

All 5 existing occurrences are allowlisted. make ci passes clean.

Refs #1193

Test plan

  • ./hack/check-setenv-guard.sh exits 0 (all 5 known uses allowlisted)
  • make check-setenv-guard passes
  • make check-custom passes (includes this new check)
  • make ci passes

Scion Agent (cl-dev-2c) added 2 commits August 22, 2026 12:47
Phase 2c of the CI custom linter framework (#1193). Adds a
formatting-grade lint script that flags `_ = os.Setenv(...)` where the
environment variable name contains TOKEN, SECRET, KEY, or AUTH.

Silencing the error return on a credential-bearing Setenv is a
process-wide exposure risk — the value leaks into every child process
and a failure to set the variable is never noticed.

The 5 existing occurrences are allowlisted with comments. New
occurrences will fail the build.

Includes:
- hack/check-setenv-guard.sh — the lint script
- Makefile integration (check-setenv-guard target + check-custom dep)
- CI workflow step in .github/workflows/ci.yml
Review R1: file-path-only allowlist entries would silently pass any
future os.Setenv in the same file. Anchor each entry on the specific
env var name so new sensitive Setenv calls are still caught.

Grows allowlist from 4 entries to 5 (one per actual occurrence).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant