fix: use dedicated secret for offline match auth instead of node name#8
Open
fix: use dedicated secret for offline match auth instead of node name#8
Conversation
Read OFFLINE_MATCHES_PASSWORD env var for basic auth, falling back to NODE_NAME for backwards compatibility. NODE_NAME is publicly known from K8s pod names and should not be used as a credential. To complete the fix, set OFFLINE_MATCHES_PASSWORD in the DaemonSet environment (e.g., from a K8s Secret). Closes 5stackgg/5stack-panel#409
The as string cast should apply to the entire fallback expression, not just process.env.NODE_NAME.
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
Offline match endpoint basic auth now reads
OFFLINE_MATCHES_PASSWORDenv var instead of usingNODE_NAMEas the password. Falls back toNODE_NAMEfor backwards compatibility.Why:
NODE_NAMEis publicly visible from Kubernetes pod names and should not be used as an authentication credential.Follow-up needed: Set
OFFLINE_MATCHES_PASSWORDin the DaemonSet environment from a K8s Secret. Until then, the fallback toNODE_NAMEmaintains existing behavior.Test plan
OFFLINE_MATCHES_PASSWORDset: auth still works with node name (backwards compatible)OFFLINE_MATCHES_PASSWORDset: auth uses the dedicated passwordCloses 5stackgg/5stack-panel#409