跳到主要内容

需求:对WAS管理员通过ISC控制台的操作开启审计,记录到日志文件中

三个配置组件的关系

1. AuditServiceProvider(审计服务提供者)

  • 作用:审计系统的核心组件,负责处理和存储审计事件
  • 功能:接收审计事件并将其路由到合适的输出目标 

2. BinaryEmitter(二进制发射器)

  • 作用:AuditServiceProvider的具体实现之一,负责将审计记录以二进制格式输出到文件
  • 功能:将审计事件转换为二进制格式并写入审计日志文件 

3. AuditFilter(审计过滤器)

  • 作用:决定哪些安全事件需要被审计
  • 功能:根据配置的规则过滤和选择需要记录的安全事件

三者关系图

AuditFilter → AuditServiceProvider → BinaryEmitter
↓ ↓ ↓
事件过滤 事件处理 文件输出

以 IBM WebSphere Application Server 管理控制台为例:

1) 启用审计服务

  • 导航:Security > Global security > Auditing
  • 勾选:Enable auditing
  • 选择或确认 Audit service provider(通常为缺省提供者)

2) 配置 AuditFilter(放行管理员变更事件)

  • 在同一审计页面或“Audit service provider”下,进入 Filters 或 Audit filters 配置。
  • 勾选或添加与“管理操作”相关的事件类别/组件,常见包括:
    • SECURITY_ADMIN(安全/管理类事件)
    • ADMIN_ACTIVITY 或 CONFIGURATION_CHANGE(不同版本命名可能不同)
  • 若有粒度设置:
    • 事件类型:创建/修改/删除(Create/Update/Delete)
    • 作用域:Cell/Node/Server 级别的管理操作
    • 严重性:建议从默认或较宽松开始,确认捕获后再收紧

3) 配置输出器(Emitter)

  • 在审计配置中找到 Emitters 或 Audit event emitters
  • 选择并启用 BinaryEmitter
    • 设置输出文件路径,例如:${WAS_PROFILE_ROOT}/logs/audit/audit.log
    • 配置文件滚动与大小限制(如:最大大小、滚动文件数)

1.连接wsadmin命令行

bash /opt/IBM/WebSphere/wp_profile/bin/wsadmin.sh -lang jython -username wpsadmin -password passw0rd
WASX7209I: Connected to process “dmgr” on node dmgrNode01 using SOAP connector; The type of process is: DeploymentManager
WASX7031I: For help, enter: “print Help.help()”

2.创建审计事件过滤器AuditFilter
wsadmin>AdminTask.createAuditFilter(‘-interactive’)
Defines an Audit Specification in the audit.xml file

Creates an entry in the audit.xml to reference an Audit Specification. Enables the specification by default.

*Unique name (name): audit-filter
*Event type (eventType): SECURITY_AUTHN,SECURITY_AUTHZ,SECURITY_RESOURCE_ACCESS
*Audit outcome (outcome): REDIRECT, ERROR, DENIED, WARNING

Defines an Audit Specification in the audit.xml file

F (Finish)
C (Cancel)

Select [F, C]: [F] F
WASX7278I: Generated command line: AdminTask.createAuditFilter(‘[-name audit-filter -eventType SECURITY_AUTHN,SECURITY_AUTHZ,SECURITY_RESOURCE_ACCESS -outcome “REDIRECT, ERROR, DENIED, WARNING” ]’)

输出
u’AuditSpecification_1756563579661′

3.创建审计配置BinaryEmitter

wsadmin>AdminTask.createBinaryEmitter(‘-interactive’)
Defines the Binary Emitter implemention in the audit.xml file

Creates an entry in the audit.xml to reference the configuration of the Binary File Emitter implementation of the Service Provider interface.

*Unique name (uniqueName): audit-emit
*Class name (className): com.ibm.ws.audit.service.impl.BinaryFileServiceProvider
Event Formatter class name (eventFormatterClass): com.ibm.ws.audit.service.impl.BinaryEventFormatter
*File location (fileLocation): /opt/IBM/WebSphere/AppServer/profiles/wp_profile/logs/audit
Maximum file size (maxFileSize): 100
Maximum number of logs (maxLogs): 10
*Customizable Binary audit log wrapping behavior (wrapBehavior): ROLLOVER
*Audit filters (auditFilters): AuditSpecification_1756563579661

Defines the Binary Emitter implemention in the audit.xml file

F (Finish)
C (Cancel)

Select [F, C]: [F] F

wsadmin>AdminTask.createBinaryEmitter(‘[-uniqueName audit-emit -className com.ibm.ws.audit.service.impl.BinaryFileServiceProvider -eventFormatterClass com.ibm.ws.audit.service.impl.BinaryEventFormatter -fileLocation /opt/IBM/WebSphere/AppServer/profiles/wp_profile/logs/audit -maxFileSize 100 -maxLogs 10 -wrapBehavior WRAP -auditFilters AuditSpecification_1756563579661 ]’)

输出
u’AuditServiceProvider_1756561562448′

4.保存设置

wsadmin>AdminConfig.save()
u”

wsadmin>exit

留下回复