---
title: Container healthcheck disabled
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Infrastructure as Code (IaC)
  Security > IaC Security Rules > Container healthcheck disabled
---

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

# Container healthcheck disabled

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Metadata{% #metadata %}

**Id:** `dockercompose-healthcheck-disabled` 

**Platform:** DockerCompose

**Severity:** Medium

**Category:** Availability

#### Learn More{% #learn-more %}

- [Provider Reference](https://docs.docker.com/reference/compose-file/services/#healthcheck)

### Description{% #description %}

Explicitly disabling a container healthcheck removes the ability for orchestrators and monitoring tools to detect and recover from unhealthy service states, reducing availability and observability. A service's `healthcheck` block should not set `disable: true` or `test: ["NONE"]`, both of which suppress all health monitoring. A scalar `test: "NONE"` is a CMD-SHELL command, not a disable directive, and is not flagged. Services that inherit a healthcheck from their image are not affected; only explicit suppression is detected by this rule.

## Compliant Code Examples{% #compliant-code-examples %}

```yaml
services:
  inherited:
    image: alpine
  enabled:
    image: alpine
    healthcheck:
      test: [CMD, wget, --spider, http://localhost]
  scalar_none_is_cmd_shell:
    image: alpine
    healthcheck:
      test: "NONE"
```

## Non-Compliant Code Examples{% #non-compliant-code-examples %}

```yaml
services:
  disabled:
    image: alpine
    healthcheck:
      disable: true
  none_test:
    image: alpine
    healthcheck:
      test: [NONE]
```
