Skip to content

Commit

Permalink
Add support for overlayfs direct scan for SBOMs
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce committed Oct 25, 2024
1 parent 808e729 commit 8dfc3b2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions charts/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ helm install <RELEASE_NAME> \
| datadog.prometheusScrape.version | int | `2` | Version of the openmetrics check to schedule by default. |
| datadog.remoteConfiguration.enabled | bool | `true` | Set to true to enable remote configuration. DEPRECATED: Consider using remoteConfiguration.enabled instead |
| datadog.sbom.containerImage.enabled | bool | `false` | Enable SBOM collection for container images |
| datadog.sbom.containerImage.overlayFSDirectScan | bool | `false` | Use experimental overlayFS direct scan |
| datadog.sbom.containerImage.uncompressedLayersSupport | bool | `true` | Use container runtime snapshotter This should be set to true when using EKS, GKE or if containerd is configured to discard uncompressed layers. This feature will cause the SYS_ADMIN capability to be added to the Agent container. Setting this to false could cause a high error rate when generating SBOMs due to missing uncompressed layer. See https://docs.datadoghq.com/security/cloud_security_management/troubleshooting/vulnerabilities/#uncompressed-container-image-layers |
| datadog.sbom.host.enabled | bool | `false` | Enable SBOM collection for host filesystems |
| datadog.secretAnnotations | object | `{}` | |
Expand Down
14 changes: 10 additions & 4 deletions charts/datadog/templates/_container-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
image: "{{ include "image-path" (dict "root" .Values "image" .Values.agents.image) }}"
imagePullPolicy: {{ .Values.agents.image.pullPolicy }}
command: ["agent", "run"]
{{ include "generate-security-context" (dict "securityContext" .Values.agents.containers.agent.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version "sysAdmin" (and (eq (include "should-enable-sbom-container-image-collection" .) "true") .Values.datadog.sbom.containerImage.uncompressedLayersSupport)) | indent 2 }}
{{ include "generate-security-context" (dict "securityContext" .Values.agents.containers.agent.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version "sysAdmin" (and (eq (include "should-enable-sbom-container-image-collection" .) "true") (and .Values.datadog.sbom.containerImage.uncompressedLayersSupport (not .Values.datadog.sbom.containerImage.overlayFSDirectScan)))) | indent 2 }}
resources:
{{ toYaml .Values.agents.containers.agent.resources | indent 4 }}
ports:
Expand Down Expand Up @@ -177,11 +177,17 @@
- name: DD_SBOM_CONTAINER_IMAGE_ENABLED
value: "true"
{{- end }}
{{- if and (eq (include "should-enable-sbom-container-image-collection" .) "true") .Values.datadog.sbom.containerImage.uncompressedLayersSupport }}
{{- if (eq (include "should-enable-sbom-container-image-collection" .) "true") }}
{{- if .Values.datadog.sbom.containerImage.uncompressedLayersSupport }}
{{- if .Values.datadog.sbom.containerImage.overlayFSDirectScan }}
- name: DD_SBOM_CONTAINER_IMAGE_OVERLAYFS_DIRECT_SCAN
value: "true"
{{- else }}
- name: DD_SBOM_CONTAINER_IMAGE_USE_MOUNT
value: "true"
{{- end }}

{{- end }}
{{- end }}
{{- if .Values.datadog.sbom.host.enabled }}
- name: DD_SBOM_HOST_ENABLED
value: "true"
Expand Down Expand Up @@ -276,7 +282,7 @@
readOnly: true
{{- end }}
{{- end }}
{{- if and (eq (include "should-enable-sbom-container-image-collection" .) "true") .Values.datadog.sbom.containerImage.uncompressedLayersSupport }}
{{- if and (eq (include "should-enable-sbom-container-image-collection" .) "true") (or .Values.datadog.sbom.containerImage.uncompressedLayersSupport .Values.datadog.sbom.containerImage.overlayFSDirectScan)}}
- name: host-containerd-dir
mountPath: /host/var/lib/containerd
readOnly: true
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
shareProcessNamespace: {{ .Values.agents.shareProcessNamespace }}
{{- end }}
{{- if .Values.datadog.securityContext -}}
{{ include "generate-security-context" (dict "securityContext" .Values.datadog.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version ) | nindent 6 }}
{{ include "generate-security-context" (dict "securityContext" .Values.datadog.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version) | nindent 6 }}
{{- else if or .Values.agents.podSecurity.podSecurityPolicy.create .Values.agents.podSecurity.securityContextConstraints.create -}}
{{- if .Values.agents.podSecurity.securityContext }}
{{- if .Values.agents.podSecurity.securityContext.seLinuxOptions }}
Expand Down
3 changes: 3 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,9 @@ datadog:
# See https://docs.datadoghq.com/security/cloud_security_management/troubleshooting/vulnerabilities/#uncompressed-container-image-layers
uncompressedLayersSupport: true

# datadog.sbom.containerImage.overlayFSDirectScan -- Use experimental overlayFS direct scan
overlayFSDirectScan: false

host:
# datadog.sbom.host.enabled -- Enable SBOM collection for host filesystems
enabled: false
Expand Down

0 comments on commit 8dfc3b2

Please sign in to comment.