-
Notifications
You must be signed in to change notification settings - Fork 30
coreos-metadata fails as non-root user on Azure #2468
Comments
We shouldn't hardcode a bailout, since those firewall rules may or may not be enabled. What use case does this break? coreos-metadata normally does run as root. |
I ran into this while testing coreos/afterburn#88. At the moment this doesn't break any real-world usecase I'm aware of, but it seems that |
I guess I don't see it. If someone (maybe the user?) installs a DROP rule, a) it's not an application's job to work around (or document) the consequences, and b) |
We certainly shouldn't try to anticipate any possible user configurations that might prevent Do you think the config drive case is any different? |
The problem is also not user-facing, so such documentation would be more noise than signal. The config-drive case is not a system configuration issue, so it's somewhat more fundamental, but we emit a reasonably helpful error message there. What might make sense is to detect the connection timeout, notice that we're non-root on Azure, and append a helpful hint to the error message. We could do the same for the config-drive case (though technically that wants CAP_SYS_ADMIN, not root). |
That seems reasonable to me. |
Given that this is not a bug affecting ContainerLinux, but there are some distribution-independent enhancements we'd like to have in coreos-metadata, I'd like to close this ticket here and move/split into three separate tickets directly in the coreos-metadata tracker (to be reopened):
If there are not objections (especially on re-opening coreos-metadata tracker for things not specific to CL), I'll proceed with that tomorrow. |
I moved those items to coreos/afterburn#94, coreos/afterburn#95, and coreos/afterburn#96. |
Issue Report
Bug
Container Linux Version
Environment
Azure
Expected Behavior
coreos-metadata
is able to retrieve metadata when run as a non-root user.Actual Behavior
Reproduction Steps
waagent
to add its firewall rules.coreos-metadata
as a non-root user to retrieve some metadata.Other Information
waagent
was bumped from 2.2.4 to 2.2.25 (coreos/coreos-overlay#3205), which introduced and enabled theOS.EnableFirewall
option. This option causeswaagent
to add iptables rules to prevent non-root users from reaching the Azure fabric endpoint, whichcoreos-metadata
uses to retrieve its metadata.The simplest fix for this would be to set
OS.EnableFirewall = n
inwaagent.conf
, although this would require an OEM partition update. It's also not clear that this is a good idea from an Azure perspective; blocking non-root access to the the fabric endpoint is apparently "the right thing", although it's not clear precisely what that means.It also might be a better solution to explicitly require
coreos-metadata
to run as root on Azure.coreos-metadata
already needs to be run as root when using a Config Drive. If this is the chosen solution, the issue is really thatcoreos-metadata
should explicitly bail out and inform the user when run as a non-root user on these platforms.The text was updated successfully, but these errors were encountered: