Open ArrayBolt3 opened 12 hours ago
(As a followup, if Qubes OS is receptive to the idea of supporting the use of doas
in Qubes that go out of their way to support it, Whonix is interested in contributing the code and documentation needed to implement this.)
I think instead of inventing a dedicated qubes-doas-config
package, we could simply put the doas configuration file into the same package.
For example the qubes-core-agent
package is currently shipping sudoers.d configuration snippet file /etc/sudoers.d/qt_x11_no_mitshm
.
For doas
support, above confirmation file could remain existing as is.
sudo
, Qubes can do so.doas
, then users who wish/need to go back to sudo
could simply do so too.What could be contributed here is adding an additional file to the qubes-core-agent
package. The doas
configuration snippet /etc/doas.d/qt_x11_no_mitshm
. [1]
So Qubes has nothing to loose here. At worst, A few additional files which are ignored by sudo
and everything else.
Is this feasible? Yes, very much so. [2]
[1] Adding /etc/doas.d
support (doas
configuration snippet d.
drop-in folder) is already planned, pending implementation.
[2] If acceptable to Qubes, this would most likely by contributed by @ArrayBolt3, who recently landed a much more complicated source code contribution: https://github.com/QubesOS/qubes-gui-daemon/pull/149 (unrelated to this ticket)
If Qubes wishes to stay on
sudo
, Qubes can do so.
If I understand @ArrayBolt3 correctly, that's not necessarily the case. If the goal is to not have sudo
installed at all, then no Qubes package can use sudo
internally either. There aren't many such cases, but there are a few:
qvm-connect-tcp
(when handling ports below 1024)
How to file a helpful issue
The problem you're addressing (if any)
All official Qubes OS templates currently use
sudo
as a privilege escalation framework. This is mandatory, as Qubes OS ships somesudoers
configuration files, which obviously won't be usable withoutsudo
. Not all distros and users necessarily want to usesudo
, however - it's big and complicated, thus potentially more vulnerable than a simpler privilege escalation framework.Whonix in particular is currently looking into the possibility of porting over our existing
sudoers
configuration todoas
, allowing us to replacesudo
withdoas
. In the event we do attempt to migrate todoas
, we do not want to have bothsudo
anddoas
installed in the Whonix VMs since that results in an increase of attack surface rather than a decrease. Since Qubes OS is a top-priority platform for Whonix, we cannot port fromsudo
todoas
without there beingdoas
configuration that replaces Qubes OS's existingsudoers
config present within individual Qubes.The solution you'd like
Ideally, there would be
doas
configuration snippets that would be able to replace thesudoers
config shipped by Qubes OS packages. That way, any Qubes that useddoas
could simply use aqubes-doas-config
package rather than whatever package ships thesudoers
config. (If thesudoers
config is currently bundled into a package, obviously it would have to be split out for this to work.) Additionally, any parts of Qubes OS that currently usesudo
to elevate privileges within a Qube would have to be adjusted to usedoas
when appropriate, and documentation that instructs the user to usesudo
would have to be adjusted to mentiondoas
if that documentation was applicable to any official Qubes that useddoas
.The value to a user, and who that user might be
Any users who are using a defense-in-depth strategy by disabling passwordless sudo within individual Qubes would potentially benefit from this. The only valid reason to disable passwordless sudo within a Qube is to make it harder for an attacker to attempt any attacks against Xen or dom0, by requiring them to bypass the in-Qube privilege restrictions first. It is theoretically easier to bypass the in-Qube restrictions if
sudo
is in use than ifdoas
is in use, due tosudo
's much larger size and much more powerful (and easy to mess up with) configuration file format. In contrast,doas
is many times smaller thansudo
, and features a much less powerful configuration file format that is harder to make mistakes with. Thus for users who are bothering with disabling passwordless sudo, usingdoas
in place ofsudo
in at least some Qubes should result in an even harder-to-breach first line of defense.For obvious reasons, users who are leaving passwordless sudo enabled on all of their Qubes will not see any significant security benefit from this change.
Completion criteria checklist
(This section is for developer use only. Please do not modify it.)