Desde o CoreOs 766, o subsistema de auditoria está parcialmente integrado:
The audit subsystem has been enabled in the kernel and auditctl added
to the image. Most audit events are ignored by default. The audit
rules may be modified in /etc/audit/rules.d. Note that auditd is not
included, journald is responsible for logging events instead although
it is a best effort mechanism. Unlike with auditd based systems the
kernel will not panic if journald fails to record an event for some
reason.
Eu tentei o seguinte para auditar syscalls em versões 899 e alpha 1000 CoreOs.
# starting a new periodic process:
$ while true; do echo "coreos ..." > /tmp/a.txt && sleep 5s; done &
[1] 4509
# get its pid and add a new audit rule:
$ sudo auditctl -a always,exit -F arch=b64 -S read,write,close,dup2,wait4 -F pid=4509
# wait 5 minutes and check if any audit related event was logged into by the journald:
$ journalctl | grep audit | wc
0 0 0
Por que não consigo ver nenhum evento registrado pelo journald?
O cn.ko
está carregado corretamente e, de acordo com a saída auditctl -l
, a regra é definida com sucesso. Embora pareça que journald
não recebe mensagens da interface netlink.
Eu segui os seguintes passos para ativar a depuração, mas também não deu sugestões:
mkdir -p /etc/systemd/system/systemd-journald.service.d/
vim /etc/systemd/system/systemd-journald.service.d/10-debug.conf
e preenchido com o seguinte conteúdo:
[Service]
Environment=SYSTEMD_LOG_LEVEL=debug
E reinicie o serviço systemd-journald:
systemctl daemon-reload
systemctl restart systemd-journald
dmesg | grep systemd-journald