---
title: The container's health should be constantly monitored
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > The container's health should be
  constantly monitored
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# The container's health should be constantly monitored
Classification:complianceFramework:cis-dockerControl:5.27 
## Description{% #description %}

Running containers should have their health checked.

## Rationale{% #rationale %}

With a health check, Docker reports a container that stops working, and orchestrators can replace it.

## Audit{% #audit %}

Inspect the containers:

```bash
docker ps --quiet | xargs docker inspect --format '{{ .Name }}: Health={{ .State.Health.Status }}'
```

Datadog checks the running containers. It passes the rule when a container has a health status and fails it otherwise.

## Remediation{% #remediation %}

Add a `HEALTHCHECK` to the image, or run the container with `--health-cmd`:

```bash
docker run --health-cmd 'curl -f http://localhost/ || exit 1' <image>
```

## Impact{% #impact %}

None.

## Default value{% #default-value %}

Containers have a health check only when their image or command defines one.

## References{% #references %}

1. [https://docs.docker.com/engine/containers/run/#healthcheck](https://docs.docker.com/engine/containers/run/#healthcheck)
