zoukankan      html  css  js  c++  java
  • linux下的audit服务

    audit   ['ɔːdɪt]  审计

    auditd是linux的一个审计服务。

    这是man下的解释

    auditd is the userspace component to the Linux Auditing System. It’s
    responsible for writing audit records to the disk. Viewing the logs is
    done with the ausearch or aureport utilities. Configuring the audit
    rules is done with the auditctl utility. During startup, the rules in
    /etc/audit/audit.rules are read by auditctl. The audit daemon itself
    has some configuration options that the admin may wish to customize.
    They are found in the auditd.conf file.

    安全审计包含了两个部分,其一是:audit审计服务,其二是:syslog日志系统。

    他们的关系如下:

    audit服务专门用来记录安全信息,用于对系统安全事件的追溯;

    syslog日志系统用来记录系统中的各种信息,如安全、调试、运行信息等;

    如果audit服务没有运行,linux内核就会将安全审计信息传递给syslog日志系统。

    syslog会记录系统状态、如硬件的警告和应用软件的记录等。但是syslog属于应用层,且仅止于此一应用而已,没办法记录太多的资讯。因此,audit诞生以取代syslog的责任,来记录核心层的时间:档案的读写,系统呼叫,权限的状态等。

    audit daemon运作和一般的deamon一样,运行后会引入selinux的系统。

    audit有三个操作的工具

    audit可用的三个指令:

    =》auditctl  控制kernel audit system,能取得状态,增加或者删除rules、设定某个档案的[检视]watch.

    =》ausearch 用来查询audit logs 的工具。

    =》aureport 产生audit系统简报的工具。

    配置文件

    audit的配置文件为/etc/audit/audit.rules主要分为三种类别:

    ·basic audit system parameters

    ·file and directory watches

    ·system call audits

     #basic audit system parameters

    这个是一些audit的整体全局参数设置

    #file and directory watches

    这个是目录权限的设置以及是否可以查看某个目录或者文件

    #system call audits

    这个是用来系统调用的规则配置

    对于配置文件有几点要说明一下:

    1.目录观察的详细度要比文件观察低。

    2.无法使用任何的pathname globbing,如?或者*

    3.只能配置已经存在的文件,若配置观察目录而又新增了文件,则新文件只会在下次audit重启后才会加入。

    利用-k产生key string 以供ausearch直接索引

    -w /etc/var/log/audit/ -k LOG_audit

    操作命令

    重启audit

    #service auditd restart

    更新auditd

    #yum update audit

    检查文件和系统的更改状态

    #aureport --start today --event --summary -i

    查询单一文件

    #ausearch -f filename

    利用-ts指定日期-k指定key string,其中password-file使用auditctl -k来产生。

    #ausearch -ts today -k password-file

    #ausearch -ts 3/12/07 -k password-file

    -ui来指定user name(UID),例如找出(uid 516)的操作

    #ausearch -ts today -k password-file -x rm -ui 516

    #ausearch -k passwork-file -ui 516

    转自:http://note.tc.edu.tw/601.html

  • 相关阅读:
    AutoFac
    MEF 基础简介 四
    MEF 基础简介 三
    MEF 基础简介 二
    MEF 基础简介 一
    Ioc原理理解
    .NET里面 abstract class和Interface有什么区别以及用法的展现?
    .NET-ORM框架EF-Code First代码优先
    SQL SERVER PIVOT与用法解释
    SQL Server 中的 NOLOCK 到底是什么意思?
  • 原文地址:https://www.cnblogs.com/z-books/p/4112282.html
Copyright © 2011-2022 走看看