[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CCS3AEPT2CVDJVPYV3JHWZ":3,"skill-same:01M6CCS3AEPT2CVDJVPYV3JHWZ":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M6CCS3AEPT2CVDJVPYV3JHWZ","apply-security-upgrades",null,"Clear the whole dependency and vulnerability backlog on one branch and get govulncheck, Snyk, SonarCloud, lint and the 100% coverage gate green. Use periodically, or when Dependabot PRs are piling up red.","Tight-Line\u002Fgatekeeper","Tight-Line","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F188937068?v=4","01M6CCS1G9QTMM1YSNT84FVXS7","Tight Line","01M6CCS1MMAPNB8TK1HPK52VQH",7,"MIT","https:\u002F\u002Fgithub.com\u002FTight-Line\u002Fgatekeeper\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fapply-security-upgrades\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"security","upgrades","apply security upgrades","lint","dependabot","vulnerability","snyk","branch","coverage","use","dependency","up","gate","2026-11-10 10:12:30",false,"---\nname: apply-security-upgrades\ndescription: Clear the whole dependency and vulnerability backlog on one branch and get govulncheck, Snyk, SonarCloud, lint and the 100% coverage gate green. Use periodically, or when Dependabot PRs are piling up red.\n---\n\n# Apply security upgrades\n\nCollapse every outstanding security item into a single reviewable branch, then\nfix whatever the gates report. One branch, one PR, one CI run instead of five\nthat each burn a full matrix.\n\n## Why a single branch\n\nDependabot opens one PR per ecosystem group. Each one runs the whole CI matrix,\neach one has to be merged and then rebased against the others, and none of them\ncan fix a problem that lives outside its own diff, such as a stale `go` directive\nor a missing egress endpoint. Merging them together first means one CI run, one\nreview, and a place to put the fixes that no individual bump could carry.\n\n## Procedure\n\n### 1. Survey\n\nStart with the Dependabot PRs, if there are any:\n\n```bash\ngh pr list --limit 50 --json number,title,headRefName,author \\\n  --jq '.[] | select(.author.login==\"app\u002Fdependabot\") | \"\\(.number)\\t\\(.headRefName)\\t\\(.title)\"'\n```\n\nAn empty list is not the same as \"nothing to do\". Confirm the machinery is\nactually switched on before believing it:\n\n```bash\ngh api repos\u002FTight-Line\u002Fgatekeeper --jq '.security_and_analysis'\ngh api repos\u002FTight-Line\u002Fgatekeeper\u002Fvulnerability-alerts -i | head -1   # 204 = alerts on\ngh api repos\u002FTight-Line\u002Fgatekeeper\u002Fdependabot\u002Falerts --jq 'length'\ntest -f .github\u002Fdependabot.yml && echo \"version updates configured\" || echo \"NO dependabot.yml\"\n```\n\n`dependabot_security_updates: disabled` plus no `dependabot.yml` means no PRs\nwill ever be opened, so a quiet backlog looks identical to a clean repo. Zero\nalerts from a repo with no dependency graph means the same thing. In that state\nthe survey has to come from the tools directly; see step 4.\n\nCheck that the scanners are still switched on, too. GitHub disables a workflow\nwhose only trigger is `schedule` after 60 days without repository activity, and\nit does so silently: the workflow simply stops running, no check goes red, and\nthe last run sits there green forever.\n\n```bash\ngh api repos\u002FTight-Line\u002Fgatekeeper\u002Factions\u002Fworkflows \\\n  --jq '.workflows[] | \"\\(.state)\\t\\(.name)\"'   # look for disabled_inactivity\ngh workflow enable snyk.yml                     # to switch one back on\n```\n\nThis is how `snyk.yml` went dark here: it last ran on its weekly cron in\nAugust, was disabled for inactivity, and then did not run on the 2026-09 pass\nat all until it was re-enabled by hand.\n\nFor each PR that does exist, check it is a forward bump and not stale; `main` may\nalready carry a newer bump of the same group:\n\n```bash\ngit fetch origin\ngit diff origin\u002Fmain...origin\u002F\u003Cbranch>\n```\n\nCapture the current gate status, and **capture it for `main` too**:\n\n```bash\ngh pr checks \u003Cn>\ngh run list --branch main --limit 15 \\\n  --json conclusion,name,headSha,createdAt \\\n  --jq '.[] | \"\\(.conclusion)\\t\\(.name)\\t\\(.headSha[0:8])\"'\n```\n\n> If a check is red on *every* PR including ones that touch only the Dockerfile,\n> it is not the dependency bumps. It is infrastructure, and it is almost\n> certainly also red on `main`. Diagnose it before touching any dependency.\n\nCheck the run dates, not just the conclusions. Runs whose `headSha` has not moved\nin months mean nothing has been scanned in months, however green they look.\n\n### 2. Build the branch\n\n```bash\ngit checkout -b chore\u002Fsecurity-upgrades-\u003CYYYY-MM> origin\u002Fmain\n```\n\n**Cherry-pick; do not merge.** `main` has a strictly linear history. A branch\nbuilt with `git merge` fails a later rebase with `This branch cannot be rebased\ndue to conflicts` even when GitHub simultaneously reports the PR as `MERGEABLE`\nand `CLEAN`: the conflict resolution lives *inside* a merge commit, rebase\ndiscards it, and the conflict comes back with nothing to resolve it.\nCherry-picking resolves the conflict inline, in a real commit, where rebase can\ncarry it.\n\nApply in a deliberate order; cheapest and least conflict-prone first, Go modules\nlast, and within Go modules the **grouped minor\u002Fpatch bump before the security\nbump** so the security pin is the one that survives:\n\n1. `github-actions` group\n2. `docker` bumps\n3. `gomod` minor\u002Fpatch group\n4. `gomod` security group\n\n```bash\n# each Dependabot branch is a single commit; -x records where it came from\ngit cherry-pick -x origin\u002F\u003Cbranch>\n```\n\nCherry-pick preserves `dependabot[bot]` as the author, so the audit trail\nsurvives. Merging this PR still auto-closes the Dependabot PRs, because the PR\nbody's `Closes #NNN` keywords do that regardless of whether their exact SHAs land.\n\n### 3. Resolve go.mod \u002F go.sum conflicts\n\nTwo Go module changes will conflict when the security bump goes on top of the\ngrouped one. Do **not** hand-merge the version lines. Take the already-applied\nside, then re-apply the incoming pin through the toolchain so `go.sum` stays\ninternally consistent:\n\n```bash\ngit checkout --ours go.mod go.sum\ngo get \u003Cmodule>@\u003Cversion>   # re-apply each security pin the incoming commit carried\ngo mod tidy                 # slow; run it in the background\ngit add go.mod go.sum\ngit cherry-pick --continue  # or `git rebase --continue`\n```\n\n`--ours` means \"what is already applied\" during both cherry-pick and rebase,\nwhich is the grouped bump. That is the side to keep. Note this is the opposite\nsense from `git merge`, where `--ours` is the branch you are merging into.\n\nRule for each conflicting line: **take the higher version**. The minor\u002Fpatch\ngroup is often newer for transitive deps such as `golang.org\u002Fx\u002Fsys` and\n`protobuf`, while the security group is newer for the one module it targets.\nBoth need to win where they are ahead.\n\n`go mod tidy` may legitimately prune `go.sum` lines for the version being\nreplaced. That is correct, not drift. But it means the tree is no longer\nbyte-identical to a previously verified one, so re-run the gate rather than\ntrusting the earlier green run.\n\n### 4. Find what is actually outstanding\n\nWith no Dependabot PRs to inherit from, the backlog comes from the tools:\n\n```bash\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F...   # symbol-level, authoritative\ngo list -u -m -f '{{if and .Update (not .Indirect)}}{{.Path}} {{.Version}} -> {{.Update.Version}}{{end}}' all\n```\n\n`govulncheck` is the one that decides what counts as a security fix. Everything\nelse `go list -u` turns up is a routine bump and belongs under `### Changed`.\n\nResolve each finding to its real fixed version rather than trusting the single\nversion `govulncheck` prints, which is only the fix for the line you are on:\n\n```bash\ncurl -s https:\u002F\u002Fvuln.go.dev\u002FID\u002FGO-2026-XXXX.json \\\n  | ruby -rjson -e 'd=JSON.parse(STDIN.read); puts d[\"summary\"]\n      d[\"affected\"].each{|a| puts \"  #{a[\"package\"][\"name\"]}: \" +\n        a[\"ranges\"].map{|r| r[\"events\"].map{|e| e.to_a.flatten.join(\":\")}.join(\" \")}.join(\" | \")}'\n```\n\nThat prints every affected minor line and where each one was patched, which is\nwhat decides the `go` directive target in the next step.\n\n### 5. Fix the gates\n\nRun the repo gate locally before pushing:\n\n```bash\nmake check                 # lint + test-coverage-check + build-all\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F...\n```\n\nBoth are slow. Run them in the background and **read the real output**, not a\nwrapper's exit status. `govulncheck` exits `3` on findings, and a trailing\n`echo EXIT=$?` through a pipe reports the pipe's status rather than the tool's.\n\nKnown classes of problem, in the order they tend to bite:\n\n#### The stale `go` directive (Dependabot cannot fix this)\n\n`govulncheck` reports Go **standard library** vulnerabilities against the Go\nversion the module builds with. Dependabot bumps modules and the Dockerfile\nbuilder image; it never bumps the `go` directive in `go.mod`. So the stdlib\nquietly rots and `govulncheck` fails with findings that no dependency PR can\nclear.\n\n```bash\n# what patch releases exist\ncurl -s \"https:\u002F\u002Fgo.dev\u002Fdl\u002F?mode=json&include=all\" \\\n  | grep -oE '\"version\": \"go1\\.[0-9]+\\.[0-9]+\"' | sort -u -V | tail -20\n# setup-go must be able to install it\ncurl -s \"https:\u002F\u002Fraw.githubusercontent.com\u002Factions\u002Fgo-versions\u002Fmain\u002Fversions-manifest.json\" \\\n  | grep -oE '\"version\": \"1\\.[0-9]+\\.[0-9]+\"' | sort -u -V | tail -12\n```\n\nPrefer the **latest patch on the current minor line**: a minor bump changes\nlanguage semantics and vet\u002Flint behavior and does not belong in a security pass.\nThe exception is when the current line is end-of-life. Go supports only the two\nmost recent minors, so once `1.N+2` ships, `1.N` stops getting patches and\nstaying on it means the next stdlib CVE has no fix at all. In that case move to the\ncurrent release rather than the oldest line that is merely still supported, so\nthe next pass is not doing this again immediately. The 2026-09 pass moved\n`1.25.6` to `1.27.1` for exactly this reason: every finding was patched in\n`1.25.13`, but `1.27` had shipped and `1.25.14` was the end of that line.\n\nBudget for a minor bump costing more than the directive:\n\n- It drags the lint toolchain with it. `golangci-lint` refuses to run at all\n  when the Go it was built with is older than the target, with `the Go language\n  version (go1.26) used to build golangci-lint is lower than the targeted Go\n  version (1.27.1)`. The pinned version in `ci.yml` has to move to a release\n  built with the new Go, and a local binary on `PATH` has to move too or the\n  local gate disagrees with CI.\n- That newer linter brings newer `staticcheck` rules, which surface deprecations\n  the old one never mentioned. The 2026-09 pass turned up\n  `httputil.ReverseProxy.Director`, deprecated in Go 1.26, in the forwarding path.\n- Go can change which line it attributes an uncovered block to. A `coverage:ignore`\n  marker that sits a fixed distance from the code can stop matching, so plan for\n  the coverage gate to fail on code the bump never touched.\n\n```bash\ngo mod edit -go=\u003Cversion>    # does not add a `toolchain` directive; keep it that way\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F...    # must print \"No vulnerabilities found.\"\n```\n\nThe version is pinned in more places than `go.mod`. Miss one and CI keeps\nbuilding against the vulnerable toolchain while the local run looks clean:\n\n```bash\ngrep -rn \"go-version\\|golang:\" .github\u002Fworkflows\u002F Dockerfile Dockerfile.relay\n```\n\nPrefer `go-version-file: go.mod` in every workflow over a hardcoded string, so\nthere is exactly one place to bump next time. The Dockerfiles track a minor line\n(`golang:1.27-alpine`) and pick up patches on their own, so they only need\ntouching on a minor bump.\n\nConfirm the bump against the real output. A local toolchain older than the new\ndirective is downloaded automatically, so a passing run also proves the toolchain\nresolved. Beware the reverse: a local toolchain *newer* than the directive is\nused as-is, so `govulncheck` locally reports against that newer toolchain, not\nagainst the directive. Check which one it used before concluding anything:\n\n```bash\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F... | grep -oE 'go1\\.[0-9]+\\.[0-9]+' | sort -u\n```\n\nThe Dockerfile builder image and the `go` directive do **not** need to match. A\nnewer toolchain building an older-directive module is fine and normal.\n\n#### Snyk or Sonar red for reasons that are not findings\n\nCheck *why* the job is red before hunting for vulnerabilities. A scanner that\ndies in setup reports the same red X as a scanner that found a critical CVE.\n\n```bash\nRUN=$(gh run list --workflow=snyk.yml --branch main --limit 1 --json databaseId --jq '.[0].databaseId')\ngh run view \"$RUN\" --log > \u002Ftmp\u002Fsnyk.log\ngrep -nE \"##\\[error\\]|Acquiring|ECONNREFUSED|severity|issues found\" \u002Ftmp\u002Fsnyk.log\n```\n\n`gh run view --log-failed` is often useless here, and so is `tail`: harden-runner\ndumps its entire agent log into the job's teardown, so both show eBPF and systemd\nchatter instead of the error. Find the failing step by name, then grep only that\nstep's lines:\n\n```bash\ngh run view \u003Crun_id> --json jobs \\\n  --jq '.jobs[] | {name, conclusion, failed: [.steps[]|select(.conclusion==\"failure\")|.name]}'\nJOB=\u003CdatabaseId from above>\ngh run view --job \"$JOB\" --log | grep -F \"\u003Cfailing step name>\" | cut -c1-200 | tail -40\n```\n\nThen widen the `cut` on the one interesting line, because the real cause is often\npast column 200. A truncated `unable to download ...` can end in `got status\n\"504 Gateway Timeout\"`, which is a transient, not a bug.\n\n#### An expired scanner token looks exactly like a finding\n\nBoth scanner tokens expire, and neither failure says so plainly. Snyk is the\nhonest one; SonarCloud blames its own config:\n\n```\nERROR   Authentication error (SNYK-0005)\nStatus: 401 Unauthorized\n\nERROR Failed to query JRE metadata: . Please check the property sonar.token\n      or the environment variable SONAR_TOKEN.\n```\n\nThe Sonar message reads like a workflow bug, and the empty detail after the\ncolon is the giveaway that the request failed rather than returned anything.\nCheck the secret's age before touching the workflow:\n\n```bash\ngh secret list   # updated dates, which is the closest thing to an expiry\n```\n\nBoth were dead in the 2026-09 pass, `SONAR_TOKEN` for roughly eight months. Only\na human can rotate them, so raise it early rather than at the end: the branch\ncannot go fully green without it, and no amount of allowlist work will help.\n\n#### harden-runner egress blocks (the recurring one)\n\nEvery job runs `step-security\u002Fharden-runner` with `egress-policy: block` and an\nexplicit `allowed-endpoints` list. A missing endpoint fails the job with a bare\n`connect ECONNREFUSED \u003Cip>:443` and nothing else.\n\nThese failures are **latent**. The blocked download usually only happens on a\ncache miss or a version change, so an allowlist can be wrong for weeks and pass\nanyway, then break everything at once:\n\n- `release-assets.githubusercontent.com:443` is where `actions\u002Fsetup-go` fetches\n  the Go toolchain. It is only downloaded when the runner image does not already\n  ship the version in `go.mod`, **so bumping the `go` directive can break every\n  job whose allowlist is missing this**. Bump the directive and the endpoint in\n  the same change.\n- `binaries.sonarsource.com:443` is the Sonar Scanner CLI zip, cached under a\n  version-keyed Actions cache, so it only downloads when that cache is cold.\n- `vuln.go.dev:443` is govulncheck's database.\n- `api.snyk.io:443` is Snyk.\n- `cli.codecov.io:443` and `ingest.codecov.io:443` are the Codecov uploader,\n  which also reports to `*.ingest.us.sentry.io:443`. It additionally fetches\n  its signing key from `keybase.io:443`; block that and the step aborts with\n  `Could not verify signature`, which names no host at all.\n- `golangci-lint.run:443` serves the JSON schema that `golangci-lint config\n  verify` validates `.golangci.yml` against. The action runs that before it\n  lints anything, so the job dies in about 13 seconds with a schema load error\n  that reads like a config problem.\n- `ghcr.io:443`, `pkg-containers.githubusercontent.com:443`,\n  `registry-1.docker.io:443`, `auth.docker.io:443` and\n  `production.cloudfront.docker.com:443` are the image build and push jobs.\n\nWhen a job fails at `Set up Go`, compare its allowlist against a job in the same\nrepo that passes. The passing job's list is the answer.\n\nFor a denial that is not an obvious toolchain fetch, get the real egress data\nfrom the StepSecurity run page rather than the Actions log, which does not carry\nit: `https:\u002F\u002Fapp.stepsecurity.io\u002Fgithub\u002FTight-Line\u002Fgatekeeper\u002Factions\u002Fruns\u002F\u003Crun_id>`.\nThe run page lists every destination the job actually reached and which ones were\nblocked.\n\nWildcard rule when adding an entry: wildcard only narrow vendor-owned domains\nsuch as `*.ingest.us.sentry.io`; pin shared multi-tenant infrastructure such as\nS3 and GCS buckets to the exact host. Matching is exact-FQDN, so `github.com`\ndoes not cover its subdomains.\n\nAudit every job at once rather than fixing them one red check at a time. System\n`python3` here has no `yaml` module; `ruby -ryaml` does:\n\n```bash\nruby -ryaml -e '\nDir[\".github\u002Fworkflows\u002F*.yml\"].sort.each do |f|\n  y = YAML.load_file(f)\n  (y[\"jobs\"]||{}).each do |job, cfg|\n    steps = cfg[\"steps\"]||[]\n    next unless steps.any?{|s| s[\"uses\"].to_s.include?(\"actions\u002Fsetup-go\")}\n    hr = steps.find{|s| s[\"uses\"].to_s.include?(\"harden-runner\")}\n    eps = hr ? hr[\"with\"][\"allowed-endpoints\"].to_s.split : []\n    ok = eps.include?(\"release-assets.githubusercontent.com:443\")\n    puts \"%-34s %s\" % [File.basename(f)+\"\u002F\"+job, ok ? \"ok\" : \"*** MISSING ***\"]\n  end\nend'\n```\n\nJobs that never invoke `setup-go` but still run `go build`, such as the image\nbuilds, pull a bumped toolchain through the module proxy instead, so they need\n`proxy.golang.org:443` rather than `release-assets`. Swap the `setup-go` test\nabove for that endpoint to check them.\n\nAdding an endpoint to an allowlist may be refused by the permission classifier as\na \"security weaken\" when done through a scripted `sed` or `python` edit. Make the\nedit with the normal file-edit tool instead, so the change is explicit and\nreviewable.\n\n#### Unpinned actions\n\n`uses: some\u002Faction@v4` resolves to a moving tag, so a compromised or retagged\nrelease runs with the job's token. Pin every `uses:` to a full commit SHA with\nthe version in a trailing comment, which is also what the `github-actions`\nDependabot ecosystem updates:\n\n```bash\ngrep -rn \"uses:\" .github\u002Fworkflows\u002F | grep -vE \"@[0-9a-f]{40}\"\ngh api repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fcommits\u002F\u003Ctag> --jq '.sha'   # resolve a tag to its SHA\n```\n\n`@master` is the worst case and still needs a SHA; keep `# master` as the\ntrailing comment so Dependabot can still track it.\n\n#### The 100% coverage gate\n\nThis repo enforces 100% coverage via `scripts\u002Fcheck-coverage.sh`, wired into\n`make test-coverage-check` and into CI. Dependency bumps rarely move it, but a\n`go mod tidy` that drops or adds a file can, and a new `tool` directive pulls in\npackages that must not end up in the coverage set. Fix a real gap with a test,\nnot with `coverage:ignore`; see the Test Coverage Exclusions section in\n`AGENTS.md` for the narrow cases where an ignore is legitimate, and note that it\nasks you to get the developer's agreement first.\n\nThe exception is the timing-dependent lines in `internal\u002Frelay\u002Fredis_manager.go`,\nwhere whether a branch is reached depends on a race between an `XReadGroup` block\ntimeout and a context deadline. Those come out covered on a fast machine and\nuncovered on a CI runner, so this is the one coverage failure that does **not**\nreproduce locally. Confirm which kind you have before changing any code:\n\n```bash\nfor i in 1 2 3 4 5; do\n  go test -race -coverprofile=\u002Ftmp\u002Fc$i.out -covermode=atomic -tags=ci .\u002Finternal\u002Frelay\u002F >\u002Fdev\u002Fnull 2>&1\n  echo \"run $i: $(grep 'redis_manager.go:\u003Cline>' \u002Ftmp\u002Fc$i.out | awk '{print $NF}')\"\ndone\ngh run rerun \u003Crun_id> --failed   # a pass on re-run settles it\n```\n\nTwo things about how the script reads the marker, both of which cost a CI round\nif you get them wrong. It looks for `coverage:ignore` **only** on the uncovered\nline itself or the line immediately above it, so:\n\n- An ignore on an enclosing `if` does not cover a branch nested inside it.\n- In a multi-line comment, the marker has to be on the **last** line of the\n  block. Lead with the prose and put `coverage:ignore - \u003Creason>` on the line\n  that touches the code, not at the top of the comment.\n\n#### Sonar quality gate\n\nSonar only fails on **new code**, so dependency bumps rarely move it. If it\nfails, read the gate on the PR decoration rather than guessing.\n\nNote that on Dependabot and fork runs `SONAR_TOKEN` and `SNYK_TOKEN` are empty,\nso both jobs skip and report green. A green Sonar or Snyk check on a Dependabot\nPR means nothing was scanned. They run for real on this branch, because it is\npushed from the repo rather than by Dependabot. `govulncheck` is tokenless and is\nthe only scanner that gates a Dependabot PR for real, which is the reason it\nbelongs in `ci.yml` rather than in a workflow of its own.\n\n### 6. Changelog and commit\n\n**A security pass must leave a `### Security` entry under `## [Unreleased]`.**\nThis is the one thing that cannot be skipped. `scripts\u002Fmake-tag` refuses to cut a\nrelease when `[Unreleased]` is empty, so with no entry there is no way to ship the\npatched build at all, and the fix ends up riding along with whatever feature lands\nnext. The entry is also the only way a user learns why the patch release is worth\ntaking, since by definition they cannot see the change.\n\nThis is an explicit carve-out from the \"do NOT add entries for internal\nrefactoring\" rule in the Changelog Maintenance section of `AGENTS.md`. Write the\nadvisory IDs and what they affect, not just \"bumped dependencies\". Routine bumps\ncarrying no security fix do not each need a line; summarize those under\n`### Changed`.\n\nDo not touch version numbers or tags. Releases go through `scripts\u002Fmake-tag`.\n\nStage every file you touched. `make lint` and `make test-coverage-check` pass on\nworking-tree state, but CI only sees what is committed:\n\n```bash\ngit status\nmake check     # must be green on the staged tree\n```\n\n### 7. Push and verify\n\n```bash\ngit push -u origin chore\u002Fsecurity-upgrades-\u003CYYYY-MM>\ngh pr create --fill\n```\n\nThen **watch the checks actually go green**. This branch exists specifically to\nfix red gates, so a green local run is not the deliverable:\n\n```bash\ngh pr checks --watch\n```\n\nMerging this PR auto-closes the Dependabot PRs whose commits it contains.\n\nKnown transients, neither of which is a real failure:\n\n- Release-asset downloads from GitHub intermittently **504**. They take out one\n  job while a sibling pulling the same tarball succeeds.\n- `go mod download` intermittently dies on a **`stream error: ... INTERNAL_ERROR`**\n  from `proxy.golang.org` mid-zip.\n\nBoth clear on a re-run, which only works once the whole run has finished; while\nsibling jobs are still going it refuses with \"This workflow is already running\":\n\n```bash\ngh run rerun \u003Crun_id> --failed\n```\n\nA dependency-heavy failure is worth one check before writing it off, especially\nright after resolving a `go.sum` conflict. These two commands settle it locally\nin seconds, and \"all modules verified\" means the checksums are sound and the\nfailure was the network:\n\n```bash\ngo mod download && echo ok\ngo mod verify\n```\n\nVerify a scanner actually scanned before calling it green. Both of these skip\nsilently when their token is absent, and a skipped job reports pass:\n\n```bash\ngh run view --job \u003Cjob_id> --log | grep -F \"Run Snyk\" | grep -iE \"Tested .* dependencies|issues found\"\ngh run view --job \u003Cjob_id> --log | grep -F \"SonarCloud Scan\" | grep -iE \"ANALYSIS SUCCESSFUL|EXECUTION\"\n```\n\nA real Snyk run prints `Tested N dependencies for known issues`; a real Sonar run\nprints `ANALYSIS SUCCESSFUL` and `EXECUTION SUCCESS`.\n\n## Checklist\n\n- [ ] Dependabot confirmed switched on, or `dependabot.yml` added, so the backlog is visible next time\n- [ ] Every open Dependabot PR either cherry-picked onto the branch or explicitly noted as superseded\n- [ ] `git rev-list --merges origin\u002Fmain..HEAD` is empty, so \"Rebase and merge\" works\n- [ ] `go.mod` and `go.sum` conflicts resolved to the higher version on both sides\n- [ ] `go` directive on a supported minor line at its latest patch; `govulncheck` clean\n- [ ] Every Go version pin agrees: `go.mod`, all workflows, both Dockerfiles\n- [ ] Every `uses:` pinned to a full commit SHA\n- [ ] Each red gate diagnosed from its real log, not assumed to be a finding\n- [ ] `make check` green on the committed tree, including 100% coverage\n- [ ] `CHANGELOG.md` `[Unreleased]` has a `### Security` entry naming the advisories, so a patch release can be cut\n- [ ] PR checks watched to completion, and Snyk\u002FSonar confirmed to have actually scanned\n","# Apply security upgrades\n\nCollapse every outstanding security item into a single reviewable branch, then\nfix whatever the gates report. One branch, one PR, one CI run instead of five\nthat each burn a full matrix.\n\n## Why a single branch\n\nDependabot opens one PR per ecosystem group. Each one runs the whole CI matrix,\neach one has to be merged and then rebased against the others, and none of them\ncan fix a problem that lives outside its own diff, such as a stale `go` directive\nor a missing egress endpoint. Merging them together first means one CI run, one\nreview, and a place to put the fixes that no individual bump could carry.\n\n## Procedure\n\n### 1. Survey\n\nStart with the Dependabot PRs, if there are any:\n\n```bash\ngh pr list --limit 50 --json number,title,headRefName,author \\\n  --jq '.[] | select(.author.login==\"app\u002Fdependabot\") | \"\\(.number)\\t\\(.headRefName)\\t\\(.title)\"'\n```\n\nAn empty list is not the same as \"nothing to do\". Confirm the machinery is\nactually switched on before believing it:\n\n```bash\ngh api repos\u002FTight-Line\u002Fgatekeeper --jq '.security_and_analysis'\ngh api repos\u002FTight-Line\u002Fgatekeeper\u002Fvulnerability-alerts -i | head -1   # 204 = alerts on\ngh api repos\u002FTight-Line\u002Fgatekeeper\u002Fdependabot\u002Falerts --jq 'length'\ntest -f .github\u002Fdependabot.yml && echo \"version updates configured\" || echo \"NO dependabot.yml\"\n```\n\n`dependabot_security_updates: disabled` plus no `dependabot.yml` means no PRs\nwill ever be opened, so a quiet backlog looks identical to a clean repo. Zero\nalerts from a repo with no dependency graph means the same thing. In that state\nthe survey has to come from the tools directly; see step 4.\n\nCheck that the scanners are still switched on, too. GitHub disables a workflow\nwhose only trigger is `schedule` after 60 days without repository activity, and\nit does so silently: the workflow simply stops running, no check goes red, and\nthe last run sits there green forever.\n\n```bash\ngh api repos\u002FTight-Line\u002Fgatekeeper\u002Factions\u002Fworkflows \\\n  --jq '.workflows[] | \"\\(.state)\\t\\(.name)\"'   # look for disabled_inactivity\ngh workflow enable snyk.yml                     # to switch one back on\n```\n\nThis is how `snyk.yml` went dark here: it last ran on its weekly cron in\nAugust, was disabled for inactivity, and then did not run on the 2026-09 pass\nat all until it was re-enabled by hand.\n\nFor each PR that does exist, check it is a forward bump and not stale; `main` may\nalready carry a newer bump of the same group:\n\n```bash\ngit fetch origin\ngit diff origin\u002Fmain...origin\u002F\u003Cbranch>\n```\n\nCapture the current gate status, and **capture it for `main` too**:\n\n```bash\ngh pr checks \u003Cn>\ngh run list --branch main --limit 15 \\\n  --json conclusion,name,headSha,createdAt \\\n  --jq '.[] | \"\\(.conclusion)\\t\\(.name)\\t\\(.headSha[0:8])\"'\n```\n\n> If a check is red on *every* PR including ones that touch only the Dockerfile,\n> it is not the dependency bumps. It is infrastructure, and it is almost\n> certainly also red on `main`. Diagnose it before touching any dependency.\n\nCheck the run dates, not just the conclusions. Runs whose `headSha` has not moved\nin months mean nothing has been scanned in months, however green they look.\n\n### 2. Build the branch\n\n```bash\ngit checkout -b chore\u002Fsecurity-upgrades-\u003CYYYY-MM> origin\u002Fmain\n```\n\n**Cherry-pick; do not merge.** `main` has a strictly linear history. A branch\nbuilt with `git merge` fails a later rebase with `This branch cannot be rebased\ndue to conflicts` even when GitHub simultaneously reports the PR as `MERGEABLE`\nand `CLEAN`: the conflict resolution lives *inside* a merge commit, rebase\ndiscards it, and the conflict comes back with nothing to resolve it.\nCherry-picking resolves the conflict inline, in a real commit, where rebase can\ncarry it.\n\nApply in a deliberate order; cheapest and least conflict-prone first, Go modules\nlast, and within Go modules the **grouped minor\u002Fpatch bump before the security\nbump** so the security pin is the one that survives:\n\n1. `github-actions` group\n2. `docker` bumps\n3. `gomod` minor\u002Fpatch group\n4. `gomod` security group\n\n```bash\n# each Dependabot branch is a single commit; -x records where it came from\ngit cherry-pick -x origin\u002F\u003Cbranch>\n```\n\nCherry-pick preserves `dependabot[bot]` as the author, so the audit trail\nsurvives. Merging this PR still auto-closes the Dependabot PRs, because the PR\nbody's `Closes #NNN` keywords do that regardless of whether their exact SHAs land.\n\n### 3. Resolve go.mod \u002F go.sum conflicts\n\nTwo Go module changes will conflict when the security bump goes on top of the\ngrouped one. Do **not** hand-merge the version lines. Take the already-applied\nside, then re-apply the incoming pin through the toolchain so `go.sum` stays\ninternally consistent:\n\n```bash\ngit checkout --ours go.mod go.sum\ngo get \u003Cmodule>@\u003Cversion>   # re-apply each security pin the incoming commit carried\ngo mod tidy                 # slow; run it in the background\ngit add go.mod go.sum\ngit cherry-pick --continue  # or `git rebase --continue`\n```\n\n`--ours` means \"what is already applied\" during both cherry-pick and rebase,\nwhich is the grouped bump. That is the side to keep. Note this is the opposite\nsense from `git merge`, where `--ours` is the branch you are merging into.\n\nRule for each conflicting line: **take the higher version**. The minor\u002Fpatch\ngroup is often newer for transitive deps such as `golang.org\u002Fx\u002Fsys` and\n`protobuf`, while the security group is newer for the one module it targets.\nBoth need to win where they are ahead.\n\n`go mod tidy` may legitimately prune `go.sum` lines for the version being\nreplaced. That is correct, not drift. But it means the tree is no longer\nbyte-identical to a previously verified one, so re-run the gate rather than\ntrusting the earlier green run.\n\n### 4. Find what is actually outstanding\n\nWith no Dependabot PRs to inherit from, the backlog comes from the tools:\n\n```bash\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F...   # symbol-level, authoritative\ngo list -u -m -f '{{if and .Update (not .Indirect)}}{{.Path}} {{.Version}} -> {{.Update.Version}}{{end}}' all\n```\n\n`govulncheck` is the one that decides what counts as a security fix. Everything\nelse `go list -u` turns up is a routine bump and belongs under `### Changed`.\n\nResolve each finding to its real fixed version rather than trusting the single\nversion `govulncheck` prints, which is only the fix for the line you are on:\n\n```bash\ncurl -s https:\u002F\u002Fvuln.go.dev\u002FID\u002FGO-2026-XXXX.json \\\n  | ruby -rjson -e 'd=JSON.parse(STDIN.read); puts d[\"summary\"]\n      d[\"affected\"].each{|a| puts \"  #{a[\"package\"][\"name\"]}: \" +\n        a[\"ranges\"].map{|r| r[\"events\"].map{|e| e.to_a.flatten.join(\":\")}.join(\" \")}.join(\" | \")}'\n```\n\nThat prints every affected minor line and where each one was patched, which is\nwhat decides the `go` directive target in the next step.\n\n### 5. Fix the gates\n\nRun the repo gate locally before pushing:\n\n```bash\nmake check                 # lint + test-coverage-check + build-all\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F...\n```\n\nBoth are slow. Run them in the background and **read the real output**, not a\nwrapper's exit status. `govulncheck` exits `3` on findings, and a trailing\n`echo EXIT=$?` through a pipe reports the pipe's status rather than the tool's.\n\nKnown classes of problem, in the order they tend to bite:\n\n#### The stale `go` directive (Dependabot cannot fix this)\n\n`govulncheck` reports Go **standard library** vulnerabilities against the Go\nversion the module builds with. Dependabot bumps modules and the Dockerfile\nbuilder image; it never bumps the `go` directive in `go.mod`. So the stdlib\nquietly rots and `govulncheck` fails with findings that no dependency PR can\nclear.\n\n```bash\n# what patch releases exist\ncurl -s \"https:\u002F\u002Fgo.dev\u002Fdl\u002F?mode=json&include=all\" \\\n  | grep -oE '\"version\": \"go1\\.[0-9]+\\.[0-9]+\"' | sort -u -V | tail -20\n# setup-go must be able to install it\ncurl -s \"https:\u002F\u002Fraw.githubusercontent.com\u002Factions\u002Fgo-versions\u002Fmain\u002Fversions-manifest.json\" \\\n  | grep -oE '\"version\": \"1\\.[0-9]+\\.[0-9]+\"' | sort -u -V | tail -12\n```\n\nPrefer the **latest patch on the current minor line**: a minor bump changes\nlanguage semantics and vet\u002Flint behavior and does not belong in a security pass.\nThe exception is when the current line is end-of-life. Go supports only the two\nmost recent minors, so once `1.N+2` ships, `1.N` stops getting patches and\nstaying on it means the next stdlib CVE has no fix at all. In that case move to the\ncurrent release rather than the oldest line that is merely still supported, so\nthe next pass is not doing this again immediately. The 2026-09 pass moved\n`1.25.6` to `1.27.1` for exactly this reason: every finding was patched in\n`1.25.13`, but `1.27` had shipped and `1.25.14` was the end of that line.\n\nBudget for a minor bump costing more than the directive:\n\n- It drags the lint toolchain with it. `golangci-lint` refuses to run at all\n  when the Go it was built with is older than the target, with `the Go language\n  version (go1.26) used to build golangci-lint is lower than the targeted Go\n  version (1.27.1)`. The pinned version in `ci.yml` has to move to a release\n  built with the new Go, and a local binary on `PATH` has to move too or the\n  local gate disagrees with CI.\n- That newer linter brings newer `staticcheck` rules, which surface deprecations\n  the old one never mentioned. The 2026-09 pass turned up\n  `httputil.ReverseProxy.Director`, deprecated in Go 1.26, in the forwarding path.\n- Go can change which line it attributes an uncovered block to. A `coverage:ignore`\n  marker that sits a fixed distance from the code can stop matching, so plan for\n  the coverage gate to fail on code the bump never touched.\n\n```bash\ngo mod edit -go=\u003Cversion>    # does not add a `toolchain` directive; keep it that way\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F...    # must print \"No vulnerabilities found.\"\n```\n\nThe version is pinned in more places than `go.mod`. Miss one and CI keeps\nbuilding against the vulnerable toolchain while the local run looks clean:\n\n```bash\ngrep -rn \"go-version\\|golang:\" .github\u002Fworkflows\u002F Dockerfile Dockerfile.relay\n```\n\nPrefer `go-version-file: go.mod` in every workflow over a hardcoded string, so\nthere is exactly one place to bump next time. The Dockerfiles track a minor line\n(`golang:1.27-alpine`) and pick up patches on their own, so they only need\ntouching on a minor bump.\n\nConfirm the bump against the real output. A local toolchain older than the new\ndirective is downloaded automatically, so a passing run also proves the toolchain\nresolved. Beware the reverse: a local toolchain *newer* than the directive is\nused as-is, so `govulncheck` locally reports against that newer toolchain, not\nagainst the directive. Check which one it used before concluding anything:\n\n```bash\ngo run golang.org\u002Fx\u002Fvuln\u002Fcmd\u002Fgovulncheck@v1.8.0 .\u002F... | grep -oE 'go1\\.[0-9]+\\.[0-9]+' | sort -u\n```\n\nThe Dockerfile builder image and the `go` directive do **not** need to match. A\nnewer toolchain building an older-directive module is fine and normal.\n\n#### Snyk or Sonar red for reasons that are not findings\n\nCheck *why* the job is red before hunting for vulnerabilities. A scanner that\ndies in setup reports the same red X as a scanner that found a critical CVE.\n\n```bash\nRUN=$(gh run list --workflow=snyk.yml --branch main --limit 1 --json databaseId --jq '.[0].databaseId')\ngh run view \"$RUN\" --log > \u002Ftmp\u002Fsnyk.log\ngrep -nE \"##\\[error\\]|Acquiring|ECONNREFUSED|severity|issues found\" \u002Ftmp\u002Fsnyk.log\n```\n\n`gh run view --log-failed` is often useless here, and so is `tail`: harden-runner\ndumps its entire agent log into the job's teardown, so both show eBPF and systemd\nchatter instead of the error. Find the failing step by name, then grep only that\nstep's lines:\n\n```bash\ngh run view \u003Crun_id> --json jobs \\\n  --jq '.jobs[] | {name, conclusion, failed: [.steps[]|select(.conclusion==\"failure\")|.name]}'\nJOB=\u003CdatabaseId from above>\ngh run view --job \"$JOB\" --log | grep -F \"\u003Cfailing step name>\" | cut -c1-200 | tail -40\n```\n\nThen widen the `cut` on the one interesting line, because the real cause is often\npast column 200. A truncated `unable to download ...` can end in `got status\n\"504 Gateway Timeout\"`, which is a transient, not a bug.\n\n#### An expired scanner token looks exactly like a finding\n\nBoth scanner tokens expire, and neither failure says so plainly. Snyk is the\nhonest one; SonarCloud blames its own config:\n\n```\nERROR   Authentication error (SNYK-0005)\nStatus: 401 Unauthorized\n\nERROR Failed to query JRE metadata: . Please check the property sonar.token\n      or the environment variable SONAR_TOKEN.\n```\n\nThe Sonar message reads like a workflow bug, and the empty detail after the\ncolon is the giveaway that the request failed rather than returned anything.\nCheck the secret's age before touching the workflow:\n\n```bash\ngh secret list   # updated dates, which is the closest thing to an expiry\n```\n\nBoth were dead in the 2026-09 pass, `SONAR_TOKEN` for roughly eight months. Only\na human can rotate them, so raise it early rather than at the end: the branch\ncannot go fully green without it, and no amount of allowlist work will help.\n\n#### harden-runner egress blocks (the recurring one)\n\nEvery job runs `step-security\u002Fharden-runner` with `egress-policy: block` and an\nexplicit `allowed-endpoints` list. A missing endpoint fails the job with a bare\n`connect ECONNREFUSED \u003Cip>:443` and nothing else.\n\nThese failures are **latent**. The blocked download usually only happens on a\ncache miss or a version change, so an allowlist can be wrong for weeks and pass\nanyway, then break everything at once:\n\n- `release-assets.githubusercontent.com:443` is where `actions\u002Fsetup-go` fetches\n  the Go toolchain. It is only downloaded when the runner image does not already\n  ship the version in `go.mod`, **so bumping the `go` directive can break every\n  job whose allowlist is missing this**. Bump the directive and the endpoint in\n  the same change.\n- `binaries.sonarsource.com:443` is the Sonar Scanner CLI zip, cached under a\n  version-keyed Actions cache, so it only downloads when that cache is cold.\n- `vuln.go.dev:443` is govulncheck's database.\n- `api.snyk.io:443` is Snyk.\n- `cli.codecov.io:443` and `ingest.codecov.io:443` are the Codecov uploader,\n  which also reports to `*.ingest.us.sentry.io:443`. It additionally fetches\n  its signing key from `keybase.io:443`; block that and the step aborts with\n  `Could not verify signature`, which names no host at all.\n- `golangci-lint.run:443` serves the JSON schema that `golangci-lint config\n  verify` validates `.golangci.yml` against. The action runs that before it\n  lints anything, so the job dies in about 13 seconds with a schema load error\n  that reads like a config problem.\n- `ghcr.io:443`, `pkg-containers.githubusercontent.com:443`,\n  `registry-1.docker.io:443`, `auth.docker.io:443` and\n  `production.cloudfront.docker.com:443` are the image build and push jobs.\n\nWhen a job fails at `Set up Go`, compare its allowlist against a job in the same\nrepo that passes. The passing job's list is the answer.\n\nFor a denial that is not an obvious toolchain fetch, get the real egress data\nfrom the StepSecurity run page rather than the Actions log, which does not carry\nit: `https:\u002F\u002Fapp.stepsecurity.io\u002Fgithub\u002FTight-Line\u002Fgatekeeper\u002Factions\u002Fruns\u002F\u003Crun_id>`.\nThe run page lists every destination the job actually reached and which ones were\nblocked.\n\nWildcard rule when adding an entry: wildcard only narrow vendor-owned domains\nsuch as `*.ingest.us.sentry.io`; pin shared multi-tenant infrastructure such as\nS3 and GCS buckets to the exact host. Matching is exact-FQDN, so `github.com`\ndoes not cover its subdomains.\n\nAudit every job at once rather than fixing them one red check at a time. System\n`python3` here has no `yaml` module; `ruby -ryaml` does:\n\n```bash\nruby -ryaml -e '\nDir[\".github\u002Fworkflows\u002F*.yml\"].sort.each do |f|\n  y = YAML.load_file(f)\n  (y[\"jobs\"]||{}).each do |job, cfg|\n    steps = cfg[\"steps\"]||[]\n    next unless steps.any?{|s| s[\"uses\"].to_s.include?(\"actions\u002Fsetup-go\")}\n    hr = steps.find{|s| s[\"uses\"].to_s.include?(\"harden-runner\")}\n    eps = hr ? hr[\"with\"][\"allowed-endpoints\"].to_s.split : []\n    ok = eps.include?(\"release-assets.githubusercontent.com:443\")\n    puts \"%-34s %s\" % [File.basename(f)+\"\u002F\"+job, ok ? \"ok\" : \"*** MISSING ***\"]\n  end\nend'\n```\n\nJobs that never invoke `setup-go` but still run `go build`, such as the image\nbuilds, pull a bumped toolchain through the module proxy instead, so they need\n`proxy.golang.org:443` rather than `release-assets`. Swap the `setup-go` test\nabove for that endpoint to check them.\n\nAdding an endpoint to an allowlist may be refused by the permission classifier as\na \"security weaken\" when done through a scripted `sed` or `python` edit. Make the\nedit with the normal file-edit tool instead, so the change is explicit and\nreviewable.\n\n#### Unpinned actions\n\n`uses: some\u002Faction@v4` resolves to a moving tag, so a compromised or retagged\nrelease runs with the job's token. Pin every `uses:` to a full commit SHA with\nthe version in a trailing comment, which is also what the `github-actions`\nDependabot ecosystem updates:\n\n```bash\ngrep -rn \"uses:\" .github\u002Fworkflows\u002F | grep -vE \"@[0-9a-f]{40}\"\ngh api repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fcommits\u002F\u003Ctag> --jq '.sha'   # resolve a tag to its SHA\n```\n\n`@master` is the worst case and still needs a SHA; keep `# master` as the\ntrailing comment so Dependabot can still track it.\n\n#### The 100% coverage gate\n\nThis repo enforces 100% coverage via `scripts\u002Fcheck-coverage.sh`, wired into\n`make test-coverage-check` and into CI. Dependency bumps rarely move it, but a\n`go mod tidy` that drops or adds a file can, and a new `tool` directive pulls in\npackages that must not end up in the coverage set. Fix a real gap with a test,\nnot with `coverage:ignore`; see the Test Coverage Exclusions section in\n`AGENTS.md` for the narrow cases where an ignore is legitimate, and note that it\nasks you to get the developer's agreement first.\n\nThe exception is the timing-dependent lines in `internal\u002Frelay\u002Fredis_manager.go`,\nwhere whether a branch is reached depends on a race between an `XReadGroup` block\ntimeout and a context deadline. Those come out covered on a fast machine and\nuncovered on a CI runner, so this is the one coverage failure that does **not**\nreproduce locally. Confirm which kind you have before changing any code:\n\n```bash\nfor i in 1 2 3 4 5; do\n  go test -race -coverprofile=\u002Ftmp\u002Fc$i.out -covermode=atomic -tags=ci .\u002Finternal\u002Frelay\u002F >\u002Fdev\u002Fnull 2>&1\n  echo \"run $i: $(grep 'redis_manager.go:\u003Cline>' \u002Ftmp\u002Fc$i.out | awk '{print $NF}')\"\ndone\ngh run rerun \u003Crun_id> --failed   # a pass on re-run settles it\n```\n\nTwo things about how the script reads the marker, both of which cost a CI round\nif you get them wrong. It looks for `coverage:ignore` **only** on the uncovered\nline itself or the line immediately above it, so:\n\n- An ignore on an enclosing `if` does not cover a branch nested inside it.\n- In a multi-line comment, the marker has to be on the **last** line of the\n  block. Lead with the prose and put `coverage:ignore - \u003Creason>` on the line\n  that touches the code, not at the top of the comment.\n\n#### Sonar quality gate\n\nSonar only fails on **new code**, so dependency bumps rarely move it. If it\nfails, read the gate on the PR decoration rather than guessing.\n\nNote that on Dependabot and fork runs `SONAR_TOKEN` and `SNYK_TOKEN` are empty,\nso both jobs skip and report green. A green Sonar or Snyk check on a Dependabot\nPR means nothing was scanned. They run for real on this branch, because it is\npushed from the repo rather than by Dependabot. `govulncheck` is tokenless and is\nthe only scanner that gates a Dependabot PR for real, which is the reason it\nbelongs in `ci.yml` rather than in a workflow of its own.\n\n### 6. Changelog and commit\n\n**A security pass must leave a `### Security` entry under `## [Unreleased]`.**\nThis is the one thing that cannot be skipped. `scripts\u002Fmake-tag` refuses to cut a\nrelease when `[Unreleased]` is empty, so with no entry there is no way to ship the\npatched build at all, and the fix ends up riding along with whatever feature lands\nnext. The entry is also the only way a user learns why the patch release is worth\ntaking, since by definition they cannot see the change.\n\nThis is an explicit carve-out from the \"do NOT add entries for internal\nrefactoring\" rule in the Changelog Maintenance section of `AGENTS.md`. Write the\nadvisory IDs and what they affect, not just \"bumped dependencies\". Routine bumps\ncarrying no security fix do not each need a line; summarize those under\n`### Changed`.\n\nDo not touch version numbers or tags. Releases go through `scripts\u002Fmake-tag`.\n\nStage every file you touched. `make lint` and `make test-coverage-check` pass on\nworking-tree state, but CI only sees what is committed:\n\n```bash\ngit status\nmake check     # must be green on the staged tree\n```\n\n### 7. Push and verify\n\n```bash\ngit push -u origin chore\u002Fsecurity-upgrades-\u003CYYYY-MM>\ngh pr create --fill\n```\n\nThen **watch the checks actually go green**. This branch exists specifically to\nfix red gates, so a green local run is not the deliverable:\n\n```bash\ngh pr checks --watch\n```\n\nMerging this PR auto-closes the Dependabot PRs whose commits it contains.\n\nKnown transients, neither of which is a real failure:\n\n- Release-asset downloads from GitHub intermittently **504**. They take out one\n  job while a sibling pulling the same tarball succeeds.\n- `go mod download` intermittently dies on a **`stream error: ... INTERNAL_ERROR`**\n  from `proxy.golang.org` mid-zip.\n\nBoth clear on a re-run, which only works once the whole run has finished; while\nsibling jobs are still going it refuses with \"This workflow is already running\":\n\n```bash\ngh run rerun \u003Crun_id> --failed\n```\n\nA dependency-heavy failure is worth one check before writing it off, especially\nright after resolving a `go.sum` conflict. These two commands settle it locally\nin seconds, and \"all modules verified\" means the checksums are sound and the\nfailure was the network:\n\n```bash\ngo mod download && echo ok\ngo mod verify\n```\n\nVerify a scanner actually scanned before calling it green. Both of these skip\nsilently when their token is absent, and a skipped job reports pass:\n\n```bash\ngh run view --job \u003Cjob_id> --log | grep -F \"Run Snyk\" | grep -iE \"Tested .* dependencies|issues found\"\ngh run view --job \u003Cjob_id> --log | grep -F \"SonarCloud Scan\" | grep -iE \"ANALYSIS SUCCESSFUL|EXECUTION\"\n```\n\nA real Snyk run prints `Tested N dependencies for known issues`; a real Sonar run\nprints `ANALYSIS SUCCESSFUL` and `EXECUTION SUCCESS`.\n\n## Checklist\n\n- [ ] Dependabot confirmed switched on, or `dependabot.yml` added, so the backlog is visible next time\n- [ ] Every open Dependabot PR either cherry-picked onto the branch or explicitly noted as superseded\n- [ ] `git rev-list --merges origin\u002Fmain..HEAD` is empty, so \"Rebase and merge\" works\n- [ ] `go.mod` and `go.sum` conflicts resolved to the higher version on both sides\n- [ ] `go` directive on a supported minor line at its latest patch; `govulncheck` clean\n- [ ] Every Go version pin agrees: `go.mod`, all workflows, both Dockerfiles\n- [ ] Every `uses:` pinned to a full commit SHA\n- [ ] Each red gate diagnosed from its real log, not assumed to be a finding\n- [ ] `make check` green on the committed tree, including 100% coverage\n- [ ] `CHANGELOG.md` `[Unreleased]` has a `### Security` entry naming the advisories, so a patch release can be cut\n- [ ] PR checks watched to completion, and Snyk\u002FSonar confirmed to have actually scanned\n",{"name":5,"description":7},"main","a86643868abd22aab77f832fc83e98b66a84e7f8",".claude\u002Fskills\u002Fapply-security-upgrades",1,"https:\u002F\u002Fgithub.com\u002FTight-Line\u002Fgatekeeper","https:\u002F\u002Fgithub.com\u002FTight-Line","2026-11-09 14:53:07",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add Tight-Line\u002Fgatekeeper --skill apply-security-upgrades",{"tool":50,"command":51},"bunx","bunx skills add Tight-Line\u002Fgatekeeper --skill apply-security-upgrades",{"tool":53,"command":54},"pnpm","pnpm dlx skills add Tight-Line\u002Fgatekeeper --skill apply-security-upgrades","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTight-Line\u002Fgatekeeper\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fapply-security-upgrades\u002FSKILL.md",true,[],[59,67],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":32},"01M6CCS7FS2C08QNBRGJBX4EVT","configure-route","https:\u002F\u002Fgithub.com\u002FTight-Line\u002Fgatekeeper\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfigure-route\u002FSKILL.md",[],[65,66],"configure","configure route",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":32},"01M6CCS69X04QQVTV7605WCJS0","configure-helm","https:\u002F\u002Fgithub.com\u002FTight-Line\u002Fgatekeeper\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfigure-helm\u002FSKILL.md",[],[73,65,74],"helm","configure helm"]