Repository navigation
fix(cs2): SRCDS_TOKEN is a credential — store it in a Secret, not the CR - #24
Merged
Merged
Conversation
SRCDS_TOKEN is a Steam Game Server Login Token. It was declared type: string, so its value would be stored in PLAINTEXT in the GameServer CR — visible in 'kubectl get gameserver -o yaml', in etcd, and to anyone with read access to the resource. type: password makes the operator store it in a per-GameServer Secret and inject it via SecretKeyRef, so it never lands inline in the CR or the pod spec. The Create wizard already renders password fields as masked inputs, so the token is now supplied safely at creation time — which is what CS2 needs to launch at all. Adds a validator rule (credential-field-must-be-password) for the class: any credential-shaped config field name (PASSWORD/TOKEN/SECRET/APIKEY/ GSLT/...) that isn't type: password is an ERROR. bool/int fields are skipped — a flag named SERVER_PASSWORD_ENABLED is not a credential. Every other module already got this right; cs2 was the only leak. Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
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.
SRCDS_TOKENis a Steam Game Server Login Token — a real credential. It was declaredtype: string, so its value would be stored in plaintext in the GameServer CR: visible inkubectl get gameserver -o yaml, in etcd, and to anyone with read access to the resource.type: passwordmakes the operator store it in a per-GameServer Secret and inject it viaSecretKeyRef, so it never lands inline in the CR or the pod spec. The Create wizard already renders password fields as masked inputs — so the token is now supplied safely at creation time, which is exactly what CS2 needs to launch at all.New validator rule:
credential-field-must-be-passwordAny credential-shaped config field name (
PASSWORD/TOKEN/SECRET/APIKEY/AUTHKEY/GSLT/…) that isn'ttype: passwordis an ERROR.bool/intfields are skipped — a flag namedSERVER_PASSWORD_ENABLEDis not a credential.Every other module already got this right (ARK, Valheim, Palworld, Project Zomboid, Terraria, Factorio, Garry's Mod, Don't Starve all correctly type their credentials as
password). CS2 was the only leak — now it can't recur.