2016-07-22 19 views
5

Obecnie chcę, aby usługa auditd uruchomiona była na zawsze, a użytkownik nie może tego zatrzymać za pomocą żadnych poleceń.Zapobieganie zatrzymaniu usługi auditd w Redhat 7

Bieżąca obsługa moja auditd:

~]# systemctl cat auditd 

# /usr/lib/systemd/system/auditd.service 
[Unit] 
Description=Security Auditing Service 
DefaultDependencies=no 
After=local-fs.target systemd-tmpfiles-setup.service 
Conflicts=shutdown.target 
Before=sysinit.target shutdown.target 
RefuseManualStop=yes 
ConditionKernelCommandLine=!audit=0 

[Service] 
ExecStart=/sbin/auditd -n 
## To not use augenrules, copy this file to /etc/systemd/system/auditd.service 
## and comment/delete the next line and uncomment the auditctl line. 
## NOTE: augenrules expect any rules to be added to /etc/audit/rules.d/ 
ExecStartPost=-/sbin/augenrules --load 
#ExecStartPost=-/sbin/auditctl -R /etc/audit/audit.rules 
ExecReload=/bin/kill -HUP $MAINPID 

[Install] 
WantedBy=multi-user.target 


# /etc/systemd/system/auditd.service.d/override.conf 
[Service] 
ExecReload= 
ExecReload=/bin/kill -HUP $MAINPID ; /sbin/augenrules --load 

Nie mogę zatrzymać tę usługę z poleceniem:

# systemctl stop auditd.service 

Failed to stop auditd.service: Operation refused, unit auditd.service may be requested by dependency only. 

Ale kiedy przy użyciu polecenia service auditd stop. Mogę normalnie zatrzymać tę usługę.

# service auditd stop 
Stopping logging:           [ OK ] 

Jak mogę temu zapobiec? Dzięki

+0

Powinieneś dołączyć wyjście "systemctl cat auditd" – Siosm

+0

Dodałem wynik tego polecenia. –

Odpowiedz

3

Administrator (root) zawsze będzie w stanie ręcznie zabić proces auditd (co robi polecenie service). Systemd robi to tylko po to, aby administrator nie mógł tego zrobić poprzez interfejs systemctl.

W obu przypadkach nieuprzywilejowani użytkownicy nie mogą zabić demona.

Jeśli chcesz ograniczyć nawet to, co root może zrobić, będziesz musiał użyć SELinux i dostosować politykę.

Powiązane problemy