-
Notifications
You must be signed in to change notification settings - Fork 154
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
[Bug] elastic-agent-complete >= 8.16.0 chowns /usr/share/elastic-agent/.pki #6684
Comments
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
The chown was introduced in #4925 and lets the container work properly when run as root or elastic-agent (or another non-root user). You potentially could also work around this by running the container as a non-root user and the explicitly giving it the capabilities it needs to run synthetics. Then the chown would be to the user you specify and not root. @pkoutsovasilis might have a better suggestion or way to handle this scenario. |
UPDATE: ok after reading again the issue description, I have to say that this seems kinda entangled; so the browser journeys are invoked as the container default user, namely hey @renzedj 👋 Just echoing the same message as @cmacknz this functionality of elastic-agent was introduced to mitigate some ownership inconsistencies that could lead to execution problems for certain components of elastic-agent. However, this feature affects only files under |
It appears that only Chromium runs as
I have already attempted this, it introduced other issues.
Was not aware of this. I'll look at this as a possible solution.
This makes perfect sense to me. It certainly addresses a few other issues I've experienced over time and had to put in workarounds for. |
I initially posted this as an issue in the
elastic-synthetics
repo, but I think it probably belongs here inelastic-agent
, so I'm posting it here and cancelling it there.I am using Elastic Synthetics for application monitoring, and I'm having an issue with the image
elastic-agent-complete >= 8.16.0
.We use self-signed certs on many of the internal sites we monitor, so I have to add CA's for these certs to the browser store (nssdb) in order to run browser journeys. This is located at
/usr/share/elastic-agent/.pki
. The nssdb must be owned by the browser user in order to be used for browser journeys, which means that it must be chowned toelastic-agent:elastic-agent
.This worked well for
elastic-agent-complete < 8.16.0
, However starting with8.16.0
, elastic-agent appears to chown everything in/usr/share/elastic-agent
toroot:root
at startup. This includes/usr/share/elastic-agent/.pki
, which means that the browser cannot use the certificates fromnssdb
.I posted this to the discussion forums, but have not received a response.
To replicate:
elastic-agent-complete
image.elastic-agent-complete
./usr/share/elastic-agent/.pki
and its contents.Workaround
I found that when I get a shell into the
elastic-agent-complete
container and reset/usr/share/elastic-agent/.pki
ownership and permissions to the correct values, browser tests immediately start again and run correctly until the pod stops; the replacement pod of course has the incorrect permissions and ownership. As a result, I added the following workaround to a customdocker-entrypoint
script:This forks a shell which sleeps for 15s. After that, it checks every 15s to see whether
elastic-agent container
is running. Once it is, it resets ownership and permissions for/usr/share/elastic-agent/.pki
to the correct values and exits.The text was updated successfully, but these errors were encountered: