---
title: Swarm mode should not be enabled unless necessary
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Swarm mode should not be enabled unless
  necessary
---

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

# Swarm mode should not be enabled unless necessary
Classification:complianceFramework:cis-dockerControl:5.1 
## Description{% #description %}

Swarm mode should be off on a host that takes no part in a swarm.

## Rationale{% #rationale %}

Swarm mode opens management ports and runs the cluster services of Docker, which serve only swarms.

## Audit{% #audit %}

Show the swarm state of the daemon:

```bash
docker info --format '{{ .Swarm.LocalNodeState }}'
```

Datadog passes the rule when the swarm state is `inactive` or empty and fails it otherwise. A host that belongs to a swarm by design fails, and needs a manual review.

## Remediation{% #remediation %}

Leave the swarm:

```bash
docker swarm leave
```

## Impact{% #impact %}

The host stops running swarm services.

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

Swarm mode is off.

## References{% #references %}

1. [https://docs.docker.com/reference/cli/docker/swarm/leave/](https://docs.docker.com/reference/cli/docker/swarm/leave/)
