-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to use containerd snapshotter to generate SBOMs #1290
Conversation
{{- if .Values.datadog.sbom.containerImage.uncompressedLayersSupport -}} | ||
{{- $capabilities := dict "capabilities" (dict "add" (list "SYS_ADMIN")) }} | ||
{{ include "generate-security-context" (dict "securityContext" (merge $capabilities .Values.agents.containers.agent.securityContext) "targetSystem" "foobar" "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version) | indent 2 }} | ||
{{- else }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have a function generate-security-context
that tune the securityContext. Can we add this logic to the function too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lebauce
I made some comments. Also could you add or CI example in https://github.com/DataDog/helm-charts/tree/main/charts/datadog/ci
to make sure that the securityContext capability merge function works as expected 🙇
Also I think if this new option in enabled and the customer is also using the appArmor option we should add the specific appArmor annotation to the agent
container.
e892634
to
b9729af
Compare
@clamoriniere I have little knowledge regarding apparmor. Could you please provide the annotations that should be added ? |
099d643
to
e91e7c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a small suggestion for the annotation condition.
Also please add test case in the ci
folder 🙇
Sorry, I just saw your message. I think you found it. |
e91e7c1
to
3744e19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the updates
# 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. | ||
uncompressedLayersSupport: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the option name does not exactly represent what it does. Using mount
has different facets (more performant, more permissions, etc.) and perhaps in the future we'll have another way to support uncompressed layers while still offering the mount
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended: the idea of this flag is more to make the feature work in the case of discarded layers. This will allow us to more to a better solution in the future. Naming it mountImages
would make the migration more complex as we wouldn't know if the feature was specifically request or if it's because it was used as a workaround.
Does it make sense ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to have a dedicated uncompressedLayersSupport
that activates useMount
. What does not make sense is that useMount
does not exist.
I know we did not advertise this option before, but I believe it should have its own existence and we could put in the docstring that uncompressedLayersSupport
implies useMount
, with the proper explanation on useMount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets continue this discussion about the useMount
option or equivalent for another PR, and merge this one. so we can provide an easy configuration for users already
aae454f
to
3ab20a4
Compare
What this PR does / why we need it:
This PR set up container image scanning using the containerd snapshotter.
To do so, it bind mounts the containerd folder and adds the required
capability to mount container images. This is intended to be used when
facing the
discard_uncompress_layers
issue with containerd.Which issue this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged)Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
.github/helm-docs.sh
)CHANGELOG.md
has been updatedREADME.md
make update-test-baselines
)