I am used to set
Default timestamp_timeout=0
in /etc/sudoers
via the visudo
command when configuring a new macOS. The reason originally was that applications can start shell scripts and it used to be that an application constantly trying to run sudo in the background would be able to hijack the lingering sudo credentials (because it spawned the same TTY if I recall correctly) and get root access (ugh). Hence, I always set the timeout to 0 so I have to enter the password for every sudo command. Which is a pain, but more secure.
However, if that particular road has been closed, I could maybe make life a bit more comfortable by setting it to a fraction of a minute. Can I? Or is it still a security risk, something that can be hijacked?