-
Notifications
You must be signed in to change notification settings - Fork 43
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
Remove NOPASSWD tag in /etc/sudoers #104
Comments
Sorry for the delay. I've been busy but this problem has kept my thoughts over the past few days. I'm keen to chat about options and throw some ideas around. As a background for myself in case you don't know, I'm not an IT professional. I'm a mechanic that's gained a reasonable level of competency by self teaching to build this project over 6 years, but as a result my expertise in some areas are lacking. So a scenario that plays out in my head... We go with your first fix idea... It's quick and simple plus requires no future maintenance responsibilities as we add new features/develop. A user is prompted for a password during install and update or user triggered addition of features. After whatever the default timeout is expired that application is locked out of anything that requires root privileges. A concern of mine...
A couple of elements I've already just locally cloned the safe code so as to not need to pull from github, which reduces anything malicious getting added:
That full list may not be necessary but shows that 3/4 are from what are generally trustworthy Monero community members/devs, but in the unlikely but possible event that one of those sources were compromised the action of giving the root password on install wouldn't prevent us from installing something that could immediately run malicious code? My thinking from what I said in the telegram group was that there may be benefit to instead specify NOPASSWD for listed commands only, in the sudoers file that we expect a safe installer to use. So yes we may give sudo permission to install what we think is a safe app, but if there is a malicious sudo command within the foreign app, would that be caught? I know the install script would be elevated to sudo, but is there a better option out there? That may be a little confusing/badly explained or perhaps I'm missing knowledge that's important here. |
Whether you can trust third-party scripts or not is for sure another important safety concern, but in my mind the initial purpose for opening this issue was more about daemons exposing ports to the whole wide world while running under what is effectively root privilege. I'm no IT professional either, I'm just a postdoc researcher in a completely unrelated field with an inclination towards paranoia, but one thing I've learned by osmosis is that this is usually considered a big no-no and that every public-facing daemons should run under their own locked-down user. In other words this is an issue even if we can trust every scripts of the ecosystem. The currently situation is such that all pinodes are one critical bug away (say, in the way monerod handles RPC commands or something adjacent in the p2pool server) from an hypothetical worm that could modify their Actually I'm not even sure you need root privilege to kill and restart But following your train of thought, I agree that explicitly listing what the pinodexmr user can sudo in |
By default the
pinodexmr
user has aNOPASSWD
tag in/etc/sudoers
. Many daemons likemonoerod
andp2pool
are executed withpinodexmr
privileges. Depending on your setup those daemons might expose ports like37888-37889
and18080
to the outside world. This means that in the event that a rce vulnerability is discovered inmonerod
/p2pool
it would be trivial for a malicious/compromised node to elevate themselves to root for free.Removing the
NOPASSWD
tag will cause users to be initially prompted for their password during updates when the first sudo'd command is called, but sudo caches/timestamps credentials for 15 minutes by default and the subsequent sudo'd commands will go through without prompting the user.The text was updated successfully, but these errors were encountered: