diff --git a/client-cli/pvc/pvc.py b/client-cli/pvc/pvc.py index 151caacc..fb3f917f 100755 --- a/client-cli/pvc/pvc.py +++ b/client-cli/pvc/pvc.py @@ -28,8 +28,11 @@ import time import colorama import yaml import json +import syslog import lxml.etree as etree +from sys import argv + from distutils.util import strtobool from functools import wraps @@ -51,6 +54,22 @@ default_store_data = {"cfgfile": "/etc/pvc/pvcapid.yaml"} config = dict() +# +# Audit function +# +def audit(): + args = argv + args[0] = "pvc" + syslog.openlog(facility=syslog.LOG_AUTH) + syslog.syslog( + 'client audit: command "{}" by user "{}"'.format( + " ".join(args), + os.environ.get("USER", None), + ) + ) + syslog.closelog() + + # # Version function # @@ -5702,6 +5721,8 @@ def cli(_cluster, _debug, _quiet, _unsafe, _colour): ) echo("", err=True) + audit() + # # Click command tree