---
title: tmpfs mount allows exec, suid, or device access
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Infrastructure as Code (IaC)
  Security > IaC Security Rules > tmpfs mount allows exec, suid, or device
  access
---

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

# tmpfs mount allows exec, suid, or device access

{% 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-tmpfs-exec-enabled` 

**Platform:** DockerCompose

**Severity:** Low

**Category:** Resource Management

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

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

### Description{% #description %}

Docker applies `noexec,nosuid,nodev` to tmpfs mounts by default. Explicitly overriding those protections with `exec`, `suid`, or `dev` turns writable temporary storage into an execution or privilege-escalation vector. Services should remove these unsafe options and retain Docker's secure defaults.

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

```yaml
services:
  default_options:
    image: alpine
    tmpfs:
      - /tmp
      - /run:size=1m
  explicitly_restricted:
    image: alpine
    tmpfs:
      - /tmp:noexec,nosuid,nodev
      - /run:noexec,nosuid,nodev,size=1m
  long_syntax:
    image: alpine
    volumes:
      - type: tmpfs
        target: /cache
```

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

```yaml
services:
  exec_enabled:
    image: alpine
    tmpfs:
      - /tmp:exec
  suid_enabled:
    image: alpine
    tmpfs:
      - /run:rw,suid,size=1m
  devices_enabled:
    image: alpine
    tmpfs: /cache:dev
```
