Doas – dedicated OpenBSD application subexecutor
flak.tedunangst.com
flak.tedunangst.com
protip: nixos lets you use doas instead of (or in addition to) sudo. Since i run obsd serverside and nixos on the edge, this works great for me
programs.doas.enable = true;
Many sudo policies are often kind of horrible (even by default) and often facilitate privilege escalation, and then there was CVE-2019-14287 ( < 1.8.28 ) and CVE-2021-3156 ( < 1.9.5p2 ) which were plenty nasty. It's just way too huge for a setuid program, security tools shouldn't represent security holes as best as we can get away with it.
[1] https://www.thehacker.recipes/infra/privilege-escalation/uni...
security = {
doas.enable = true;
sudo.enable = false;
};
environment.systemPackages = [ pkgs.doas-sudo-shim ];Ed: previously https://news.ycombinator.com/item?id=9914693
There are, moreover, 2 ports of doas to other systems. OpenDOAS is one. Jesse Smith's https://github.com/slicer69/doas is the other. The latter retains the OpenBSD-specific code, and is the more portable of the two at the expense of only doing everything that the tool is capable of when actually built on OpenBSD.
Love OpenBSD.
Wish so much Hammer2 comes to it because OpenBSD innovates so much but their file system is lacking.
There is an attempt to port DragonflyBDS Hammer2, and hope OpenBSD accepts it.
Last updated 3-days ago.
Some context for them unfamiliar with soft-updates. it is an interesting system where writes are delayed and rearranged so they tend happen in-order, it was supposed to improve speed a bit(more writes in order) and resiliency(fewer states where the file system will corrupt on power outage) but it may have been too clever for it's own good. Nobody in the openbsd project wants to deal with it's complexity while they removes locks from the vfs layer.
However if you're running "sudo bash", you should probably consider setting the root shell appropriately and just use "sudo -l".
The proper fix would be VeraCrypt implementing polkit, but I just use cryptsetup's implementation.
If your linux doas does not timeout, try updating it?
1. http://man.openbsd.org/tty.4#TIOCSETVERAUTH
2. https://github.com/Duncaen/OpenDoas/blob/master/timestamp.c
ITYM "sudo -i" -l lists the programs your user may run as root/the-specified-user
For `sudo -i` you can just use `doas -s`. https://manpages.debian.org/bookworm/opendoas/doas.1.en.html
Keeping the environment via `sudo -E` is slightly trickier. If you need that for a fixed set of commands you can enable keeping the environment for those explicitly via the configuration file using the `keepenv` option. You can also set specific variables for specific commands,
https://manpages.debian.org/bookworm/opendoas/doas.conf.5.en...
But you would need to use a workaround if you want to keep the environment for a command without always adding that to the configuration, one way would to add a wrapper executable and add a permanent rule for that, e.g. something like the following should work:
# reuse the `env` tool, but use an explicit symlink to have clear boundaries
ln -s /bin/env /bin/keep-env
# add rule for keep-env to doas cfg, replace USER with your user name, or prefix with : for a group
echo 'permit persist keepenv USER cmd /bin/keep-env' | tee -a /etc/doas.conf
# run command
doas keep-env THE-ACTUAL-COMMAND
Disclaimer, not deeply tested and there might be even better options, but FWIW, this workaround is at least quite simple in principle."that's some bullshit"
I assume someone just doesn't like that OpenBSD does something other than sudo (which you can actually use either)?