在 Oracle® Solaris 11.2 中管理审计

退出打印视图

更新时间: 2014 年 7 月
 
 

如何清除 not_terminated 审计文件

发生异常系统中断时,如果审计服务的审计文件仍处于打开状态,则审计服务将存在。或者,文件系统无法访问,强制系统切换到新文件系统。在这种情况下,尽管审计文件不再用于审计记录,但此文件仍然保留,并以字符串 not_terminated 作为结束时间戳。使用 auditreduce -O 命令可为此文件提供正确的时间戳。

开始之前

您必须是指定有 "Audit Review"(审计查看)权限配置文件的管理员。有关更多信息,请参见在 Oracle Solaris 11.2 中确保用户和进程的安全 中的使用所指定的管理权限

  1. 在审计文件系统上,按创建顺序列出带有 not_terminated 字符串的文件。
    # ls -R1t audit-directory */* | grep not_terminated
    –R

    列出子目录中的文件。

    –t

    按照从最新到最旧的顺序列出文件。

    –1

    将文件列成一列。

  2. 清除旧的 not_terminated 文件。

    auditreduce -O 命令指定旧文件的名称。

    # auditreduce -O system-name old-not-terminated-file
    
  3. 删除旧的 not_terminated 文件。
    # rm system-name old-not-terminated-file
    
示例 5-16  清除关闭的 not_terminated 审计文件

在以下示例中,查找并重命名 not_terminated 文件,然后删除原始文件。

ls -R1t */* | grep not_terminated
…/egret.1/20100908162220.not_terminated.egret
…/egret.1/20100827215359.not_terminated.egret

# cd */egret.1
# auditreduce -O egret 20100908162220.not_terminated.egret
# ls -1t
20100908162220.not_terminated.egret Current audit file

20100827230920.20100830000909.egret Cleaned-up audit file

20100827215359.not_terminated.egret Input (old) audit file

# rm 20100827215359.not_terminated.egret
# ls -1t
20100908162220.not_terminated.egret Current audit file

20100827230920.20100830000909.egret Cleaned-up audit file

新文件的开始时间戳反映 not_terminated 文件中第一个审计事件的时间。结束时间戳反映此文件中最后一个审计事件的时间。