-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Do not include image annotations when building spec #18542
Do not include image annotations when building spec #18542
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@giuseppe @vrothberg @rhatdan PTAL |
Fair, will add test after lunch. |
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.
code itself LGTM
2fe907e
to
01c98d2
Compare
Test added |
Code LGTM, tests are very red though. |
These annotations can have security implications - crun, for example, allows rootless containers to preserve the user's groups through an annotation. We absolutely should not include annotations from an untrusted image off the internet by default. We may consider whitelisting some annotations (e.g. the legacy WASM annotations), but given that there is now a more explicit way of specifying an image uses the WASM runtime in the OCI image spec, I'm just tearing this out entirely for now. Signed-off-by: Matt Heon <[email protected]>
01c98d2
to
2c0f404
Compare
Tests should be going green, PTAL |
LGTM |
/lgtm |
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.
LGTM
inspectData := inspect.InspectContainerToJSON() | ||
Expect(inspectData).To(HaveLen(1)) | ||
Expect(inspectData[0].Config.Annotations).To(Not(HaveKey(annoName))) | ||
Expect(inspectData[0].Config.Annotations).To(Not(HaveKey("testlabel"))) |
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.
Mini nit: testlabel
would still be added to .Config.Labels
which we could test here as well
/cherry-pick v4.5 |
@mheon: new pull request created: #18654 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
After containers/podman#18542 , podman does not propagates annotations while running the image hence use `--platform wasm/wasi` Signed-off-by: Aditya R <[email protected]>
After containers/podman#18542 , podman does not propagates annotations while running the image hence use `--platform wasi/wasm` Signed-off-by: Aditya R <[email protected]>
After containers/podman#18542 does not include image annotations when building spec , podman does not propagates annotations while running the image hence use `--platform wasi/wasm`. Signed-off-by: Aditya R <[email protected]>
Add new _prefetch helper for fetching and caching images. Use it in a few places, most importantly 120-load.bats where our teardown() now runs 'rmi -af'. Reason: in containers#17911 we discovered that podman save + load do not actually preserve the image: annotations and other metadata are lost. This means that a test which runs after 120-load.bats is operating on a different $IMAGE than a test which runs before. This is not a problem except in very obscure corner cases, like one fixed in containers#18542, but it seems irresponsible to just handwave that issue away The _prefetch function uses skopeo for fetching and saving images, because skopeo preserves digests and metadata. [Side note for posterity: I tried amending basic_setup() to always rmi -a + prefetch, instead of the current images -a + rmi unwanted ones. That slowed down system tests by 10 minutes, presumably because loads are much slower than queries. I reverted that change and am documenting it as a reminder of why we do things the way we do.] Signed-off-by: Ed Santiago <[email protected]>
These annotations can have security implications - crun, for example, allows rootless containers to preserve the user's groups through an annotation. We absolutely should not include annotations from an untrusted image off the internet by default.
We may consider whitelisting some annotations (e.g. the legacy WASM annotations), but given that there is now a more explicit way of specifying an image uses the WASM runtime in the OCI image spec, I'm just tearing this out entirely for now.