Skip to main content

Synopsis

Read-only views over the broker’s workload security profiles. A profile is keyed by workload (namespace/kind/name), not by pod. It joins what kguardian observed: Pod Security Standards checks against the reported securityContext, network peers and audit verdicts, syscalls and any SeccompProfile CR, running image digests, and compute settings.
kind is case-sensitive and is the owning workload’s kind: Deployment, StatefulSet, DaemonSet, CronJob, Job, or Pod for a pod with no owner. A ReplicaSet’s pods are profiled under their Deployment.
unknown is not a pass. When kguardian has no data for a dimension, or the source is not configured (vulnerability scanning, signatures), its status is unknown, and a readiness check it cannot evaluate prints can't tell. There is no numeric score: status is a tier (ok, warn, risk, unknown) derived from findings. Posture is ok only when all four core dimensions are known and ok, and images stay unknown until vulnerability data exists, so today no workload reads ok. Always read the status with its coverage.

profile get

Calls GET /workloads/{namespace}/{kind}/{name}/profile, which the broker computes live.
  • Posture is ok only when all four core dimensions (network, syscalls, podSecurity, images) are known and ok. Otherwise it is the worst known warn or risk, and unknown when nothing known is worse than ok. Coverage is how many of the four kguardian knows. Compute is informational and outside the rollup. Each dimension that is not ok gets a one-line reason under the posture.
  • images stays unknown until a vulnerability source exists. Running digests, mixed rollouts, crash loops and pull failures are still reported as inventory facts and findings; they are not a verdict on the image.
  • PSS level “at most restricted” means every check kguardian can evaluate passes, but volumes, host ports, AppArmor, SELinux, procMount and sysctls are not reported to kguardian and could still fail. That is why podSecurity is unknown there rather than ok, and why podSecurityRestricted prints can't tell. A privileged level is risk; baseline is at least warn.
  • A container that was renamed or removed from the spec prints as a Stale line and is left out of the level, the findings and the patch.
  • When the broker has a patch to recommend, the output ends with the profile export command that prints it.
-o json and -o yaml print the broker’s response unchanged, including every finding, per-container securityContext, network peer and the recommendation.

profile list

Calls GET /workloads. Rows come from the broker’s snapshot read model, refreshed every few minutes.
UNKNOWN lists the core dimensions kguardian has no data for; images is always among them until vulnerability data exists. --status unknown lists the workloads it cannot judge at all. When more pages exist, the --after cursor is printed on stderr.

profile diff

Calls GET /workloads/{namespace}/{kind}/{name}/profile/diff. The broker stores a new revision whenever the observed, policy-relevant behaviour changes: securityContext, running digests, the syscall set, or the set of network rules. A revision records what kguardian observed, not what is applied in the cluster.
unset means a spec field was not set at that revision. unknown means a derived value (the PSS level, the capture level) was not known at that revision. If retention has trimmed the revision before --to, the broker compares with the newest retained one and the output says so in a Note: line. The latest revision number is shown by profile get.

profile export

Prints a recommendation derived from the profile. kguardian never applies it. The patch sets only the fields that fail an evaluated Pod Security Standards check, under the right path for the kind (spec.template.spec for a Deployment or DaemonSet, spec.jobTemplate.spec.template.spec for a CronJob). stdout is the patch and nothing else; caveats go to stderr:
Read the caveats before applying anything. For this node agent they say that turning off hostNetwork and hostPID breaks components that need the node’s namespaces, and that a namespace-level PSS exemption is often the right answer instead. If you still want the patch, apply it yourself:
When the broker has no patch to recommend, the command prints nothing on stdout and explains why on stderr. That is not a pass: it happens when every check kguardian can see passes, which is only an upper bound, or when the only failing container is an ephemeral one that a patch cannot change. If no container securityContext has been reported for the workload, the command exits non-zero: there is nothing to base a recommendation on. Global flags (--kubeconfig, --context, --broker-namespace, --broker-service, --broker-token-file, --debug) are listed in the CLI overview. A 401 or 403 from the broker prints a hint: these commands need a token with the read scope.