More Info:
Advisory: long-running containers should define livenessProbe and readinessProbe so Kubernetes can restart hung pods and keep traffic off pods that are not ready.Risk Level
InformationalAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify noncompliant pods and their owning controllers (run on any machine with kubectl access):
-
For a pod managed by a controller (e.g., Deployment), edit the controller manifest to add probes (run on any machine with kubectl access). Example for a Deployment
my-deployin namespacemy-namespace:In thespec.template.spec.containers[]entry for each long-running container, add something like:Adjust paths, ports, and timings to match the application. -
For a bare Pod without an owning controller (used only for testing or debugging), either:
- Add probes directly by editing:
then update the container spec with
livenessProbeandreadinessProbeas above, understanding this will not persist if the pod is recreated; or - Preferably, re-create it from a proper manifest:
Edit
/tmp/my-pod.yamlto:- Remove
metadata.uid,metadata.resourceVersion,metadata.creationTimestamp,status, and anyownerReferences. - Add
livenessProbeandreadinessProbeunder each long-running container. Then apply:
- Remove
- Add probes directly by editing:
-
If your workloads are managed through GitOps or IaC (e.g., manifests in OCI DevOps or a Git repo), make the same
livenessProbeandreadinessProbeadditions in the source manifests for each long-running container, then let your normal deployment process apply them. This ensures changes are not overwritten. -
After edits, wait for the new pods to become Ready (run on any machine with kubectl access):
Confirm that pods from updated controllers are in
Runningstate andREADYcolumns show all containers ready (e.g.,1/1,2/2). -
Verify compliance (run on any machine with kubectl access):
Confirm output is
is_compliant=trueor that no lines showis_compliant=falsefor long-running containers you expect to be covered.
Using kubectl
Using kubectl
On any machine with kubectl access:If your container should use TCP or exec probes instead, adjust accordingly, for example:For objects first defined in YAML, you can instead edit and re-apply:Edit
- Identify non-compliant pods and their owners
- Edit the owning workload manifests and add probes
- For bare Pods created directly (not recommended for long‑running apps)
my-pod.yaml:- Remove fields under
metadatasuch ascreationTimestamp,resourceVersion,uid,selfLink,managedFields. - Remove
status:completely. - Under each long‑running
spec.containers[], addlivenessProbeandreadinessProbe.
- Verification
is_compliant=true:Automation
Automation

