From 82b0301c0e45e7f7d167116ab1e0dcca987fbc10 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 25 Oct 2023 09:48:48 -0400 Subject: [PATCH] Improve audit log output Show the full command path in the actual audit log message, but still only show the command name in the prefix. --- client-cli/pvc/cli/helpers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client-cli/pvc/cli/helpers.py b/client-cli/pvc/cli/helpers.py index 76b0e791..ad331135 100644 --- a/client-cli/pvc/cli/helpers.py +++ b/client-cli/pvc/cli/helpers.py @@ -65,10 +65,9 @@ def audit(): """ args = argv - args[0] = "pvc" pid = getpid() - openlog(facility=LOG_AUTH, ident=f"{args[0]}[{pid}]") + openlog(facility=LOG_AUTH, ident=f"{args[0].split('/')[-1]}[{pid}]") syslog( f"""client audit: command "{' '.join(args)}" by user {environ.get('USER', None)}""" )