-
Notifications
You must be signed in to change notification settings - Fork 524
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
/etc/apm-server/apm-server.yml not owned by apm-server user #2001
Comments
Same thing happens on CentOS, though there it says |
I am seeing the same on CentOS running |
This is the behavior I'd expect given the strict permissions are on by default. # ok
vagrant ssh -- sudo -u apm-server apm-server export config
# also ok
vagrant ssh -- sudo apm-server --strict.perms=false export config |
With a package installation? |
Yes, with a package installation. In this case the commands are being run as the |
Ah, maybe it is a different issue. In my case, apm-server would not start directly after upgrade to 7.0.0-rc1 from 6.7.0 without modifying ownership of apm-server.yml as the file was owned by the system |
@inqueue Thanks for clarifying. The upgrade path is indeed a bit different and there might be an issue in there. #1401 (comment) details the original decision making and again was revisited in #1833 but those docs don't actually exist yet. |
That seems reasonable, but the error message isn't clear to me. It says it should be owned by the "beat" user or root. Should that be the apm-server user or root? Maybe that's something in libbeat that needs to be overridden? At any rate, the problem seems to be rather that the user executing apm-server is not the file owner. Is this mentioned in the docs anywhere? I was approaching this like a user would (I hope), and followed the docs. https://www.elastic.co/guide/en/apm/server/current/setting-up-and-running.html shows running Finally, do you think it would be safe and reasonable to make the apm-server executable setuid? |
Just found that
Using |
This is a great find! elastic/beats#11325 is up to fix this.
on ubuntu the permissions on
Regarding the earlier comments:
Yes, that is indeed in libbeat here and here. #2026 opened to address those types of issues.
Unfortunately I wasn't able to find a way to make this safe and useful at the same time. If we make it world executable, the useful case, any user could gain access to secrets stored in the config, like
Less that world executable would be safer but I'm not sure there is much use in that case. Please chime in if I've missed something. |
Ah because Maybe just complicating things, and makes doing the wrong thing too easy for comfort, but an alternative would be:
|
I had not considered enforcing different perms based on the subcommand, I like the solution of enforcing a @inqueue If you do find any issue with permissions during upgrade please do open a separate issue. |
#2022 will cover my findings. |
Closing as we did not address it in time for 7.0 and won't consider it again until 8.0 |
Testing 7.0.0-beta1 on Ubuntu 16.04 x86-64.
Exits with status code 1. Output:
root
apm-server
(uid 998), and has perms 0600.The text was updated successfully, but these errors were encountered: