-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Document pre-requisites for running Elastic Agent in unprivileged mode #4705
Comments
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
cc: @kilfoyle |
Thanks for opening this @ycombinator! I like the organization. Once we have all the pre-requisites info I can add a table into the docs mapping each function to the pre-requisite(s) associated with using it in unprivileged mode. I'm thinking that we can also have a troubleshooting section with something like:
And thanks @kaanyalti for taking this one on! |
In #4125 (comment), @kilfoyle said:
|
Mac tests
found this open issue related to these logs elastic/beats#39733 Note Giving read permission to the elastic-agent group for the /var/log/system.log file fixes this error. Dashboards:[Logs System] Syslog dashboardPrivilegedUnprivilegedNote Giving read permission to the elastic-agent group for the /var/log/system.log file fixes the discrepancy between the two dashboards [Metrics System] Host overviewPrivilegedUnprivilegedAgent doesn't seem to have all the processes listed in the cpu and memory usage lists. It looks like only the processes run by the Logged in userRan
|
inspect
an unprivileged Agent as a privileged user
#4888
WindowsWithout sufficient permissions, I faced following errors and almost nothing was showing up on dashboards (as expected).
|
@ycombinator @pierrehilbert now that @VihasMakwana and @kaanyalti tested all the different combinations (unless I am missing something) what would be the next step here? Should @VihasMakwana start writing down all the settings that need to be changed when running unprivileged? |
WindowsDashboards after giving sufficient permissions as per this comment
Unprivileged Privileged
Unprivileged Privileged
Unprivileged Privileged
Unprivileged Privileged
Unprivileged Privileged
Unprivileged Privileged
Unprivileged Note Here we can see that Privileged |
@ycombinator @blakerouse @pierrehilbert @cmacknz There's one particular error showing up after giving all necessary privileges.
It tries to open a volume (not the filesystem) to fetch performance counters. As per this microsoft doc,
We can fix this error by giving administrative privileges to our unprivileged user. But isn't it the very thing we're trying to avoid? How should we tackle this? cc: @jlind23 |
NOTE |
Once @VihasMakwana is done working through all the scenarios (== all checkboxes in the Definition of Done are checked), we will end up with a bunch of comments in this issue going over the scenarios and what changes had to be done to make it work in unprivileged mode. At that point, we can close this issue. @kilfoyle is already aware of this issue and is going to port over the comments into proper documentation. |
I would be happy to get @ycombinator and @cmacknz opinion on #4705 (comment) but worst case it can be documented as a known limitation. |
I assume this happens when you use the Where are you seeing this error — in the Agent logs? Or somewhere else? Does it occur once or frequently? Also, are there any other, more visible, symptoms as a result, e.g. an empty dashboard or some message in the Fleet UI? Where I'm going with these questions is: maybe if Agent knows it's running in unprivileged mode, it could perhaps not even try to access the volume rather than emitting the error (especially if we're emitting this error frequently). I realize the code for accessing the volume is buried quite deep so this would mean passing down the necessary information to that level.
Indeed. In this case, the "fix" is to run Elastic Agent in privileged mode. So I would definitely document the symptoms and mention that the observed behavior is expected in unprivileged mode. |
This specifically happens for
Yes, this is in agent logs. It occurs frequently and the frequency depends on the
I'm doing research on this part. I'll open a separate issue to track this scenario. |
Thanks @kaanyalti and @VihasMakwana for the super clear guidance around these limitations! @ycombinator I've tried to capture everything as part of the Add steps and details for running 'unprivileged' Elastic Agent PR. A preview of the limitations is available in the Agent and dashboard behaviors in unprivileged mode section of the new page. Please let me know whatever may need fixing up. :-) |
Background
Traditionally, privileged users (e.g.
root
on Linux) run Elastic Agent on a host. However, with #3598, #4362, #4264, and other follow-up PRs, it is now possible to run Elastic Agent with an unprivileged user.Problem statement
Running Agent as an unprivileged user has consequences. Not only does the Agent itself run as an unprivileged user, but so do the process components it orchestrates, e.g. the various Beats. Consequently, any integrations being handled by such components, e.g.
system
, might not have the necessary access on the host to collect all the data they can when running as a privileged user. The result is that users do not see data they might be expecting in these integrations' dashboards. Some examples of this situation are:system.security
dataset is not generated for Windows agent installed with unprivileged flag. #4647--unprivileged
flag, #4653system.syslog
not available for mac agent installed with unprivileged flag. #4675Similarly, users might encounter other issues related to the installing or running of Elastic Agent in privileged mode. Some examples of this situation are:
--base-path
and--unprivilege
command. #4690--base-path
and--unprivileged
flags. #4703Definition of done
Let's use this issue to collect any pre-requisites a user must perform to install and run Elastic Agent in unprivileged mode, as well as any other gotchas they might run into when using the
system
integration with an Elastic Agent running in unprivileged mode.For each pre-requisite let's capture the following information:
MacOS
Linux
Windows
The text was updated successfully, but these errors were encountered: