fix[rule]: corrected regex for !log_allowed in sed

command now comments the line instead of deleting
This commit is contained in:
Dan Brodjieski
2025-03-19 12:18:58 -04:00
parent e3429c6abb
commit ef6f6dc55d

View File

@@ -9,7 +9,7 @@ result:
fix: |
[source,bash]
----
/usr/bin/find /etc/sudoers* -type f -exec sed -i '' '/Defaults \!log_allowed/d' '{}' \;
/usr/bin/find /etc/sudoers* -type f -exec sed -i '' '/^Defaults[[:blank:]]*\!log_allowed/s/^/# /' '{}' \;
/bin/echo "Defaults log_allowed" >> /etc/sudoers.d/mscp
----
references: