-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Whonix /etc/sudoers.d exceptions wildcard / asterix * hardening #2852
Comments
I can start looking at a few of the commands to see how they're used in Whonix under core use cases such as 'browse web site' and 'update system'. Just want to say that Whonix is not my strong suit, though. Tightening these entries means for some commands like Optimal configuration should take into account whether the command is used in a purely automatic function or user-initiated. With the former, system startup and cron should not be an issue because as a general rule these are run as root user. With the latter, it may be best to let the system trigger an auth prompt in certain cases. Whether a user-initiated function is considered an admin tool or just an app (like Torbrowser) also matters; the latter type should be usable without any auth prompts. OTOH, admin functions launched from dom0 menu could simply specify a privileged user like root to avoid auth prompts. |
Initial look at These rules are specified by the Apart from that, the line referencing '/usr/lib/sdwdate/restart_fresh' is a script that takes no parameters anyway, so '*' can be removed there. For whonix-setup-wizard, I think these lines
...can be changed to
However, the script '/usr/bin/whonixsetup' appears to accept multiple 'command' options. Perhaps @adrelanos could elaborate on that. |
tasket:
Initial look at `sdwdate`:
These rules are specified by the `sdwdate` documentation for using
this service as "non-root user". Its precarious to second-guess
Patrick's design; normally I would say this is a security issue
internal to the tool. I would leave most of those (first 7) rules
as-is, or re-factor sdwdate in some way such as running only the HTTP
part as unpriv user.
Please feel free to review and improve that design.
Apart from that, the line referencing
'/usr/lib/sdwdate/restart_fresh' is a script that takes no parameters
anyway, so '*' can be removed there.
Yes.
---
For whonix-setup-wizard, I think these lines ``` %sudo ALL=NOPASSWD:
/usr/bin/whonix-setup-wizard * %sudo ALL=NOPASSWD:
/usr/lib/whonix-setup-wizard/whonix-setup-wizard-setup * ``` ...can
be changed to ``` %sudo ALL=NOPASSWD: /usr/bin/whonix-setup-wizard
%sudo ALL=NOPASSWD: /usr/bin/whonix-setup-wizard locale_settings
%sudo ALL=NOPASSWD:
/usr/lib/whonix-setup-wizard/whonix-setup-wizard-setup ```
Possible /usr/bin/whonix-setup-wizard parameters are:
setup
repository
locale_settings
Please add.
However, the script '/usr/bin/whonixsetup' appears to accept multiple
'command' options. Perhaps @adrelanos could elaborate on that.
There are none. Just "sudo whonixsetup" (cli version).
|
FYI this is still on my todo list, I just want to get to VPN and template-reinstall fixes first. |
The use of asterix
Suggestions on how to get rid of the remaining ones? |
The easier ones should be whonixcheck and openvpn. My first inclination is to disable the Suggestion for |
- quote sclockadj shell command - quote /bin/date shell command - output sclockadj command in log QubesOS/qubes-issues#2852
whonixcheck is sorted. Let's look into sdwdate / sclockadj. Two ideas:
Then sudoers could be as simple as:
sdwdate log:
I am not good at regex. /bin/date: Could anyone provide a regex for (An
sclockadj: Could anyone provide a regex for (Maybe a (Probably not "20" but I would have to think about a good maximum and modify sdwdate accordingly.) |
improve sclockadj parameter parsing check output and exit code of /bin/date in case it fails due to sudoers.d hardening QubesOS/qubes-issues#2852
In what context is it callled? Is it only sdwdate service running as
unprivileged user? Maybe adding CAP_SYS_TIME to its systemd unit file is
enough and no root access is needed at all?
|
Yes.
Great suggestion, implemented! The use of asterix / wildcard
The remaining one is a comment / documentation issue (out commented by default) and should be fixable as well. |
This looks really good in Whonix 15 (still).
The following is a comment only.
Ideally it should get fixed too. So no default sudo wildcard / asterix |
This is good enough. All solved. Except for that comment.
But even then I think it is OK. Documentation issue. User tunnel needs to be able to run openvpn with any combination of commands. Would be hard to restrict that and needs to be left as an exercise for the user. Added a documentation comment. |
Whonix uses
*
in a few/etc/sudoers.d
files.Quote @marmarek #2695 (comment)
TODO: harden this. Don't use
*
wherever possible.Do you think you could work on this? @tasket @crat0z
The text was updated successfully, but these errors were encountered: