-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Support running Auditbeat and Elastic Agent docker images without root #20996
Comments
Pinging @elastic/integrations-platforms (Team:Platforms) |
Pinging @elastic/ingest-management (Team:Ingest Management) |
Pinging @elastic/siem (Team:SIEM) |
@blakerouse Can you do a follow up with @jsoriano on the required changes for the Elastic Agent? |
@jsoriano Do Packetbeat have the same problems? |
Nop, it is not using Though it doesn't start unless
We should find a consistent solution for containers requiring privileges. |
I have created a separated issue for Packetbeat as the problem is different: #21032 |
I think from Elastic Agent side, it's not required for it to be ROOT. But I do think we need to ensure we disable Endpoint when not running as ROOT, also we probably need to ensure it doesn't run when in a container anyway. |
I think it is enough if the container starts with the default configuration, and it fails later depending on some custom configuration or some other condition. It is in principle ok to give more privileges on runtime (with I will give a try to just removing |
I am closing this after reviewing/fixing these cases:
|
In general it makes more sense to run Auditbeat and Elastic Agent as root. Most of Auditbeat functionality requires high privileges, and Elastic Agent has capabilities to start and supervise other services, including Auditbeat, so it also requires these privileges. Endpoint probably also require high privileges.
For that, docker images use
USER root
, but this goes against generally accepted good practices, containers run with arbitrary user ids in secured Kubernetes environments, and Red Hat certified images cannot run as root.So we should stop using
USER root
, at least in UBI images, that are more intended to certified, secure environments. We have to take into account that the images could still be run as root in privileged environments with runtime options.Things to do:
USER root
from Auditbeat and Elastic Agent docker images (at least from the UBI ones).Where to look at:
magefile.go
(here), if we are going to provide different config for default and UBI images, we will have to move this to thepackages.yml
file as a new config that extends common Beats config, what would allow a cleaner override.packages.yml
file (here).Related PRs and issues:
The text was updated successfully, but these errors were encountered: