-
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
Podman includes host /etc/hosts in container /etc/hosts #11835
Comments
I had to double-check against Docker to verify their behavior, but you are correct - they base their I would consider this a breaking change, so I think this is 4.0 only, no backporting. |
Yes this should definitely be fixed in 4.0 |
Interested in opening a PR to fix? |
Why not to disable leaking /etc/hosts with new, more general flag like in This won't be breaking change and may be safely backported probably. |
I don’t think /etc/hosts can be a security boundary. Is there any (legacy) product that treats hostnames / IP addresses as “credentials”? I think the default behavior should remain importing /etc/hosts from the host, but a new CLI flag can be added to change the behavior. |
Most of my urge to move to using the container's |
A friendly reminder that this issue had no activity for 30 days. |
@cdoern can you see this through to completion? |
sure @baude I'll start working on it this week. |
What should be the name of the option? --noleak (And block the leaking of /etc/resolv.conf and /etc/hosts into the container? Any others? Or just |
Well we already have --no-hosts, so --share-hosts might be better. |
A friendly reminder that this issue had no activity for 30 days. |
podman 4.0 has this feature. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
podman run
includes /etc/hosts records from host into /etc/hosts in container; this is security issue; podman should extend existing /etc/hosts from image (or create from scratch if absent) for container only with its own records and records added explicity by admin with --add-host, similar like docker workshttps://docs.docker.com/engine/reference/run/#managing-etchosts
/etc/hosts on host may contain stuff that should not be known for container, i.e. addresses of other containers on same machine, hidden from given container, external network names not available for container, etc.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
No
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: