mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 18:22:47 +01:00
[feat] Add common logrotate cron+config
This commit is contained in:
2
salt/common/cron/common-rotate
Normal file
2
salt/common/cron/common-rotate
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
logrotate -f /opt/so/conf/log-rotate.conf >/dev/null 2>&1
|
||||||
25
salt/common/files/log-rotate.conf
Normal file
25
salt/common/files/log-rotate.conf
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/opt/so/log/aptcacher-ng/*.log
|
||||||
|
/opt/so/log/idstools/*.log
|
||||||
|
/opt/so/log/nginx/*.log
|
||||||
|
/opt/so/log/soc/*.log
|
||||||
|
/opt/so/log/kratos/*.log
|
||||||
|
/opt/so/log/kibana/*.log
|
||||||
|
/opt/so/log/elastalert/*.log
|
||||||
|
/opt/so/log/soctopus/*.log
|
||||||
|
/opt/so/log/mysql/*.log
|
||||||
|
/opt/so/log/playbook/*.log
|
||||||
|
/opt/so/log/logstash/*.log
|
||||||
|
/opt/so/log/filebeat/*.log
|
||||||
|
/opt/so/log/telegraf/*.log
|
||||||
|
/opt/so/log/redis/*.log
|
||||||
|
{
|
||||||
|
daily
|
||||||
|
rotate 2
|
||||||
|
missingok
|
||||||
|
copytruncate
|
||||||
|
nocompress
|
||||||
|
create
|
||||||
|
extension .log
|
||||||
|
dateext
|
||||||
|
dateyesterday
|
||||||
|
}
|
||||||
@@ -192,6 +192,27 @@ sensorrotateconf:
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
commonlogrotatescript:
|
||||||
|
file.managed:
|
||||||
|
- name: /usr/local/bin/common-rotate
|
||||||
|
- source: salt://common/cron/common-rotate
|
||||||
|
- mode: 755
|
||||||
|
|
||||||
|
commonlogrotateconf:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/log-rotate.conf
|
||||||
|
- source: salt://common/files/log-rotate.conf
|
||||||
|
- mode: 644
|
||||||
|
|
||||||
|
/usr/local/bin/common-rotate:
|
||||||
|
cron.present:
|
||||||
|
- user: root
|
||||||
|
- minute: '1'
|
||||||
|
- hour: '0'
|
||||||
|
- daymonth: '*'
|
||||||
|
- month: '*'
|
||||||
|
- dayweek: '*'
|
||||||
|
|
||||||
{% if role in ['eval', 'manager', 'managersearch', 'standalone'] %}
|
{% if role in ['eval', 'manager', 'managersearch', 'standalone'] %}
|
||||||
# Add config backup
|
# Add config backup
|
||||||
/usr/sbin/so-config-backup > /dev/null 2>&1:
|
/usr/sbin/so-config-backup > /dev/null 2>&1:
|
||||||
|
|||||||
Reference in New Issue
Block a user