Skip to content

Commit 4474f88

Browse files
cyrbouchiatjeff-morgan-dd
authored andcommitted
Add Cloud Security Kubernetes DaemonSet setup (#37634)
Co-authored-by: jeff-morgan-dd <jeff.morgan@datadoghq.com>
1 parent 2f75924 commit 4474f88

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

  • content/en/security/cloud_security_management/setup/agent

content/en/security/cloud_security_management/setup/agent/kubernetes.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,61 @@ Use the following instructions to enable Misconfigurations and Vulnerability Man
109109

110110
{{% /tab %}}
111111

112+
{{% tab "DaemonSet" %}}
113+
114+
1. Add the following environment variables to every Agent container in the `daemonset.yaml` file, including `agent`, `security-agent`, and `system-probe`. These variables enable Misconfigurations, Vulnerability Management, mount-based container image scanning, and runtime package tracking.
115+
116+
```yaml
117+
- name: DD_COMPLIANCE_CONFIG_ENABLED
118+
value: "true"
119+
- name: DD_COMPLIANCE_CONFIG_HOST_BENCHMARKS_ENABLED
120+
value: "true"
121+
- name: DD_SBOM_ENABLED
122+
value: "true"
123+
- name: DD_SBOM_CONTAINER_IMAGE_ENABLED
124+
value: "true"
125+
- name: DD_SBOM_HOST_ENABLED
126+
value: "true"
127+
- name: DD_SBOM_CONTAINER_IMAGE_USE_MOUNT
128+
value: "true"
129+
- name: DD_SBOM_ENRICHMENT_USAGE_ENABLED
130+
value: "true"
131+
- name: HOST_ROOT
132+
value: /host/root
133+
```
134+
135+
If your DaemonSet mounts the host root at a different path, set `HOST_ROOT` to that mount path in each Agent container.
136+
137+
2. Set `hostPID: true` in the pod spec and add the following `securityContext` to the `agent` container. These settings are required for mount-based container image scanning with `DD_SBOM_CONTAINER_IMAGE_USE_MOUNT=true`.
138+
139+
```yaml
140+
# Source: datadog/templates/daemonset.yaml
141+
apiVersion: apps/v1
142+
kind: DaemonSet
143+
[...]
144+
spec:
145+
[...]
146+
template:
147+
[...]
148+
spec:
149+
hostPID: true
150+
containers:
151+
[...]
152+
- name: agent
153+
[...]
154+
securityContext:
155+
capabilities:
156+
add:
157+
- SYS_ADMIN
158+
readOnlyRootFilesystem: true
159+
appArmorProfile:
160+
type: Unconfined
161+
```
162+
163+
3. Restart the Agent.
164+
165+
{{% /tab %}}
166+
112167
{{< /tabs >}}
113168

114169
**Note**: `enrichment.usage.enabled: true` is in Preview and requires Datadog Agent **7.79.0 or later**. From 7.79.0, runtime package tracking runs independently of [Workload Protection][8] and does not affect its usage. See the [Runtime Package Tracking](#runtime-package-tracking-preview) section for more details.
@@ -197,6 +252,27 @@ Restart the Agent.
197252

198253
{{% /tab %}}
199254

255+
{{% tab "DaemonSet" %}}
256+
257+
Set `hostPID: true` in the pod spec, and add the following environment variables to every Agent container in your `daemonset.yaml` file, including `agent`, `security-agent`, and `system-probe`:
258+
259+
```yaml
260+
# Pod spec
261+
hostPID: true
262+
263+
# Add to each Agent container's env section.
264+
- name: DD_SBOM_ENABLED
265+
value: "true"
266+
- name: DD_SBOM_CONTAINER_IMAGE_ENABLED
267+
value: "true"
268+
- name: DD_SBOM_ENRICHMENT_USAGE_ENABLED
269+
value: "true"
270+
```
271+
272+
Restart the Agent.
273+
274+
{{% /tab %}}
275+
200276
{{< /tabs >}}
201277

202278
[1]: /security/cloud_security_management/misconfigurations/

0 commit comments

Comments
 (0)