-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Ideas for better non-root usage #348
Comments
For me the question is if really "we" need to be in charge to check/question this (we can do this initailly when a adapter comes into the repo, but after that we are nearly blind - unless we diuplictae tis in the repo file and so see on PRs. My idea would be more "Transparency", "Guidance" and "self control", so we should have a popup in Admin when installing such adapters stating exactly what we do and maybe user explicitely needs to "ack" (Checkboxes?!) that we do these actions/run dapter as root. And the message should be clear "Dear user, you need to approve that this adapter is allowed to ... Decide carefully" We would need to add that into the install adapter dialog where you choose host and instance number and such. |
I like the popup idea. In that case, we should probably distinguish between required commands (that the adapter needs to function at all) and optional commands (that allow the adapter to do more). |
I would not let the user choose n a command base, ore like
if we want we could do one more with "optional" command, but then it maybe becomes complex And sure we also need to have such a question on cli level :-) |
With ll the things we did so far ... whats really left here or ok for now? |
Everything thats described above is still TODO. This is about managing the permissions using JS-Controller and io-package fields. Currently, we are doing this very manually. |
Here's a collection of things we could improve in order to reduce the hurdles when adapters have to work with
sudo
.Always run specific adapters as
root
Some low-level adapters might need real
root
to do their thing (e.g. RPI2 for the CPU frequency). We could add a flagrunAsRoot
inio-package.json
. If this is set totrue
, the adapter is always executed as root on Unix systems. I think this should be whitelisted in the repo files somehow or at least be questioned before moving an adapter to the stable repo.Specify which commands may be executed with
sudo
We currently whitelist all commands the
iobroker
user may execute as sudo in the installer/fixer. Ideally, this should be configured on a per-adapter basis, e.g. with an option inio-package.json
:or (with optional and required commands):
We would need to provide a shell script that is whitelisted, so only
iobroker
may execute it as root, which adds the commands tosudoers.d/iobroker
. When an adapter is installed, JS-Controller executes that script and passes the required commands.It probably makes sense to compile the entire list on each adapter install/uninstall/update, because some adapters might share the required commands.
Again, we need some form of control over this - probably check it before moving adapters to stable.
@Apollon77 @GermanBluefox your thoughts?
The text was updated successfully, but these errors were encountered: