audit 命令
用途
控制系统审计。
语法
描述
audit 命令通过几个关键字控制系统审计。 每次输入命令时必须包括一个关键字。 start 关键字和 shutdown 关键字启动和停止审计系统并重新设置系统配置。 off 关键字和 on 关键字暂挂和重新启动审计系统,且不会影响系统配置。 query 关键字让您查询当前状态。
审计系统遵循以下配置文件中建立的指示信息:
- /etc/security/audit/config
- /etc/security/audit/events
- /etc/security/audit/objects
- /etc/security/audit/bincmds
- /etc/security/audit/streamcmds
在WPAR 中运行时,不支持-@选项。
关键字
| 项 | 描述 |
|---|---|
| 启动 | 启动审计子系统。 此关键字读取配置文件中的指示信息并执行以下任务:
|
| 关闭 | 终止审计记录的收集并通过从内核表中除去类的定义来重新设置配置信息。 根据后端命令的规范,将所有审计记录从内核缓冲区清仓到二进制文件中(包含在用于二进制方式审计的 /etc/security/audit/bincmds 文件中)或审计流中(包含在用于流审计的 /etc/security/audit/streamcmds 文件中)。 审计数据的收集停止,直到给出下一个 audit start 命令才重新开始。 使用-@wparname参数和此关键字时,指定WPAR 的审计将被禁用。 |
| 关 | 暂挂审计系统,但使配置保留有效。 数据收集暂停,直到给出 audit on 命令才重新开始。 此关键字与 -@ 选项一起使用时不受支持。 |
| on[panic | fullpath] | 如果系统正确配置(例如事先使用 audit start 命令且配置依旧有效),那么在暂挂后重新启动审计系统。 如果给出命令时,审计已经启动,那么只有二进制数据收集可以更改。 此关键字与 -@ 选项一起使用时不受支持。 如果指定 panic 选项,那么假如启用二进制数据收集但它们不能写到二进制文件,那么系统将突然停止。 在WPAR 中运行时,不支持panic选项。 如果指定 fullpath 选项,那么 FILE_Open、FILE_Read 和 FILE_Write 审计事件将捕获文件的完整路径名。 |
| 查询 | 查询审计子系统的审计状态。 如果指定-@选项,该关键字将查询全局启动的WPAR 的审计状态。 此关键字按以下格式显示审计子系统的当前状态: |
安全性
访问控制
此命令应向 root 用户和审计组的成员授予执行 (x) 访问权。 对于 root 用户命令是 setuid,并且有可信计算库属性。
访问的文件
| 方式 | 文件 |
|---|---|
| R | /etc/security/audit/config |
| R | /etc/security/audit/objects |
| X | /usr/sbin/auditbin |
| X | /usr/sbin/auditstream |
RBAC 用户和 Trusted AIX 用户注意:该命令可执行特权操作。 只有特权用户才能执行特权限定的操作。 有关权限与特权的更多信息,请参阅安全性中的“特权限定的命令数据库”。 有关与该命令相关联的特权和权限的列表,请参阅 lssecattr 命令或 getcmdattr 子命令。
示例
- To start the audit process, configure the audit system as described in "Setting up Auditing" in 安全, and add the following line to the system initialization file (the /etc/rc in the global environment or the /etc/rc.bootc in WPAR):
每次系统初始化时,审计进程启动(如配置的那样)。/usr/sbin/audit start 1>&- 2>&- - 启动名为WPAR的审计程序wpar1从全局WPAR 输入以下命令:
/usr/sbin/audit start -@ wpar1 - To terminate the operation of the auditing process, enter the following command:
数据收集将停止,直到再次指定 audit start 命令才重新开始。 操作系统内核中的类的配置丢失。/usr/sbin/audit shutdown注:audit shutdown 命令也应位于 /etc/shutdown 文件中。 - 终止名为WPAR的审计程序wpar1从全局WPAR 输入以下命令:
数据收集将停止,直到再次指定 audit start -@ wpar1 命令才重新开始。 操作系统内核中的类的配置丢失。/usr/sbin/audit shutdown -@ wpar1记住 audit shutdown命令不带任何选项,会关闭从全局 WPAR 启动的所有WPAR 的审计进程。
- To suspend the audit subsystem, enter the following command:
/usr/sbin/audit off - 要重新启动被 "审计命令暂停的审计进程,请输入以下命令:
只要系统正确配置,那么暂挂的状态结束,再次生成审计记录。/usr/sbin/audit on - To display the current status of the auditing system, enter the following command:
以下是审计查询状态消息的示例:/usr/sbin/audit query
此查询告诉您当指定的用户登录或注销时、当指定的管理员创建用户或组时,以及当系统接收到对 /etc/security/passwd 文件进行读写的授权的读写指令时,都将写下审计记录。auditing on bin manager is process number 123 audit events: authentication- USER_Login, USER_Logout administration- USER_Create, GROUP_Create audit objects: /etc/security/passwd : r = AUTH_Read /etc/security/passwd : w = AUTH_Write
文件
| 项 | 描述 |
|---|---|
| /etc/security/audit/bincmds | 包含处理审计二进制数据的 shell 命令。 |
| /etc/security/audit/config | 包含审计配置信息。 |
| /etc/security/audit/events | 列出审计事件和它们的尾部格式规范。 |
| /etc/security/audit/objects | 列出了每个文件(对象)的审计事件。 |
| /etc/security/audit/streamcmds | 包含审计流命令。 |
| /etc/rc | 包含系统初始化命令。 |
| /usr/sbin/audit | 包含 audit 命令的路径。 |