AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 752455
Accepted
Wayne Werner
Wayne Werner
Asked: 2016-01-29 09:43:41 +0800 CST2016-01-29 09:43:41 +0800 CST 2016-01-29 09:43:41 +0800 CST

在 Centos7 上生成 /etc/audit/audit.rules 的正确方法是什么?

  • 772

/etc/audit/audit.rules在Centos7的顶部,它告诉我:

## This file is automatically generated from /etc/audit/rules.d

好的,所以我去看看,发现/etc/audit/rules.d/audit.rules。它有以下行

# Feel free to add below this line. See auditctl man page

我做了,发现看起来可能是选项:

 -R file
        Read rules from a file. The rules must be 1 per line and in the order that they are to be executed in. The rule file must  be
        owned  by  root  and not readable by other users or it will be rejected. The rule file may have comments embedded by starting
        the line with a '#' character. Rules that are read from a file are identical to what you would type on a command line  except
        they  are  not preceded by auditctl (since auditctl is the one executing the file) and you would not use shell escaping since
        auditctl is reading the file instead of bash.

但是我跑了auditctl -R /etc/audit/rules.d/audit.rules这似乎工作,但它没有做任何事情/etc/audit/audit.rules。

重新生成该文件的正确方法是什么?

configuration
  • 2 2 个回答
  • 20765 Views

2 个回答

  • Voted
  1. Best Answer
    BurnA
    2016-03-04T20:22:53+08:002016-03-04T20:22:53+08:00

    实用程序 augenrules 从 /etc/audit/rules.d 目录中的 *.rules 文件构建 /etc/audit/audit.rules。

    该实用程序是从 auditd 服务调用的(或者您可以手动调用它,然后加载您发现的规则文件 - 但重新启动服务更简单)。

    我不记得 auditd 系统不能原生使用 systemd 的原因。检查 [email protected] 邮件列表存档。

    • 8
  2. Uwe Steinhau
    2020-09-29T15:43:58+08:002020-09-29T15:43:58+08:00

    文件中规则的重新生成/etc/audit/audit.rules使用/etc/audit/rules.d/. RHEL7/CentOS7 就是这种情况,如果有记忆,RHEL6/CentOS6 也是如此。

    以 root 身份或使用 sudo 执行以下操作:sudo augenrules --check

    如果检测到更改,请更新:sudo augenrules --load

    对文件所做的任何更改/etc/audit/rules.d/现在也应该显示在/etc/audit/audit.rules.

    要确保任何更改都处于活动状态,请重新启动 auditd:sudo systemctl restart auditd

    检查更改是否处于活动状态/正在使用中:sudo auditctl -l | grep -i [your change value]

    如果未找到更改,则 auditd 可能正在“不可变”模式下运行,这意味着您必须重新启动才能使任何更改变为活动状态,因为“不可变”将不允许在运行系统上进行审计更改,即使是 root。如果运行 'immutable',任何 auditd 重新启动尝试都将失败,并且 'systemctl' 应该提醒您注意这一事实。

    • 2

相关问题

  • 小型企业的服务器虚拟化/RAID 配置

  • httpd.conf 用于不区分大小写的文件服务

  • Windows Server 2003 DNS 添加的 CNAME 不起作用

  • 我应该使用什么策略在 linux 上安装 smtp 服务器?用于多线程服务

  • 为什么我的站点在配置为直通身份验证时使用 IUSR 帐户?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve