Repository navigation
feat(config): warn at boot when a secret falls back to the service token - #445
Merged
Merged
Conversation
Contributor
Author
|
Updated per review: the fallback stays as a warning in v0.19, now marked deprecated in the warning, the configuration and production docs, and the changeset. Removal, with each secret required whenever its feature is in use, is #447 (v0.20), which also lists the deployment configs to update first. |
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.
Closes #432. Part of the v0.19 release (#385).
What
assertServiceTokenConfig(already the first boot step) logs one warning naming each ofREFRESH_TOKEN_LOOKUP_SECRET,TOTP_SECRET_ENCRYPTION_KEY,OAUTH_STATE_SECRETandDECOY_SUBJECT_SECRETthat is unset and so falls back to the service token, with what rotating the service token would then breakdocs/production-operations.mdgains a section on separating them safely: set each to the current service token value, redeploy, then rotate the service tokenDeviation from the issue
The issue asked to refuse to boot in production while the TOTP key falls back. I did not, on purpose:
TOTP_SECRET_ENCRYPTION_KEY, makes every stored TOTP secret unreadable, which is the lockout the issue wants to preventEach of the four fallbacks uses the service token's raw value exactly as it would its own variable (checked in
token.ts,totpService.ts,oauthService.ts,decoyPrincipal.ts), so setting them to the current value first is a no-op and the separation is safe. A warning plus that procedure gets to the same end without stranding anyone. If you still want a production refusal, it belongs in a later release once the warning has been out long enough for operators to act.The health endpoint flag is left out of this PR to avoid colliding with #444, which reshapes the same response.
Checks
npm run typecheck: passnpm run lint: passnpm run format:check: passnpm run coverage: 136 files, 1815 passed, 1 todo. Statements 98.9%, branches 95.38%, functions 99.27%, lines 99.14%