Skip to content

Commit ee64541

Browse files
authored
Merge pull request #31 from wpoely86/sudo
Fix + extend sudo patterns
2 parents aee296e + ef5f0a8 commit ee64541

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

files/sudo

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ 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+
# for PUN of Open Ondemand
10+
SUDO_OOD_PUN COMMAND=/opt/ood/nginx_stage/sbin/nginx_stage %{NOTSPACE:pun_command} -u %{NOTSPACE:pun_user} .*
11+
12+
SUDO_INFO_COMMAND_SUCCESSFUL %{SUDO_USER} : (?:%{SUDO_TTY} ; )?%{SUDO_PWD} ; %{SUDO_RUNAS} ; (?:%{SUDO_OOD_PUN}|%{SUDO_COMMAND})
1013
SUDO_INFO_PAM_UNIX_SESSION_OPENED pam_unix\(sudo:session\): (?<sudo_message>session opened) for user %{NOTSPACE:sudo_runas} by %{SUDO_USER}\(uid=%{NUMBER}\)
1114
SUDO_INFO_PAM_UNIX_SESSION_CLOSED pam_unix\(sudo:session\): (?<sudo_message>session closed) for user %{NOTSPACE:sudo_runas}
1215

tests/data/sudo

+12
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,16 @@ 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+
"pun_command": "pun",
57+
"pun_user": "vsc10520",
58+
},
59+
},
4860
]

0 commit comments

Comments
 (0)