-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Lynis needs to drop privilleges to support homebrew on MacOSX #382
Comments
Thanks for reporting this. Lynis doesn't drop privileges as it is a shell script and it does not have a default user to use (like nginx would use www-data on Ubuntu). If you would run Lynis as a non-privileged user, this error does not show up, right? Not sure if there is a right fix here. If you run Lynis as root user (or indirectly via sudo), then you would also run Brew as root user. Unless there is a default user for Brew. Any suggestion from your side? |
Macports has a user account, but my version of homebrew does not.
I strongly recommend that the long term solution is that the program makes an unprivileged daemon account, for security purposes under any OS. Many binaries don't have a fixed path, or do not need to be run with EUID=0. To get a free uid under MacOSX: https://serverfault.com/questions/182347/add-daemon-account-on-os-x |
With homebrew I can still run old mac versions:
|
Thanks for suggestions. This is an interesting case and has to be researched more in depth from our side, to see if this is in line with the goals of Lynis. As Lynis is not a daemon process, we rather not switch back to a normal user. That is up to the user to do, especially as there could be multiple users on a single system that have Brew installed. Lynis does not have to be executed as root. So if Brew is discovered for the root user, and Brew gives a warning, it might be something to "accept" from an auditing point of view. Just to be sure: on your system, do you have Brew installed as a root user, or only as a normal user? |
Homebrew is installed under my normal user account. Only the make install step could require elevated privileges. That applies to all package auditing tools. |
Well, since errors are already displayed when running as NOT sudo, saying not every test would run without it, for the time being the same could be displayed when running AS sudo, that HomeBrew tests will NOT run when using Sudo.... Seeing as that is what happens... Therefore stopping HomeBrew tests on Sudo. |
Closing this issue at this moment, as there is not enough support for this item. We monitored the item to see if more macOS users feel the same. We rather prevent the usage of sudo or having the hard requirement of a dedicated user. |
Well, it doesn't exactly seem that there is a large macOS user base that is active here on this page. Seeing as I just reported the issue about Lynis not identifying Mojave, of which any number of beta testers who would have been using Lynis would've reported such an issue months ago... The better reasoning could've been "the means of circumventing this issue is much too difficult and doesn't work with the rest of our code" instead of "our already tiny macOS user base just didn't respond with the same furor as any of the larger user base... Apologies if the above opinion came off as overly rude, but I don't care to sugarcoat things. |
Given I run the version of today + mac ports patch:
When scanning I need to login as root.
Then I get the following error in my report:
Logfile /var/log/lynis.log doesn't give any more details.
Expected behavior: the program should drop privileges.
The text was updated successfully, but these errors were encountered: