From 852eb9250c33cf72544630dce05714af7779beac Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 11 Apr 2007 20:28:28 +0000 Subject: [PATCH] - log auth method used - when logging, log all calls (even Get and system calls) --- PLC/Method.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/PLC/Method.py b/PLC/Method.py index f671cdeb..3f58f1fd 100644 --- a/PLC/Method.py +++ b/PLC/Method.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: Method.py,v 1.22 2007/01/19 17:49:02 tmack Exp $ +# $Id: Method.py,v 1.23 2007/02/27 18:46:23 tmack Exp $ # import xmlrpclib @@ -110,8 +110,8 @@ class Method: """ # Do not log system or Get calls - if self.name.startswith('system') or self.name.startswith('Get'): - return False + #if self.name.startswith('system') or self.name.startswith('Get'): + # return False # Create a new event event = Event(self.api) @@ -120,6 +120,12 @@ class Method: # Redact passwords and sessions if args and isinstance(args[0], dict): + # what type of auth this is + if args[0].has_key('AuthMethod'): + auth_methods = ['session', 'password', 'capability', 'gpg', 'hmac','anonymous'] + auth_method = args[0]['AuthMethod'] + if auth_method in auth_methods: + event['auth_method'] = auth_method for password in 'AuthString', 'session': if args[0].has_key(password): auth = args[0].copy() -- 2.47.0