-
Notifications
You must be signed in to change notification settings - Fork 1.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
No rootles image despite the note in the release 0.58 #6394
Comments
Hi @sabinahofmann 👋 And thanks for reporting this. I'm unable to reproduce it here, I think. Trying to run both of the versions I'm only seeing the UID warning when using the non-rootless version. Starting from the next version, this will be the default behavior. Am I missing something obvious? 😃 docker run openpolicyagent/opa:0.58.0-envoy-rootless run --server 'WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
{"addrs":[":8181"],"diagnostic-addrs":[],"level":"info","msg":"Initializing server. OPA is running on a public (0.0.0.0) network interface. Unless you intend to expose OPA outside of the host, binding to the localhost interface (--addr localhost:8181) is recommended. See https://www.openpolicyagent.org/docs/latest/security/#interface-binding","time":"2023-11-08T13:09:07Z"} docker run openpolicyagent/opa:0.58.0-envoy run --server WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
{"addrs":[":8181"],"diagnostic-addrs":[],"level":"info","msg":"Initializing server. OPA is running on a public (0.0.0.0) network interface. Unless you intend to expose OPA outside of the host, binding to the localhost interface (--addr localhost:8181) is recommended. See https://www.openpolicyagent.org/docs/latest/security/#interface-binding","time":"2023-11-08T13:09:36Z"}
{"level":"warning","msg":"OPA running with uid or gid 0. Running OPA with root privileges is not recommended.","time":"2023-11-08T13:09:36Z"} |
Just to clarify, we plan to stop publishing the |
Thank for your fast replay and also the information about the next steps. Which kind of Image are you using? If I run with podman (rootles state) I get the warning: $ podman run openpolicyagent/opa:0.58.0-envoy-rootless run --server
{"addrs":[":8181"],"diagnostic-addrs":[],"level":"info","msg":"Initializing server. OPA is running on a public (0.0.0.0) network interface. Unless you intend to expose OPA outside of the host, binding to the localhost interface (--addr localhost:8181) is recommended. See https://www.openpolicyagent.org/docs/latest/security/#interface-binding","time":"2023-11-09T14:28:33Z"}
{"level":"warning","msg":"OPA running with uid or gid 0. Running OPA with root privileges is not recommended.","time":"2023-11-09T14:28:33Z"} For me works only if a hand over explicit the uid and gid into the run command. According to the image layer of the Image, only the Uid is set. Which is also sufficient for a rootles container. However, the warning is misleading. Further Information:
|
Yeah, looks like the makefile only sets the UID and not the GID. That differs from the OPA one, where we set both. We should have that corrected, I think. Would you want to submit a fix for that? |
Yeah, I will do it. |
Could somebody please review the PR. Thank you! |
Merged. Thanks @sabinahofmann! |
@ashutosh-narkar Will the envoy static images use user 1000? They are still |
Not atm but we can look into that for a future release. |
Short description
Based on this note v.58.0, it is expected that all images from 0.58 will run rootless. Reference is also made to the release in the corresponding variants v0.58.0-envoy.
According to the release note, I should not get an warning if I run an rootless image, because it's enought if the uid is not 0.
Examples:
** Image Layer: https://hub.docker.com/layers/openpolicyagent/opa/0.58.0-envoy/images/sha256-f53e69eeee948b1d725877751720864221f6353e515211d54455f08b5abad671?context=explore
** Image Layser: https://hub.docker.com/layers/openpolicyagent/opa/0.58.0-envoy-rootless/images/sha256-06418ed931f8f125e0ff8c235c88a2a3bdaad61002ecfe598ff3554f4dc7fe19?context=explore
Steps To Reproduce
"OPA running with uid or gid 0. Running OPA with root privileges is not recommended."
(see belowopa/runtime/check_user_unix.go
Line 22 in 30a244e
Expected behavior
Based on the note, I expect all variants images of OPA to run rootless. Both the UID and the GID and not onlay UID should be not 0 according to the text in release notes. Also the warning should be more should be more accurate. It's enough to set only UID not to 0.
The text was updated successfully, but these errors were encountered: