Repository navigation
feat(auth): support overlapping proxy secret rotation - #2
Closed
julianknutsen wants to merge 2 commits into
Closed
julianknutsen wants to merge 2 commits into
julianknutsen wants to merge 2 commits into
Conversation
added 2 commits
July 15, 2026 23:25
Accept a distinct previous value during attended rotations while keeping the current value mandatory and the middleware fail-closed. Tighten the production artifact guard and prevent image publication before verification succeeds.
Run auth verification for ordinary pull requests without secrets or write credentials. Replace inherited pull_request_target AI reviewers with visibly disabled manual stubs until a separately reviewed isolation design exists.
Author
|
Superseded by #4, the security rebase of This PR's content is carried forward there, with credit to this PR:
Rotating with the previous-secret overlap window is now required after the 2.42 deploy, because #4 fixes a leak of the shared secret into request logs. This PR is what makes that rotation mismatch-free. The 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a bounded current-plus-previous acceptance window for rotating the HyperDX proxy-auth shared secret without mismatching old and new Caddy injectors during convergence.
PROXY_AUTH_SHARED_SECRET_PREVIOUSPROXY_AUTH_SHARED_SECRETmandatory whenever proxy auth is enabledpull_requestauth quality gate for the Gas City branchpull_request_targetAI reviewers with permissionless, manual-only disabled stubsSecurity properties
crypto.timingSafeEqual, with a length check to avoid unequal-length exceptions.Verification
TDD RED before implementation: 5 expected failures in the two focused suites.
Focused proxy-auth/config Jest after review fixes: 27/27 passed.
API ESLint: passed.
API TypeScript
tsc --noEmit: passed.API production build and exact compiled production-symbol checks: passed.
make ci-lint: all 4 projects passed.make ci-unit: CLI 8 passed; common-utils 1,169 passed; app 1,752 passed with 9 existing skips.actionlint, YAML parse, lint-staged, staged credential-pattern scan, andgit diff --check: passed.Independent security/correctness review: approved after non-vacuous parsing tests, retirement coverage, restart documentation, and the verify-before-build dependency were added.
Exact local
gascity-prcommand path: immutable install, API lint, API typecheck, focused Jest 27/27, production build, and all compiled-symbol guards passed.Final independent GHA threat review: approved; no PR-triggered secret path, write/comment path, mutable privileged checkout, or publish capability remains.
How to test on Vercel preview
N/A — non-UI change.
Deployment ordering — STOP-gated
Hard dependency: gascity/infra#1232 must be merged and deployed on every identity Caddy node first. Before introducing any fresh credential, prove each effective Caddy
ExecStartomits--environand complete the prerequisite canaries. A merge alone is not sufficient.After that prerequisite is live, use an attended rollout:
The values are captured at module load, so changing the Kubernetes Secret alone does not update a running API process.
Availability boundary
The current HyperDX deployment is one replica with
Recreate. Its embedded alert scheduler has no proven leader election, so overlapping API replicas are not currently safe. The API replacement in step 3 and the retirement replacement in step 6 each cause a bounded interruption. Dual-secret acceptance prevents credential mismatch during Caddy convergence; it does not make those two API restarts zero-downtime.Rollback
ExecStartcontaining--environ.This PR performs code, documentation, and CI workflow changes only. It does not mutate OpenBao, Kubernetes, Caddy, Cloudflare, GHCR tags, or any live system.