Replies: 1 comment 3 replies
-
This is not a matter for Podman, that would be a matter for the Linux kernel. But I doubt that a capability like that would be acceptable, because it doesn't sound like a very common use case. Did you consider using UTS namespaces? See |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When running a rootless Podman container (in my case with
crun
as the runtime), the sethostname syscall fails unless the--cap-add=SYS_ADMIN
flag is provided. This is problematic as SYS_ADMIN is a very broad capability and granting it introduces unnecessary security risks for operations that only require modifying the hostname.Steps to Reproduce:
podman --runtime=crun run --rm <image> bash -c "hostname new-hostname"
--cap-add=SYS_ADMIN
, which works but adds excessive privileges.Expected Behavior:
The sethostname syscall should succeed without requiring the SYS_ADMIN capability, as the operation can be scoped to the container namespace and does not inherently require such elevated privileges.
Observed Behavior:
The syscall fails unless --cap-add=SYS_ADMIN is explicitly added.
Notes:
Environment:
Beta Was this translation helpful? Give feedback.
All reactions