Skip to content

Commit 397d18d

Browse files
committed
fix(security): hardcoded default k3s token enables unauthorized c
A static token (`mytoken`) is embedded as the default K3s join secret. If this value is used in real deployments, any party that can reach the control plane and knows this predictable token may join rogue nodes or impersonate legitimate ones. Affected files: constants.py Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
1 parent 7808630 commit 397d18d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sky/ssh_node_pools/constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
NODE_POOLS_KEY_DIR = os.path.expanduser('~/.sky/ssh_keys')
99
DEFAULT_SSH_NODE_POOLS_PATH = os.path.expanduser('~/.sky/ssh_node_pools.yaml')
1010

11-
# TODO (kyuds): make this configurable?
12-
K3S_TOKEN = 'mytoken' # Any string can be used as the token
11+
K3S_TOKEN = os.environ.get('SKYPILOT_K3S_TOKEN')
12+
if not K3S_TOKEN:
13+
raise ValueError('SKYPILOT_K3S_TOKEN must be set for SSH node pools.')

0 commit comments

Comments
 (0)