Skip to content

fix(cs2): SRCDS_TOKEN is a credential — store it in a Secret, not the CR - #24

Merged
ValgulNecron merged 1 commit into
mainfrom
fix/cs2-token-secret
Jul 14, 2026
Merged

ValgulNecron merged 1 commit into
mainfrom
fix/cs2-token-secret

Conversation

@ValgulNecron

Copy link
Copy Markdown
Collaborator

SRCDS_TOKEN is a Steam Game Server Login Token — a real credential. 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 exactly what CS2 needs to launch at all.

New validator rule: credential-field-must-be-password

Any credential-shaped config field name (PASSWORD/TOKEN/SECRET/APIKEY/AUTHKEY/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 (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.

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>
@ValgulNecron
ValgulNecron merged commit 0f62e31 into main Jul 14, 2026
@ValgulNecron
ValgulNecron deleted the fix/cs2-token-secret branch July 14, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant