Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upWhonix /etc/sudoers.d exceptions asterix * hardening #2852
Comments
andrewdavidwong
added
C: Whonix
enhancement
labels
Jun 8, 2017
andrewdavidwong
added this to the Release 4.0 milestone
Jun 8, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tasket
Jun 8, 2017
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 date, specifying additional parameters to narrow the modes of use while still leaving * in there or whatever EBNF syntax allows. Obviously, it can't be completely nailed-down if it accepts data to set the system time, for example.
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.
tasket
commented
Jun 8, 2017
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tasket
Jul 15, 2017
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.
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
%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
However, the script '/usr/bin/whonixsetup' appears to accept multiple 'command' options. Perhaps @adrelanos could elaborate on that.
tasket
commented
Jul 15, 2017
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Aug 28, 2017
Member
|
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).
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tasket
Oct 31, 2017
FYI this is still on my todo list, I just want to get to VPN and template-reinstall fixes first.
tasket
commented
Oct 31, 2017
|
FYI this is still on my todo list, I just want to get to VPN and template-reinstall fixes first. |
adrelanos commentedJun 8, 2017
Whonix uses
*in a few/etc/sudoers.dfiles.Quote @marmarek #2695 (comment)
TODO: harden this. Don't use
*wherever possible.Do you think you could work on this? @tasket @crat0z