👚 “The audit system is in immutable mode, no rules loaded” при запуске службы Auditd |

👚 “The audit system is in immutable mode, no rules loaded” при запуске службы Auditd

Мануал

Проблема

Auditd запускается в неизменяемом режиме –

# service auditd restart  
 Stopping auditd:             [OK]  
 Error deleting rule (Operation not permitted)  
 Starting auditd:             [OK]  
 The audit system is in immutable mode, no rules loaded

Первопричина

Auditd может быть настроен в неизменяемом режиме с опцией: -e 2::

# auditctl -e 2

из руководства auditctl:

# man auditctl
e [0..2]
Set enabled flag. When 0 is passed, this can be used to temporarily disable auditing.
When 1 is passed as an argument, it will enable auditing.
To lock the audit configuration so that it can’t be changed, pass a 2 as the argument.
Locking the configuration is intended to be the last command in audit.rules for anyone wishing this feature to be active.
Any attempt to change the configuration in this mode will be audited and denied.
The configuration can only be changed by rebooting the machine.

Например

# auditctl -e 2  
service auditd start  
Starting auditd: [ OK ]  
The audit system is in immutable mode, no rules loaded

Решение

1. Удалите «-e 2», если он присутствует в файле /etc/audit/audit.rules.

Для сброса неизменяемой опции требуется перезагрузка.

# vi /etc/audit/audit.rules

2. Если вы попытаетесь отобразить команды в /etc/audit/audit.rules, то он не сообщит, что файл является неизменяемым, в отличие от использования audtictl. Например:

# service auditd restart
Stopping auditd:                                           [  OK  ]
Error sending enable request (Operation not permitted)
Starting auditd:                                           [  OK  ]
The audit system is in immutable mode, no rule changes allowed

# auditctl -s
AUDIT_STATUS: enabled=2 flag=1 pid=1472 rate_limit=0 backlog_limit=64 lost=0 backlog=0

# auditctl -w /etc/ -p wa 
The audit system is in immutable mode, no rule changes allowed
# echo "-w /etc/ -p wa" > /etc/audit/audit.rules 

# auditctl -l
No rules

# cat /etc/audit/audit.rules 
-w /etc/ -p wa

Но на самом деле нет реальных правил, загружаемых в ядро, а просто на диск

# auditctl -l > file
# diff -u file /etc/audit/audit.rules 
--- file    2015-11-24 15:55:58.152082179 -0500
+++ /etc/audit/audit.rules  2015-11-24 15:46:16.856076936 -0500
@@ -1 +1 @@
-No rules
+-w /etc/ -p wa

3. Лучший способ подтвердить и внести любые необходимые изменения, чтобы избежать путаницы, – использовать команду augenrules:

# augenrules --check
/sbin/augenrules: Rules have changed and should be updated

 

Пожалуйста, не спамьте и никого не оскорбляйте. Это поле для комментариев, а не спамбокс. Рекламные ссылки не индексируются!
Добавить комментарий