kubescape-operator
by Kubescape
Kubescape is an E2E Kubernetes cluster security platform
About this chart
Kubescape Operator
Kubescape operator documentation
Install
Warning: We only support installing this chart using Helm or ArgoCD. Using alternative installation methods, such as Kustomize, Helmfile or using custom scripts, may lead to unexpected behavior and issues. We cannot guarantee compatibility or provide support for deployments that are installed using methods other than Helm or ArgoCD.
When installing with ArgoCD or another GitOps controller that continuously re-renders Helm charts, set certificates.strategy=initContainer so the admission and storage certificates are generated and patched at runtime instead of during template rendering.
Migrating from
strategy: hook: Thehookstrategy was removed in favour ofinitContainer. Update your values fromcertificates.strategy: hooktocertificates.strategy: initContainer.
Run the install command:
helm repo add kubescape https://kubescape.github.io/helm-charts/ ; helm repo update ; helm upgrade --install kubescape kubescape/kubescape-operator -n kubescape --create-namespace --set clusterName=`kubectl config current-context`
Verify that the installation was successful:
$ kubectl get pods -n kubescape
kubescape kubescape-548d6b4577-qshb5 1/1 Running 0 60m
kubescape kubevuln-6779c9d74b-wfgqf 1/1 Running 0 60m
kubescape operator-5d745b5b84-ts7zq 1/1 Running 0 60m
kubescape storage-59567854fd-hg8n8 1/1 Running 0 60m
Live namespace filters
Set namespaceFilters.enabled: true to edit scanning and monitoring namespaces
through one ConfigMap without restarting components after each filter edit.
Leave namespaceFilters.existingConfigMap empty for chart-managed filters, or
reference a separately named ConfigMap in ksNamespace for external ownership.
See configuration, recovery, and ownership migration.
Offline daily reports
Setting capabilities.kubescapeOffline: enable forces
KS_SKIP_UPDATE_CHECK="true" on the Operator container, overriding entries with
that name in operator.env. This suppresses the Operator's daily report to
version-check.ks-services.co. Operator v0.2.181 includes
kubescape/operator#421;
the chart defaults to the newer compatible v0.2.188 release. If overriding the
image, use v0.2.181 or a later release containing that fix. Older images do not
honor this setting for daily reports.
Online installations retain their existing reporting behavior. To opt out
explicitly online, set KS_SKIP_UPDATE_CHECK=true through operator.env.
kubescape.skipUpdateCheck remains scoped to the Kubescape scanner.
See the published-image validation for a reproducible check of offline suppression and online reporting.
MCP endpoint for AI agents
Set storage.mcp.enabled: true to let AI agents in the cluster (for example Kagent) read Kubescape's results over MCP. Storage serves read-only tools at
POST /apis/spdx.softwarecomposition.kubescape.io/v1beta1/namespaces/<namespace>/mcpservers/default/mcp
The call goes through kube-apiserver with the agent's own token, and storage checks every read against the agent's RBAC, so an agent sees only what it may get or list. The chart creates two ClusterRoles to bind per namespace:
kubescape-mcp-reader: call the endpoint, read vulnerability manifests and configuration scanskubescape-mcp-runtime-reader: read container profiles and SBOMs (what containers run and every package in an image)
The tools depend on the storage version. The chart's default (v0.0.382) serves the vulnerability tools (list_vulnerability_manifests, list_vulnerabilities_in_manifest and list_vulnerability_matches_for_cve) and the SBOM tools (list_sboms and list_sbom_packages). The configuration-scan and container-profile tools come with later releases. The two roles already cover them, so the RoleBindings stay the same when storage is upgraded.
Image-level vulnerability manifests and SBOMs are stored in the Kubescape namespace, workload scans in the workload's namespace. For an agent with the ServiceAccount kagent/agent:
kubectl -n kagent create rolebinding kubescape-mcp --clusterrole=kubescape-mcp-reader --serviceaccount=kagent:agent
kubectl -n kubescape create rolebinding kubescape-mcp --clusterrole=kubescape-mcp-reader --serviceaccount=kagent:agent
Network policies
Warning: NetworkPolicies are now created by default (
global.networkPolicy.enabled: true). They only restrict ingress to the Kubescape pods, to the traffic between Kubescape's own components plus kube-apiserver and Prometheus. Egress stays open unlessglobal.networkPolicy.createEgressRulesis set. If a tool outside the chart calls a Kubescape pod directly, add your own NetworkPolicy for it or setglobal.networkPolicy.enabled=false. See Network policies for the exact rules and the opt-in egress rules.
Upgrade
helm upgrade updates everything in the chart except the CRDs under crds/. Helm installs those
once, on first install, and never touches them again.
So when a release changes a CRD schema, the cluster keeps the old one: the API server rejects fields it
does not know about under a strict apply, and silently prunes them otherwise.
If a release notes a CRD change, apply the chart's CRDs yourself before upgrading:
helm repo update
helm pull kubescape/kubescape-operator --untar --untardir /tmp
kubectl apply --server-side --force-conflicts -f /tmp/kubescape-operator/crds/
Then run the usual helm upgrade. Applying the CRDs is safe to repeat and does not touch existing
custom resources.
capabilities.riskAcceptance: theSecurityExceptionandClusterSecurityExceptionschemas grew per-vulnerabilityexpiresAt,actionStatement,response,subcomponents, and theaffectedstatus. Clusters that installed the chart before that change need the apply above, otherwise those fields are pruned or rejected.
The CRDs under templates/ (the node-agent sensing CRDs and seccompprofiles) are managed by Helm and
do upgrade on their own.
View results
The scanning results will be available gradually as the scans are completed.
View your configuration scan reports:
kubectl get workloadconfigurationscans -A
View your image vulnerabilities:
kubectl get vulnerabilitymanifests -A
Uninstall
You can uninstall this helm chart by running the following command:
helm uninstall kubescape -n kubescape
Then, delete the kubescape namespace:
kubectl delete ns kubescape
Adjusting Resource Usage for Your Cluster
By default, Kubescape is configured for small- to medium-sized clusters. If you have a larger cluster and you experience slowdowns or see Kubernetes evicting components, please revise the amount of resources allocated for the troubled component.
Taking Kubescape for example, we found that our defaults of 500 MiB of memory and 500m CPU work well for clusters up to 1250 total resources. If you have more total resources or experience resource pressure already, first check out how many resources are in your cluster by running the following command:
kubectl get all -A --no-headers | wc -l
The command should print an approximate count of resources in your cluster. Then, based on the number you see, allocate 100 MiB of memory for every 200 resources in your cluster over the count of 1250, but no less than 128 MiB total. The formula for memory is as follows:
MemoryLimit := max(128, 0.4 * YOUR_AMOUNT_OF_RESOURCES)
For example, if your cluster has 500 resources, a sensible memory limit would be:
kubescape:
resources:
limits:
memory: 200Mi # max(128, 0.4 * 500) == 200
If your cluster has 50 resources, we still recommend allocating at least 128 MiB of memory.
Regarding CPU, the more you allocate, the faster Kubescape will scan your cluster. This is especially true for clusters that have a large amount of resources. However, we recommend that you give Kubescape no less than 500m CPU no matter the size of your cluster so it can scan a relatively large amount of resources fast ;)
Chart support
Values
| Key | Type | Default | Description |
|---|---|---|---|
| namespaceFilters.enabled | bool | false | Reload namespace selection from one shared ConfigMap without restarting components after filter edits. |
| namespaceFilters.existingConfigMap | string | "" | External ConfigMap in ksNamespace with namespaceFilters.json; empty creates the chart-managed kubescape-namespace-filters. See the live-filter ownership migration guide above. |
| excludeControls | list | [] | Control IDs or legacy CIS section numbers omitted from every operator-triggered posture scan. Request exclusions are added to this list. |
| defaultFrameworks | list | [] | Install-time posture frameworks when a scan omits targetNames. Empty = operator legacy fallbacks. Clear with --set defaultFrameworks=null. |
| capabilities.agentRuntimePosture | string | "disable" | Grant the Kubescape scanner read-only access to the supported Agent Runtime resources: Sandbox, SandboxTemplate, and WorkerPool. |
| capabilities.sandboxSeccomp | string | "disable" | Experimental. Enforce the syscall rules of SandboxPolicy privilege sections with seccomp. Profiles are injected through NRI (containerd >= 2.2 or CRI-O >= 1.34) and apply when a container starts. Requires the SandboxPolicy CRDs and a node-agent release that includes the seccomp layer; older images ignore it. |
| global.networkPolicy.enabled | bool | true | Create ingress NetworkPolicies for all components. On by default, see Network policies |
| global.networkPolicy.createEgressRules | bool | false | Also restrict egress (DNS, kube-apiserver, proxy and the destinations each component needs) |
| global.networkPolicy.apiServerIP | string | "" | Pin the kube-apiserver egress rule to this IP |
| global.networkPolicy.apiServerPort | int | 443 | kube-apiserver port for the egress rules; the default/kubernetes endpoint ports are added when they can be looked up |
| global.kubescapePsp.enabled | bool | false | Enable all privileges in Pod Security Policies for Kubescape namespace |
| global.httpsProxy | string | "" | Set https egress proxy for all components. Must supply also port. |
| global.proxySecretFile | string | "" | Set proxy certificate / RootCA file content (not the file path) for all components to be used for proxy configured in global.httpsProxy |
| global.overrideDefaultCaCertificates.enabled | bool | false | Use to enable custom CA Certificates |
| global.overrideDefaultCaCertificates.caCertificates | string | "" | Set the custom CA Certificates file in all container |
| global.extraCaCertificates.enabled | bool | false | Use to enable mapping extra CA Certificate files |
| global.extraCaCertificates.secretName | bool | "" | Name of the secret that contents will be mapped to /etc/ssl/certs in each workload |
| certificates.strategy | string | "template" | Certificate management mode for the admission webhook and storage mTLS endpoints. Use template for standard Helm installs and initContainer for ArgoCD/GitOps-safe runtime certificate generation. |
| operator.admissionService | object | {} | DEPRECATED — use operator.admissionWebhooks.service.* instead. If set, takes precedence over the new path for backward compatibility. Will be removed in a future release. |
| customScheduling.affinity | yaml | Use the affinity sub-section to define affinity rules that will apply to all of the workloads managed by the kubescape-operator | |
| customScheduling.nodeSelector | yaml | Configure nodeSelector rules under the nodeSelector sub-section that will apply to all of the workloads managed by the kubescape-operator | |
| customScheduling.tolerations | yaml | Define tolerations in the tolerations sub-section that will apply to all of the workloads managed by the kubescape-operator | |
| global.overrideRuntimePath | string | "" | Override the runtime path for node-agent |
| global.apiAuth.enabled | bool | true | Require a service-account token (TokenReview) and an RBAC grant (SubjectAccessReview) on the in-cluster HTTP APIs of kubescape, kubevuln, synchronizer and the operator. The chart installs the RBAC, projected tokens for the callers and the env the servers read; the pinned images enforce the check. Set to false to turn the check off. On GKE Autopilot clusters that set nodeAgent.gke.allowlist.enabled=true with an allowlist that lacks the node-agent's projected token mount (nodeAgent.gke.allowlist.supportsApiToken=false, the case for the pinned armo-kubescape-node-agent-1.40-v2), the chart turns the check off by itself: the node-agent is rendered without the token mount, so GKE Warden keeps admitting it, and the servers get KS_API_AUTH_DISABLED=true |
| nodeAgent.gke.allowlist.supportsApiToken | bool | false | Whether nodeAgent.gke.allowlist.name includes the |
Deploy kubescape-operator with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubescape-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkubescape-operator is pinned at v1.42.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply