AuditNotificationCommands (AdminTask)
We can use the Jython scripting language to manage the security auditing system with wsadmin.sh. Use commands in the AuditNotificationCommands group to configure and manage audit notifications and audit notification monitors.
This topic references one or more of the application server log files. As a recommended alternative, we can configure the server to use the High Performance Extensible Logging (HPEL) log and trace infrastructure instead of using SystemOut.log , SystemErr.log, trace.log, and activity.log files on distributed and IBM i systems. We can also use HPEL in conjunction with the native z/OS logging facilities. If we are using HPEL, we can access all of the log and trace information using the LogViewer command-line tool from the server profile bin directory. See the information about using HPEL to troubleshoot applications for more information on using HPEL.
Use the following commands to configure the security auditing system notifications:
- createAuditNotification
- createAuditNotificationMonitor
- deleteAuditNotification
- deleteAuditNotificationMonitorByName
- deleteAuditNotificationMonitorByRef
- getAuditNotification
- getAuditNotificationMonitor
- getEmailList
- getSendEmail
- getAuditNotificationRef
- getAuditNotificationName
- isSendEmailEnabled
- isAuditNotificationEnabled
- listAuditNotifications
- listAuditNotificationMonitors
- modifyAuditNotification
- modifyAuditNotificationMonitor
- setEmailList
- setSendEmail
createAuditNotification
The createAuditNotification command creates an audit notification object in the audit.xml configuration file.
User must have auditor role.
Target object: None.
Required parameters
- -notificationName
- Unique name to assign the audit notification object. (String, required)
- -logToSystemOut
- Whether the system logs notifications to the SystemOut.log file.(Boolean, required)
- -sendEmail
- Whether to email security auditing subsystem failure notifications. (Boolean, required)
Optional parameters
- -emailList
- Email list to send security auditing subsystem failure notifications. (String, optional)
- -emailFormat
- Email format. Specify HTML for HTML format or TEXT for text format. (String, optional)
Return value
The command returns the shortened reference ID of the new audit notification object, as the following sample output displays:
WSNotification_1184690835390
Batch mode example
- Jython string...
AdminTask.createAuditNotification('[-notificationName mynotification -logToSystemOut true -sendEmail true -emailList admin@mycompany.com(smtp-server.mycompany.com) -emailFormat HTML]')
- Jython list:
AdminTask.createAuditNotification(['-notificationName', 'mynotification', '-logToSystemOut', 'true', '-sendEmail', 'true', '-emailList', 'admin@mycompany.com(smtp-server.mycompany.com)', '-emailFormat', 'HTML'])
Interactive mode
- Jython:
AdminTask.createAuditNotification('-interactive')
createAuditNotificationMonitor
The createAuditNotificationMonitor command creates an audit notification monitor object for the security auditing system. This object monitors the security auditing subsystem for possible failure.
User must have auditor role.
Target object: None.
Required parameters
- -monitorName
- Unique name of the audit notification monitoring object. (String, required)
- -notificationRef
- Reference ID of the audit notification object. (String, required)
- -enable
- Whether to enable the audit notification monitor. (Boolean, required)
Return value
The command returns the shortened form of the reference ID for the audit notification monitor, as the following sample output displays:
AuditNotificationMonitor_1184695615171
Batch mode example
- Jython string...
AdminTask.createAuditNotificationMonitor('-monitorName mymonitor -notificationRef WSNotification_1184690835390 -enable true')
- Jython list:
AdminTask.createAuditNotificationMonitor(['-monitorName', 'mymonitor', '-notificationRef', 'WSNotification_1184690835390', '-enable', 'true'])
Interactive mode
- Jython:
AdminTask.createAuditNotificationMonitor('-interactive')
deleteAuditNotification
The deleteAuditNotification command deletes an audit notification object from the audit.xml configuration file.
User must have auditor role.
Target object: None.
Required parameters
- -notificationRef
- Reference ID of the audit notification object to delete. (String, required)
Return value
Returns true if the system successfully deletes the audit notification object from the audit.xml configuration file.
Batch mode example
- Jython string...
AdminTask.deleteAuditNotification('-notificationRef WSNotification_1184690835390')
- Jython list:
AdminTask.deleteAuditNotification(['-notificationRef', 'WSNotification_1184690835390'])
Interactive mode
- Jython:
AdminTask.deleteAuditNotification('-interactive')
deleteAuditNotificationMonitorByName
The deleteAuditNotificationMonitorByName command deletes the audit notification monitor that the user specifies with the unique name.
User must have auditor role.
Target object: None.
Required parameters
- -monitorName
- Unique name of the audit notification monitor to delete. (String, required)
Return value
Returns true if the system successfully deletes the audit notification monitor from the configuration.
Batch mode example
- Jython string...
AdminTask.deleteAuditNotificationMonitor('-monitorName mymonitor')
- Jython list:
AdminTask.deleteAuditNotificationMonitor(['-monitorName', 'mymonitor'])
Interactive mode
- Jython:
AdminTask.deleteAuditNotificationMonitor('-interactive')
deleteAuditNotificationMonitorByRef
The deleteAuditNotificationMonitorByRef command deletes the audit notification monitor that the user specifies with the reference ID.
User must have auditor role.
Target object: None.
Required parameters
- -monitorRef
- Reference ID of the audit notification monitor object to delete. (String, required)
Return value
Returns true if the system successfully deletes the audit notification monitor of interest.
Batch mode example
- Jython string...
AdminTask.deleteAuditNotificationMonitor('-monitorRef AuditNotificationMonitor_1184695615171')
- Jython list:
AdminTask.deleteAuditNotificationMonitor(['-monitorRef', 'AuditNotificationMonitor_1184695615171'])
Interactive mode
- Jython:
AdminTask.deleteAuditNotificationMonitor('-interactive')
getAuditNotification
The getAuditNotification command retrieves the attributes for an audit notification object of interest.
The user must have the monitor administrative role to run this command.
Target object: None.
Required parameters
- -notificationRef
- Reference ID of the audit notification object of interest. (String, required)
Return value
The command returns a list of attributes for the specific audit notification object, as the following sample output displays:
{{name mynotification} {sslConfig {}} {logToSystemOut true} {_Websphere_Config_Data_Id cells/CHEYENNENode04Cell|audit.xml#WSNotification_1184690835390} {emailList sweetshadow@us.ibm.com(smtp-server.us.ibm.com)} {sendEmail true} {_Websphere_Config_Data_Type WSNotification} {properties {}} {emailFormat HTML}}Batch mode example
- Jython string...
AdminTask.getAuditNotification('-notificationRef WSNotification_1184690835390')
- Jython list:
AdminTask.getAuditNotification(['-notificationRef', 'WSNotification_1184690835390'])
Interactive mode
- Jython:
AdminTask.getAuditNotification('-interactive')
getAuditNotificationMonitor
The getAuditNotificationMonitor command retrieves the attributes that the system associates with the audit notification monitor of interest.
The user must have the monitor administrative role to run this command.
Target object: None.
Required parameters
- -monitorRef
- Reference ID of the audit notification monitor of interest. (String, required)
Return value
The command returns a list of attributes for the audit notification monitor of interest, as the following sample output displays:
{{name mymonitor} {enabled true} {_Websphere_Config_Data_Id cells/Node04Cell|audit.xml#AuditNotificationMonitor_1184695615171} {_Websphere_Config_Data_Type AuditNotificationMonitor} {wsNotification mynotification(cells/Node04Cell|audit.xml#WSNotification_1184690835390)}}Batch mode example
- Jython string...
AdminTask.getAuditNotificationMonitor('-monitorRef AuditNotificationMonitor_1184695615171')
- Jython list:
AdminTask.getAuditNotificationMonitor(['-monitorRef', 'AuditNotificationMonitor_1184695615171'])
Interactive mode
- Jython:
AdminTask.getAuditNotificationMonitor('-interactive')
getEmailList
The getEmailList command retrieves the email distribution list for the audit notification object. If the notification monitor is not configured, the audit notification object is not active and the command returns a null value.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
The command returns this email list for the active audit notification object, as the following sample output displays:
admin@mycompany.com(smtp-server.mycompany.com)
Batch mode example
- Jython string...
AdminTask.getEmailList()
- Jython list:
AdminTask.getEmailList()
Interactive mode
- Jython:
AdminTask.getEmailList('-interactive')
getSendEmail
The getSendEmail command displays whether or not the audit notification object sends an email if the audit subsystem fails. If the notification monitor is not configured, the audit notification object is not active and the command returns a null value.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
Returns true if the system is configured to send an email to the distribution list.
Batch mode example usage
- Jython string...
AdminTask.getSendEmail()
- Jython list:
AdminTask.getSendEmail()
Interactive mode
- Jython:
AdminTask.getSendEmail('-interactive')
getAuditNotificationRef
The getAuditNotificationRef command retrieves the reference ID for the active audit notification object. If the notification monitor is not configured, the audit notification object is not active and the command returns a null value.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
The command returns the reference ID of the audit notification object if it is active, as the following sample output displays:
WSNotification_1184690835390
Batch mode example
- Jython string...
AdminTask.getAuditNotificationRef()
- Jython list:
AdminTask.getAuditNotificationRef()
Interactive mode
- Jython:
AdminTask.getAuditNotificationRef('-interactive')
getAuditNotificationName
The getAuditNotificationName command retrieves the unique name for the active audit notification object. If the notification monitor is not configured, the audit notification object is not active and the command returns a null value.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
The command returns the unique name of the audit notification object, as the following sample output displays:
mynotification
Batch mode example
- Jython string...
AdminTask.getAuditNotificationName()
- Jython list:
AdminTask.getAuditNotificationName()
Interactive mode
- Jython:
AdminTask.getAuditNotificationName('-interactive')
isSendEmailEnabled
The isSendEmailEnabled command determines if the system is configured to send an email if the security auditing subsystem fails.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
Returns true if email notification is enabled.
Batch mode example
- Jython string...
AdminTask.isSendEmailEnabled()
- Jython list:
AdminTask.isSendEmailEnabled()
Interactive mode
- Jython:
AdminTask.isSendEmailEnabled('-interactive')
isAuditNotificationEnabled
The isAuditNotificationEnabled command determines whether the security auditing system notifications are enabled.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
Returns true if security auditing system notifications are enabled.
Batch mode example
- Jython string...
AdminTask.isAuditNotificationEnabled()
- Jython list:
AdminTask.isAuditNotificationEnabled()
Interactive mode
- Jython:
AdminTask.isAuditNotificationEnabled()
listAuditNotifications
The listAuditNotifications command retrieves the attributes for each audit notification object configured in the audit.xml file.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
The command returns a list of attributes for each configured audit notification object, as the following sample output displays:
{{name mynotification} {sslConfig {}} {logToSystemOut true} {_Websphere_Config_Data_Id cells/CHEYENNENode04Cell|audit.xml#WSNotification_1184690835390} {emailList sweetshadow@us.ibm.com(smtp-server.us.ibm.com)} {sendEmail true} {notificationRef WSNotification_1184690835390} {_Websphere_Config_Data_Type WSNotification} {properties {}} {emailFormat HTML}}Batch mode example
- Jython string...
AdminTask.listAuditNotifications()
- Jython list:
AdminTask.listAuditNotifications()
Interactive mode
- Jython:
AdminTask.listAuditNotifications('-interactive')
listAuditNotificationMonitors
The listAuditNotificationMonitors command lists the attributes for the audit notification monitor configured in the audit.xml file.
The user must have the monitor administrative role to run this command.
Target object: None.
Return value
The command returns a list of attributes for the audit notification monitor, as the following sample output displays:
{{name mymonitor} {enabled true} {_Websphere_Config_Data_Id cells/Node04Cell|audit.xml#AuditNotificationMonitor_1184695615171} {_Websphere_Config_Data_Type AuditNotificationMonitor} {monitorRef AuditNotificationMonitor_1184695615171} {wsNotification mynotification(cells/Node04Cell|audit.xml#WSNotification_1184690835390)} {notificationRef WSNotification_1184690835390}}Batch mode example
- Jython string...
AdminTask.listAuditNotificationMonitors()
- Jython list:
AdminTask.listAuditNotificationMonitors()
Interactive mode
- Jython:
AdminTask.listAuditNotificationMonitors('-interactive'b)
modifyAuditNotification
The modifyAuditNotification command edits the audit notification object in the audit.xml configuration file.
User must have auditor role.
Target object: None.
Required parameters
- -notificationRef
- Reference ID of the audit notification object to edit. (String, required)
Optional parameters
- -logToSystemOut
- Whether to log notifications to the SystemOut.log file. (Boolean, optional)
- -sendEmail
- Whether to email notifications. (Boolean, optional)
- -emailList
- Email address of distribution list where the system sends email notifications. (String, optional)
- -emailFormat
- Email format. Specify HTML for HTML format or TEXT for text format. (String, optional)
Return value
Returns true if the system successfully updates the security auditing system configuration.
Batch mode example
- Jython string...
AdminTask.modifyAuditNotification('-notificationRef WSNotification_1184690835390 -logToSystemOut false -sendEmail true -emailList admin@mycompany.com(smtp-server.mycompany.com) -emailFormat TEXT')
- Jython list:
AdminTask.modifyAuditNotification(['-notificationRef', 'WSNotification_1184690835390', '-logToSystemOut', 'false', '-sendEmail', 'true', '-emailList', 'admin@mycompany.com(smtp-server.mycompany.com)', '-emailFormat', 'TEXT'])
Interactive mode
- Jython:
AdminTask.modifyAuditNotification('-interactive')
modifyAuditNotificationMonitor
The modifyAuditNotificationMonitor command edits the audit notification monitor configuration for the security auditing system.
User must have auditor role.
Target object: None.
Required parameters
- -monitorRef
- Reference ID of the audit notification monitor of interest. (String, required)
Optional parameters
- -notificationRef
- Reference ID of the audit notification object. (String, optional)
- -enable
- Whether to enable the audit notification monitor. (Boolean, optional)
Return value
Returns true if the system successfully updates the audit notification monitor configuration.
Batch mode example
- Jython string...
AdminTask.modifyAuditNotificationMonitor('-monitorRef AuditNotificationMonitor_1184695615171 -notificationRef WSNotification_1184690835390 -enable true')
- Jython list:
AdminTask.modifyAuditNotificationMonitor(['-monitorRef', 'AuditNotificationMonitor_1184695615171', '-notificationRef', 'WSNotification_1184690835390', '-enable', 'true'])
Interactive mode
- Jython:
AdminTask.modifyAuditNotificationMonitor('-interactive')
setEmailList
The setEmailList command specifies the distribution list to send email notifications to if the security auditing subsystem fails.
User must have auditor role.
Target object: None.
Required parameters
- -emailList
- Email address or email distribution list to send audit notifications to. (String, required)
Return value
Returns true if the system successfully sets the email notification list for the notification object.
Batch mode example
- Jython string...
AdminTask.setEmailList('[-emailList admin@mycompany.com(smtp-server.mycompany.com)]')
- Jython list:
AdminTask.setEmailList(['-emailList', 'admin@mycompany.com(smtp-server.mycompany.com)'])
Interactive mode
- Jython string...
AdminTask.setEmailList('-interactive')
setSendEmail
The setSendEmail command enables or disables email notifications for the security auditing system.
User must have auditor role.
Target object: None.
Required parameters
- -enable
- Whether to enable the system to send audit notifications by email. (Boolean, required)
Return value
Returns true if the system successfully modifies the configuration.
Batch mode example usage
- Jython string...
AdminTask.setSendEmail('-enable true')
- Jython list:
AdminTask.setSendEmail(['-enable', 'true'])
Interactive mode
- Jython:
AdminTask.setSendEmail('-interactive')
AuditKeyStoreCommands (AdminTask) AuditEmitterCommands (AdminTask) AuditSigningCommands (AdminTask) AuditEncryptionCommands (AdminTask) AuditEventFactoryCommands (AdminTask) AuditFilterCommands (AdminTask) AuditPolicyCommands (AdminTask) AuditEventFormatterCommands (AdminTask)