Skip to main content

K8s scripts

Kubernetes static scripts is the registration-script-list collection for this CID — GetStaticScripts. The path is GET /kubernetes-protection/entities/gen/scripts/v1. Remaining Kubernetes Protection mutations / Image assessment policies / remaining cloud are not implemented (not yet). This is not Kubernetes Helm values (/kubernetes-protection/entities/integration/agent/v1): K8s helm. This is not Kubernetes Azure install script (/kubernetes-protection/entities/user-script/azure/v1): K8s Azure script. This is not Kubernetes deployments (/container-security/combined/deployments/v1): K8s deployments. This is not Kubernetes clusters (/kubernetes-protection/entities/kubernetes/clusters/v1): Kubernetes. This is not the HelloService template sample (GET /api/hello).

This collection is not CrowdStrike production. It does not call Falcon cloud. It is not CrowdStrike Kubernetes Protection cloud.

RPC field notes: KubernetesProtectionService. REST schemas: API reference. Kubernetes static scripts have no query params and do not use FQL (unlike Kubernetes deployments). Extra unused query keys are ignored.

These curls use Host: crowdstrike-api.localhost against Compose Traefik on :8088. If the hostname already resolves to Traefik, you can omit the Host header and call http://crowdstrike-api.localhost instead.

Auth​

Every call needs a console session or a Bearer token:

  • Cookie cs_console from CreateSession (POST /identity/entities/sessions/v1)
  • Authorization: Bearer with kubernetes-protection:read

A session cookie bypasses OAuth scopes. Seed client cs-local-hosts (hosts:read only) cannot list scripts (403). Unit tests use a client named cs-local-k8s with kubernetes-protection:read; that client can list scripts. It is not in the production seed. Use the console cookie, or a client you created with that scope. Missing or revoked token → 401.

HTTP paths​

MethodPathUse
GET/kubernetes-protection/entities/gen/scripts/v1List static scripts. No query params.

JSON is snake_case MSA: script_id, script_name, content. This slice returns JSON, not application/octet-stream.

This is not Kubernetes Helm values, Kubernetes deployments, or Kubernetes clusters. Kubernetes Helm values uses /kubernetes-protection/entities/integration/agent/v1: K8s helm. Kubernetes deployments uses /container-security/combined/deployments/v1: K8s deployments. Kubernetes clusters uses /kubernetes-protection/entities/kubernetes/clusters/v1: Kubernetes. Kubernetes Azure install script uses /kubernetes-protection/entities/user-script/azure/v1: K8s Azure script. Remaining Kubernetes Protection mutations / Image assessment policies / remaining cloud are not implemented (not yet).

Seed scripts​

script_idscript_namecontent contains
script-lab-1bootstrap.shcid-local-1 and bootstrap
script-lab-2cleanup.shcid-local-1 and cleanup

cid is cid-local-1. The list returns both rows. There is no filter.

curl -sS -c cookies.txt -H 'Host: crowdstrike-api.localhost' \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","password":"FalconLocal!1","cloud":"us-1"}' \
http://127.0.0.1:8088/identity/entities/sessions/v1

The list returns at least the two seed ids, including script-lab-1 (bootstrap.sh):

curl -sS -H 'Host: crowdstrike-api.localhost' -b cookies.txt \
'http://127.0.0.1:8088/kubernetes-protection/entities/gen/scripts/v1'

No cookie and no Bearer is 401:

curl -sS -o /dev/null -w '%{http_code}\n' \
-H 'Host: crowdstrike-api.localhost' \
'http://127.0.0.1:8088/kubernetes-protection/entities/gen/scripts/v1'

cs-local-hosts (hosts:read only) is 403:

TOKEN='<access_token from cs-local-hosts>'
curl -sS -o /dev/null -w '%{http_code}\n' \
-H 'Host: crowdstrike-api.localhost' \
-H "Authorization: Bearer ${TOKEN}" \
'http://127.0.0.1:8088/kubernetes-protection/entities/gen/scripts/v1'

Remaining Kubernetes Protection mutations / Image assessment policies / remaining cloud are not implemented (not yet). Kubernetes Helm values is a separate collection: K8s helm. Kubernetes Azure install script is a separate collection: K8s Azure script. Kubernetes deployments is a separate collection: K8s deployments. Kubernetes clusters is a separate collection: Kubernetes. This is not the HelloService template (GET /api/hello).

List (Bearer)​

TOKEN='<access_token from a client with kubernetes-protection:read>'
curl -sS -H 'Host: crowdstrike-api.localhost' \
-H "Authorization: Bearer ${TOKEN}" \
'http://127.0.0.1:8088/kubernetes-protection/entities/gen/scripts/v1'

kubernetes-protection:read → 200 (including unit-test client cs-local-k8s). A token without that scope (including hosts:read only, e.g. cs-local-hosts) → 403. Missing or revoked token → 401. There is no seeded production client with kubernetes-protection:read — use the console cookie, or a client you created with that scope.

OAuth2 mint/revoke: OAuth2. Accessible scopes: API clients.