Skip to content

Commit

Permalink
Add log rotation for Suricata
Browse files Browse the repository at this point in the history
Signed-off-by: KheOps <kheops@ceops.eu>
  • Loading branch information
kheops2713 committed Mar 12, 2015
1 parent f68db3c commit 2c426de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/common/tasks/ids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
template: src=disable-network-offload-cron.j2 dest=/etc/cron.d/disable-network-offload-{{ monitored_interface }} owner=root group=root mode=0644
tags: base

- name: Install log rotation for Suricata log files
template: src=logrotate-suricata.j2 dest=/etc/logrotate.d/suricata owner=root group=root mode=0644
tags: base

- name: Install Suricata configuration file
template: src=suricata.yaml.j2 dest=/etc/suricata/suricata.yaml owner=root group=root mode=0644
notify:
Expand Down
12 changes: 12 additions & 0 deletions roles/common/templates/logrotate-suricata.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/var/log/suricata/*.log {
weekly
compress
rotate 12
mail {{ admin_email }}
missingok
create
sharedscripts
postrotate
/bin/kill -HUP $(cat /var/run/suricata/suricata.pid)
endscript
}

0 comments on commit 2c426de

Please sign in to comment.