mirror of https://github.com/CISOfy/lynis.git
Add `Notes` section to `RunCmdAsUser()` comments
This commit is contained in:
parent
ae64484955
commit
181f59c2af
|
@ -3043,6 +3043,18 @@
|
||||||
#
|
#
|
||||||
# Parameters : $@ = command arguments
|
# Parameters : $@ = command arguments
|
||||||
# Returns : None (executes the command as the appropriate user)
|
# Returns : None (executes the command as the appropriate user)
|
||||||
|
# Notes : This allows dropping permissions for specific commands when
|
||||||
|
# lynis is invoked as root, preventing privilege escalation
|
||||||
|
# risks (CWE-250, CWE-271).
|
||||||
|
#
|
||||||
|
# By isolating privileged code and dropping said privileges as
|
||||||
|
# soon as possible, we can execute tools with their proper
|
||||||
|
# permissions, such as in the case of Homebrew.
|
||||||
|
#
|
||||||
|
# When available, we use `sudo` and `su`. For a strictly
|
||||||
|
# POSIX-compliant environment, a C implementation could be
|
||||||
|
# made using `setgid()` and `setuid()`.
|
||||||
|
################################################################################
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
RunCmdAsUser() {
|
RunCmdAsUser() {
|
||||||
|
|
Loading…
Reference in New Issue