/security-tooling-skills:kubewarden-admission-policy-configurationfrom security-tooling-skills
Guides configuring Kubewarden as a WASM-based Kubernetes admission policy engine — installing policy-server and controller, writing or reusing WebAssembly policies from the Kubewarden Policy Hub, managing ClusterAdmissionPolicy/AdmissionPolicy resources, and using monitor-mode rollout before enforcement.
Ships in security-tooling-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Kubewarden is a Kubernetes admission policy engine, like OPA/Gatekeeper
and Kyverno, but its policies are compiled WebAssembly (WASM)
modules rather than Rego or pattern-matching YAML — which means a
policy can be authored in whatever language has a Kubewarden SDK (Rust,
Go, Rego-via-a-WASM-compiled-OPA-policy, and others), compiled once, and
distributed as an OCI artifact pulled from a registry exactly like a
container image. This makes Kubewarden's core value proposition
language flexibility plus a shared distribution mechanism: a team
that already writes Go or Rust doesn't have to learn Rego to write a
custom admission policy, and policies can be versioned, signed, and
pulled from an OCI registry the same way container images already are.
This skill covers installing Kubewarden's policy-server and
controller, writing or reusing a WASM policy (including pulling
pre-built ones from the community Kubewarden Policy Hub instead of
writing one from scratch), the ClusterAdmissionPolicy/AdmissionPolicy
CRDs, monitor-mode rollout before enforcing, and — critically — where
Kubewarden fits relative to
opa-gatekeeper-policy-authoring
and
kyverno-policy-management,
which solve the same admission-control problem with different authoring
and distribution models.
ClusterAdmissionPolicy safely — starting
in monitor mode and reviewing before switching to protect
(Kubewarden's enforce mode).AdmissionRequest payload a WASM policy receives.sigstore/cosign
integration) so only trusted, signed policy artifacts are pulled and
run.kubewarden-controller, and one or
more policy-server Deployments (the component that actually loads
and executes WASM policies against admission requests).kubewarden-crds, kubewarden-controller, kubewarden-defaults) —
confirm the installed chart/CRD version's ClusterAdmissionPolicy
API version (policies.kubewarden.io/v1) since field names have
evolved across Kubewarden's early releases.registry://ghcr.io/kubewarden/policies/...) that policy-server
pulls directly.policy-sdk-rust, policy-sdk-go, or writing Rego compiled
via opa build -t wasm), plus that language's WASM build toolchain
(cargo with the wasm32-wasi target for Rust, or the Go WASM/TinyGo
toolchain for Go).kwctl (Kubewarden's CLI) for building, running, and testing a policy
locally against sample AdmissionRequest JSON before ever deploying
it to a cluster — this is Kubewarden's equivalent of opa eval/gator test for offline policy testing.ClusterAdmissionPolicy should
be applied with mode: monitor first, not protect — identical
discipline in spirit to Gatekeeper's dryrun and Kyverno's Audit,
and for the same reason.cosign
and a configured VerificationConfig so policy-server refuses to
load an unsigned or wrongly-signed policy artifact.Install Kubewarden's controller and a policy-server via Helm:
helm repo add kubewarden https://charts.kubewarden.io
helm repo update
helm install kubewarden-crds kubewarden/kubewarden-crds -n kubewarden --create-namespace
helm install kubewarden-controller kubewarden/kubewarden-controller -n kubewarden
helm install kubewarden-defaults kubewarden/kubewarden-defaults -n kubewarden
kubectl get pods -n kubewarden # controller + policy-server Running
Reuse a vetted policy from the Kubewarden Policy Hub rather than authoring one from scratch, for common cases (pod security standard checks, registry allowlisting, resource-limit requirements):
apiVersion: policies.kubewarden.io/v1
kind: ClusterAdmissionPolicy
metadata:
name: allowed-registries
spec:
module: registry://ghcr.io/kubewarden/policies/trusted-repos:v0.2.0
mode: monitor # start here — never `protect` on first rollout
rules:
- apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
operations: ["CREATE", "UPDATE"]
settings:
reject_configmap_authorities: false
constrained_labels: []
registries:
- "registry.example.internal/"
The module field is an OCI reference exactly like a container
image pull — Kubewarden's policy distribution model deliberately
mirrors container image distribution, including support for
registries with authentication and signature verification.
Author a custom policy when Policy Hub doesn't cover the need,
using a language SDK rather than Rego, if the team prefers a
general-purpose language. Rust example (policy-sdk-rust, validating
a required label):
use kubewarden_policy_sdk::{
accept_request, reject_request, request::ValidationRequest,
validate_settings,
};
fn validate(payload: &[u8]) -> CallResult {
let validation_request: ValidationRequest<Settings> =
ValidationRequest::new(payload)?;
let pod = validation_request.request.object;
if pod.metadata.labels.get("team").is_none() {
return reject_request(
Some("pods must have a 'team' label".to_string()),
None, None, None,
);
}
accept_request()
}
cargo build --target=wasm32-wasi --release
kwctl run target/wasm32-wasi/release/policy.wasm \
-r sample-admission-request.json
kwctl run evaluates the compiled WASM module against a sample
AdmissionRequest payload offline — always test this way before
deploying, the same way opa eval/gator test are used for Rego
policies.
Inspect the actual AdmissionRequest payload a policy receives
before assuming a field path, exactly as with Rego/Kyverno policies —
this is a general admission-controller pitfall, not
Kubewarden-specific:
kubectl create --dry-run=server -o json -f pod.yaml > sample-request.json
kwctl run policy.wasm -r sample-request.json --execution-mode wasi
Deploy in monitor mode and review before switching to
protect:
kubectl apply -f allowed-registries-policy.yaml # mode: monitor
kubectl get clusteradmissionpolicy allowed-registries -o yaml \
| grep -A5 "status:"
Kubewarden's monitor mode logs what would have been rejected
(visible in policy-server's logs / an observability pipeline) but
admits every request regardless, exactly like Gatekeeper's dryrun
and Kyverno's Audit — review this output for at least one full
deploy cycle before promoting.
Switch to protect (Kubewarden's enforce mode) once monitor is
clean, with narrowly-scoped, documented exceptions:
spec:
mode: protect
rules:
- apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
operations: ["CREATE", "UPDATE"]
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: NotIn
values: ["kube-system", "legacy-migration"] # owner: platform-team, review: 2026-10-15
Warning — destructive action risk: switching
modetoprotecton a broadly-scopedClusterAdmissionPolicyblocks every matching admission cluster-wide the instant it's applied — identical blast-radius risk to Gatekeeper'sdenyor Kyverno'sEnforce. Confirm the monitor-mode review period covered representative traffic (including infrequent workflows) and that a fast rollback (kubectl patch clusteradmissionpolicy <name> --type merge -p '{"spec":{"mode":"monitor"}}') is understood by on-call before enforcing against production namespaces.
Configure policy signature verification so policy-server only
loads artifacts signed by a trusted key, especially for anything
pulled from a public registry rather than an internal one:
# policy-server VerificationConfig (illustrative)
allOf:
- kind: pubKey
owner: [email protected]
key: |
-----BEGIN PUBLIC KEY-----
<BASE64_PUBLIC_KEY_MATERIAL>
-----END PUBLIC KEY-----
Reject any policy pull that fails verification rather than logging a warning and loading it anyway — an unsigned or wrongly-signed policy artifact silently running in the admission path is a supply-chain risk equivalent to running an unverified container image.
Watch policy-server availability as an admission-path
dependency, the same operational concern as any admission
webhook — Kubewarden's webhook failurePolicy (configured via the
ClusterAdmissionPolicy's underlying webhook object) determines
whether a policy-server outage blocks or allows admission
cluster-wide:
spec:
failurePolicy: Fail # or Ignore — choose deliberately per policy criticality
As with Gatekeeper/Kyverno, Fail on a broadly-scoped policy plus a
policy-server outage blocks all matching admission, including
unrelated emergency deploys — monitor policy-server health and keep
a fast rollback path ready.
mutate/generate rules, not just validate.kwctl run against sample
AdmissionRequest JSON before deploying — this catches the same class
of field-path/schema bugs that make a Rego or Kyverno policy silently
never fire.monitor → review → protect, never straight to
protect, mirroring the Gatekeeper/Kyverno audit-first discipline
exactly.cosign/sigstore) for anything
pulled from a registry outside direct organizational control — an
admission policy is code that runs on every matching request, and an
unverified WASM artifact is a supply-chain attack surface exactly like
an unverified container image.policy-server health as a monitored admission-path dependency,
and choose failurePolicy per policy criticality with a documented,
fast rollback path — not a default nobody has thought about.Symptom: A new ClusterAdmissionPolicy is deployed directly with
mode: protect and immediately rejects a legitimate deployment,
paging on-call.
Fix: Always deploy new/changed policies with mode: monitor
first, review policy-server logs for what would have been rejected
over a representative period, then switch to protect with
documented namespace exceptions for anything legitimate monitor mode
surfaced.
Symptom: A custom WASM policy loads successfully and the
ClusterAdmissionPolicy shows ready, but it never rejects a resource
that obviously should violate it.
Fix: Test with kwctl run against the actual AdmissionRequest
JSON shape (step 4) rather than assuming the field path — this is the
same "policy compiles but the field path assumption is wrong" bug
common to Rego and Kyverno pattern-matching, just manifesting in
whatever language the WASM policy was authored in.
Symptom: A policy pulled from a public registry behaves
unexpectedly after the maintainer pushes an update to the same tag,
and nobody signed off on the change.
Fix: Pin module references to an immutable digest
(registry://.../policy@sha256:...) rather than a mutable tag, and
configure signature verification (step 7) so only artifacts signed by
a trusted key are loaded — treat an unpinned, unverified policy
reference the same as an unpinned, unverified base image in a
Dockerfile.
Symptom: A policy-server outage combined with
failurePolicy: Fail on a broadly-scoped policy blocks every deploy
cluster-wide, including an unrelated emergency hotfix, during an
incident.
Fix: Treat policy-server health as a monitored, alertable
dependency of cluster admission, and keep a documented, fast rollback
path (patching the policy's mode back to monitor, or in a genuine
emergency, patching the webhook's failurePolicy to Ignore
temporarily) that on-call can execute without deep Kubewarden
expertise under pressure.
Symptom: A team picks Kubewarden specifically to avoid Rego, then ends up writing a WASM policy that's harder for the rest of the platform team to review and maintain than a Rego or Kyverno equivalent would have been. Fix: Kubewarden's language flexibility is a benefit only when the team authoring and reviewing the policy shares that language fluency — if the platform team standardizes on Rego for review purposes, writing custom Kubewarden policies in an unfamiliar language just shifts the maintenance burden rather than reducing it. Reserve custom WASM authoring for cases where the language fit is genuinely better across the whole reviewing team, not just the original author.
Scenario: A platform team wants to require all Pod images come
from an approved internal registry, reusing a Kubewarden Policy Hub
policy, rolled out safely via monitor mode.
apiVersion: policies.kubewarden.io/v1
kind: ClusterAdmissionPolicy
metadata:
name: require-approved-registry
spec:
module: registry://ghcr.io/kubewarden/policies/trusted-repos@sha256:8f2a1c9b7e4d... # pinned digest
mode: monitor
failurePolicy: Fail
rules:
- apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
operations: ["CREATE"]
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: NotIn
values: ["kube-system"]
settings:
registries:
- "registry.example.internal/"
Offline test before deploying, against a sample disallowed-image request:
kubectl create --dry-run=server -o json -f pod-using-dockerhub.yaml > sample-request.json
kwctl run policy.wasm -r sample-request.json --settings-json \
'{"registries": ["registry.example.internal/"]}'
{"allowed":false,"status":{"message":"image docker.io/library/nginx:latest is not from an approved registry"}}
Deploy in monitor mode, review for one week:
kubectl apply -f require-approved-registry.yaml
kubectl logs -n kubewarden -l app=kubewarden-policy-server --since=168h \
| jq -c 'select(.policy_id == "require-approved-registry" and .response.allowed == false)'
After a clean week showing only expected/known non-compliant test traffic (no legitimate workload flagged), the team promotes:
kubectl patch clusteradmissionpolicy require-approved-registry \
--type merge -p '{"spec":{"mode":"protect"}}'
From then on, kubectl apply -f pod-using-dockerhub.yaml is rejected at
admission time, and the pinned digest reference means the policy's
behavior can't change underneath the team without a deliberate,
reviewed update to the module field.
mutate/generate
use cases Kubewarden doesn't target as directly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Kubernetes, Rust, Go, Docker
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin security-tooling-skills15 skills in this plugin
/certificate-lifecycle-management-at-scaleGuides managing TLS/mTLS certificate lifecycle across many services and environments beyond a single Kubernetes cluster — enterprise CA integration (ACME private CA, Microsoft AD CS, cloud-managed private CAs), cross-service rotation automation, expiry monitoring/alerting, and CA hierarchy/trust-chain management for a mixed fleet of VMs, on-prem servers, and multiple clusters. Use when the user asks to "automate cert rotation across our whole fleet," "integrate with our enterprise CA," "why do we keep having certificate expiry outages," "design a CA hierarchy for the org," "track every certificate's expiry date across environments," or "cert-manager only covers our Kubernetes clusters, what about everything else." Distinct from cert-manager's Kubernetes-native scope — see `../../../kubernetes-platform/skills/cert-manager-tls-automation/SKILL.md`.
/enterprise-sso-and-idp-federation-configurationGuides configuring enterprise workforce single sign-on — SAML 2.0 and OIDC federation between an identity provider (Okta, Azure AD/Entra ID, Keycloak) and downstream applications, including metadata exchange, attribute/claim mapping, group-to-role provisioning (SCIM), and multi-IdP federation trust. Use when the user asks to "set up SAML SSO with Okta," "configure Azure AD/Entra ID as our OIDC provider," "stand up Keycloak as an internal IdP," "map IdP groups to application roles," "debug a SAML assertion that won't validate," or "federate a second IdP for an acquired company's users." Distinct from cloud-iam-hardening (workload/service IAM in a cloud provider) — this skill is about federating *human workforce* identity into applications for SSO.
/falco-configuration-validationValidates Falco runtime detection rules for false-positive rate and actual firing correctness before trusting them in a channel that pages a human — running new/changed rules in log-only mode against real traffic, measuring alert volume and content, and confirming a rule fires on a deliberate positive-control trigger before promoting it to a higher-severity, paging-routed configuration. Use when the user asks to "validate this Falco rule before enabling it," "why is Falco so noisy," "test our Falco rules don't false-positive on real traffic," "review this rule set before it pages on-call," or "make sure Falco rules aren't about to be enabled in enforce/blocking mode without an audit period." Pairs with falco-runtime-threat-detection-configuration.
/falco-runtime-threat-detection-configurationGuides authoring and deploying Falco runtime threat detection rules — the eBPF/kernel-module-based syscall event stream, Falco's rule syntax (condition/output/priority), writing custom rules for a specific workload's known-good behavior, tuning noisy default rules, and wiring alerts to Falcosidekick outputs. Use when the user asks to "write a Falco rule to detect X," "why is Falco alerting on normal behavior," "detect a shell spawned inside a container at runtime," "set up Falco with eBPF instead of the kernel module," "send Falco alerts to Slack/PagerDuty," or "what's the difference between Falco and admission-control policy engines like OPA/Kyverno." Pairs with falco-configuration-validation for pre-enforcement false-positive testing.
/fortify-static-analysisGuides deep, tool-specific use of OpenText (formerly Micro Focus) Fortify Static Code Analyzer (SCA) and Fortify Audit Workbench for enterprise, on-premises static analysis — the translate/scan build workflow, Fortify Security Rulepacks, audit workbench triage (Not an Issue / Reliability / Suspicious), and how Fortify's on-prem, build-integrated model differs operationally from cloud-native SAST. Use when the user asks to "run a Fortify scan", "configure sourceanalyzer for a build", "triage findings in Fortify Audit Workbench", "integrate Fortify with Jenkins/Azure DevOps", "reduce Fortify SCA false positives", or "compare Fortify against SonarQube/Semgrep for enterprise compliance". Fortify-specific depth on the translate/scan model and enterprise workflow; for the general SAST concept see sast-integration in the devsecops domain.
/owasp-zap-dast-configurationGuides deep, tool-specific configuration of OWASP ZAP (Zed Attack Proxy) for automated dynamic scanning — baseline vs. full active scan selection, the ZAP Automation Framework YAML plan, authenticated scanning via authentication scripts/contexts, and API-driven scans seeded from an OpenAPI spec. Use when the user asks to "configure a ZAP automation framework plan", "write a ZAP context file for authenticated scanning", "tune ZAP alert thresholds", "run zap-baseline vs zap-full-scan", "script ZAP login for a scan", or "seed a ZAP scan from an OpenAPI/Swagger spec". ZAP-specific depth on scan types, automation YAML, and auth scripting; for the general DAST concept and tool-agnostic workflow see dast-integration in the devsecops domain.
Other plugins' skills for the same job