Healthcheck instructions have not been added to container images misconfiguration detected in code
Rule Details
Cortex AppSec Rule ID
APPSEC_DOCKER_2
Category - Subcategory
Compute - Unsanctioned Resource Or Type
Provider
OTHER
Severity
LOW
Framework
DOCKER
Impact
This rule detects whether HEALTHCHECK instructions have been added to Docker container images. These instructions provide a way to check the health of the running container, ensuring that issues are detected and handled promptly, improving the reliability and stability of your containerized applications. Adding HEALTHCHECK instructions to your Dockerfiles follows best practices for Docker container health management.
How to Fix
To mitigate this issue, add HEALTHCHECK instructions to your Dockerfile. Define a command that will be used to check the health of the container and specify the interval, timeout, and retries for how often the check should be performed.
Example: [source,go]
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -f http://localhost/health || exit 1
Last updated
Was this helpful?
