Skip to content

chore(security): gitignore the leak-scanner token file - #2

Merged
wshallwshall merged 1 commit into
mainfrom
chore/gitignore-token-file
Jul 26, 2026
Merged

chore(security): gitignore the leak-scanner token file#2
wshallwshall merged 1 commit into
mainfrom
chore/gitignore-token-file

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

Adds the ignore rule for scripts/security/scan-tokens.local.txt -- the real customer/vendor token list consumed by the leak scanner.

The file is created by an operator before the tooling that references it exists. Without this rule it is an ordinary untracked file and is stageable by git add -A, which is exactly the exposure it exists to prevent.

Only the synthetic .example is ever committed.

The real customer/vendor token list is created by an operator before the
tooling that consumes it exists. Without this rule the file sits un-ignored
in the working tree and is stageable by `git add -A`, which is precisely the
exposure the file exists to prevent. Ignoring the path up front costs nothing.
@wshallwshall
wshallwshall merged commit e7d3396 into main Jul 26, 2026
31 of 32 checks passed
@wshallwshall
wshallwshall deleted the chore/gitignore-token-file branch July 26, 2026 21:42
wshallwshall added a commit that referenced this pull request Aug 10, 2026
… outside (#1209) (#308)

Guardrail #2 reads count="$(gh api ... || echo "ERR")". The || runs INSIDE the command
substitution, so it APPENDS to stdout rather than replacing it, and gh api copies the JSON
error BODY to stdout on any HTTP error (only its "gh: ... (HTTP nnn)" line goes to stderr,
which 2>/dev/null eats).

So count held '{"message":"API rate limit exceeded",...}ERR'. The sentinel missed, being
neither "ERR" nor empty. The numeric comparison then failed with "integer expression
expected" and returned 2 -- and an `if` CONDITION is exempt from set -e. The step printed
"published advisory confirmed", wrote advisory_ok=true, and exited 0.

The guard inverted to fail-open on exactly the rate-limit/API-error class its own header
promises routes to manual review. The comment directly above it says "Fail closed on any
error": a compensating control resting on a false premise.

Measured against the real shipped body, origin/main vs this branch, under bash -e with a gh
stub reproducing the stream split:

                    gh ERRORS          gh returns 1
  pre-fix (main)    advisory_ok=true   advisory_ok=true     <- FAIL OPEN
  fixed             advisory_ok=false  advisory_ok=true     <- closed, happy path intact

A stub that merely exited non-zero would have passed against the defective code and proved
nothing; the defect is that the body reached the variable, so the stub must write a body.

Bounded today, and the bound is worth stating exactly rather than leaning on: the merge
condition also requires age_ok, and the age step denies every ecosystem that can be eligible
-- a disjointness this file documents about itself, and labels a FORWARD guard load-bearing
the day a Python allow row is populated. One line's edit from directly merge-affecting.

THE EXISTING TEST COULD NOT SEE IT. It asserted the STRING "advisory_ok=false" appears in the
step body -- satisfied by a step that merely contains the words, and the fail-open lived
underneath a passing version of that check. The file already had the right instrument:
_run_step_body executes shipped run: bodies under bash -e and returns the parsed
$GITHUB_OUTPUT. Guardrail #2 was the one guard not using it. Now three executed rows,
including a discriminating PASS so the suite cannot be satisfied by unconditional denial.

DOMAIN, because fixing one instance is how this class survives: a sweep of 63 workflow and
script files across both repos found 24 instances, 16 provably harmless (git rev-parse
--verify --quiet writes nothing on failure). All six in this file are fixed. Moving the ||
outside also fixes the streaming cases for free -- jq emits rows before a mid-array error, and
the old form would have appended the sentinel to a TRUNCATED dependency list while still
reporting success.

The count guard also moves from equality against one sentinel to a SHAPE test. An equality
test recognises exactly the failure it was told about, which is how a JSON body walked through
it.
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