Skip to main content

K8s Azure script

Kubernetes Protection Azure install script is the sample Azure user-script collection — GetAzureInstallScript. The path is GET /kubernetes-protection/entities/user-script/azure/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 static scripts (/kubernetes-protection/entities/gen/scripts/v1): K8s scripts. This is not Kubernetes Azure accounts (/kubernetes-protection/entities/accounts/azure/v1): K8s Azure. This is not Kubernetes Azure tenant config (/kubernetes-protection/entities/config/azure/v1): K8s Azure config. This is not Kubernetes Azure tenant IDs (/kubernetes-protection/entities/tenants/azure/v1): K8s Azure tenants. 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 Azure install script uses query params id and subscription_id, not FQL.

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 get the Azure install script (403). Unit tests use a client named cs-local-k8s with kubernetes-protection:read; that client can get the script. 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/user-script/azure/v1Get Azure install script. Query: id (required, Azure tenant id), subscription_id (optional).

Missing or empty id → 400. Unknown tenant → 404. When subscription_id is set and does not match the stored row → 404. When omitted, return the row for id only.

JSON is snake_case MSA: tenant_id, subscription_id, script. This slice returns JSON, not application/octet-stream.

This is not Kubernetes Helm values, Kubernetes static scripts, or Kubernetes Azure accounts. Kubernetes Helm values uses /kubernetes-protection/entities/integration/agent/v1: K8s helm. Kubernetes static scripts uses /kubernetes-protection/entities/gen/scripts/v1: K8s scripts. Kubernetes Azure accounts uses /kubernetes-protection/entities/accounts/azure/v1: K8s Azure. Kubernetes Azure tenant config uses /kubernetes-protection/entities/config/azure/v1: K8s Azure config. GetAzureTenantIDs uses /kubernetes-protection/entities/tenants/azure/v1: K8s Azure tenants. Remaining Kubernetes Protection mutations / Image assessment policies / remaining cloud are not implemented (not yet).

Seed scripts​

tenant_idsubscription_idscript contains
t-lab-1sub-lab-1t-lab-1
t-lab-2sub-lab-2t-lab-2

id=t-lab-1 returns that row. id=t-lab-2 returns that row.

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

id=t-lab-1 returns a script that contains t-lab-1:

curl -sS -H 'Host: crowdstrike-api.localhost' -b cookies.txt \
'http://127.0.0.1:8088/kubernetes-protection/entities/user-script/azure/v1?id=t-lab-1'

Missing id is 400:

curl -sS -o /dev/null -w '%{http_code}\n' \
-H 'Host: crowdstrike-api.localhost' -b cookies.txt \
'http://127.0.0.1:8088/kubernetes-protection/entities/user-script/azure/v1'

Unknown id is 404:

curl -sS -o /dev/null -w '%{http_code}\n' \
-H 'Host: crowdstrike-api.localhost' -b cookies.txt \
'http://127.0.0.1:8088/kubernetes-protection/entities/user-script/azure/v1?id=not-a-tenant'

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/user-script/azure/v1?id=t-lab-1'

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/user-script/azure/v1?id=t-lab-1'

Remaining Kubernetes Protection mutations / Image assessment policies / remaining cloud are not implemented (not yet). Kubernetes Helm values is a separate collection: K8s helm. Kubernetes static scripts is a separate collection: K8s scripts. Kubernetes Azure accounts is a separate collection: K8s Azure. Kubernetes Azure tenant config is a separate collection: K8s Azure config. Kubernetes Azure tenant IDs is a separate collection: K8s Azure tenants. This is not the HelloService template (GET /api/hello).

Get (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/user-script/azure/v1?id=t-lab-1'

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.