# NativeDefence: Suricata logs on /data (rotated hourly-checked, see logrotate.timer drop-in)
/data/nsm/suricata/*.log /data/nsm/suricata/*.json {
    # The directory belongs to the suricata user: rotate as that user, so a
    # compromised Suricata cannot use links in it against root's logrotate.
    su suricata suricata
    daily
    maxsize 1G
    rotate 30
    maxage 30
    missingok
    notifempty
    compress
    delaycompress
    sharedscripts
    postrotate
        # Reopen log files. Works as root or as the suricata user.
        [ -s /run/suricata/suricata.pid ] && kill -HUP "$(cat /run/suricata/suricata.pid)" 2>/dev/null || true
    endscript
}
