Skip to content

Commit cd03e98

Browse files
committed
fix sudo
1 parent aee296e commit cd03e98

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

files/sudo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SUDO_COMMAND COMMAND=%{GREEDYDATA:sudo_command}
66
SUDO_USER %{NOTSPACE:sudo_user}
77
SUDO_RUNAS USER=%{NOTSPACE:sudo_runas}
88

9-
SUDO_INFO_COMMAND_SUCCESSFUL %{SUDO_USER} : %{SUDO_TTY} ; %{SUDO_PWD} ; %{SUDO_RUNAS} ; %{SUDO_COMMAND}
9+
SUDO_INFO_COMMAND_SUCCESSFUL %{SUDO_USER} : (?:%{SUDO_TTY} ; )?%{SUDO_PWD} ; %{SUDO_RUNAS} ; %{SUDO_COMMAND}
1010
SUDO_INFO_PAM_UNIX_SESSION_OPENED pam_unix\(sudo:session\): (?<sudo_message>session opened) for user %{NOTSPACE:sudo_runas} by %{SUDO_USER}\(uid=%{NUMBER}\)
1111
SUDO_INFO_PAM_UNIX_SESSION_CLOSED pam_unix\(sudo:session\): (?<sudo_message>session closed) for user %{NOTSPACE:sudo_runas}
1212

tests/data/sudo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,15 @@ data = [
4545
"sudo_command": "../../../module/harm/plugin/script/harm_mgr.sh floatIP.sh status active key1=value1; 0 ha2",
4646
},
4747
},
48+
{
49+
"raw": "<85>1 2025-03-18T15:11:22.912566+01:00 ood11 sudo: - sudo: apache : PWD=/ ; USER=root ; COMMAND=/opt/ood/nginx_stage/sbin/nginx_stage pun -u vsc10520 -a https%3a%2f%2fportal.hpc.vub.be%3a443%2fnginx%2finit%3fredir%3d%24http_x_forwarded_escaped_uri",
50+
"expected": {
51+
"@source_host": "ood11",
52+
"program": "sudo",
53+
"sudo_pwd": "/",
54+
"sudo_runas": "root",
55+
"sudo_user": "apache",
56+
"sudo_command": "/opt/ood/nginx_stage/sbin/nginx_stage pun -u vsc10520 -a https%3a%2f%2fportal.hpc.vub.be%3a443%2fnginx%2finit%3fredir%3d%24http_x_forwarded_escaped_uri",
57+
},
58+
},
4859
]

0 commit comments

Comments
 (0)