Files
rootnode-academy/scenarios/data/cks-automount-token.json
T
Abhinav Sinha 124e5276d4 refactor(scenarios): split monolithic configuration into individual files
- Split `scenarios/scenarios.json` into individual JSON files under `scenarios/data/` named `<scenario-id>.json`
- Split `scenarios/bundles.json` into individual JSON files under `scenarios/bundles/` named `<bundle-id>.json`
- Updated `backend/server.js` to dynamically load scenario and bundle files from their respective directories
- Updated documentation in `scenarios/SCHEMA.md` and `README.md` to reflect the new repository layout and contributor workflow

Signed-off-by: Abhinav Sinha <[email protected]>
2026-06-15 07:52:47 +05:30

34 lines
1.5 KiB
JSON

{
"id": "cks-automount-token",
"title": "Disable ServiceAccount Token",
"category": "Workload Security",
"difficulty": "Easy",
"type": "task",
"weight": 3,
"description": "## Service Account Tokens\n\nBy default, Kubernetes automatically mounts a ServiceAccount API token into every Pod, which can be a significant security risk if the Pod is compromised.\n\n**Your task:**\n\nCreate a Pod named `no-token-pod` using the `alpine` image (with command `sleep 3600`). Explicitly disable the automatic mounting of the ServiceAccount token for this pod.\n\n```bash\n# Verify token is not mounted:\nkubectl get pod no-token-pod -o yaml | grep automount\n```",
"hints": [
{
"title": "automountServiceAccountToken",
"body": "Set `automountServiceAccountToken: false` in the pod's spec.",
"command": "cat <<EOF | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n name: no-token-pod\nspec:\n automountServiceAccountToken: false\n containers:\n - name: app\n image: alpine\n command: [\"sleep\", \"3600\"]\nEOF"
}
],
"setup_commands": [],
"validation": {
"commands": [
{
"description": "automountServiceAccountToken is false",
"command": "kubectl get pod no-token-pod -o jsonpath='{.spec.automountServiceAccountToken}'",
"expected_output": "false",
"match": "exact"
}
]
},
"default_namespace": "default",
"teardown_commands": [
{
"command": "kubectl delete pod no-token-pod --ignore-not-found --grace-period=0 --force"
}
]
}