mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
idstools module - add cron job to update rules
This commit is contained in:
13
salt/common/tools/sbin/so-ruleupdate
Normal file
13
salt/common/tools/sbin/so-ruleupdate
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
got_root() {
|
||||
|
||||
# Make sure you are root
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "This script must be run using sudo!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
got_root
|
||||
docker exec -it so-idstools /bin/bash -c 'cd /opt/so/idstools/etc && idstools-rulecat'
|
||||
@@ -21,6 +21,13 @@ idstoolsdir:
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
idstoolslogdir:
|
||||
file.directory:
|
||||
- name: /opt/so/log/idstools
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
idstoolsetcsync:
|
||||
file.recurse:
|
||||
- name: /opt/so/conf/idstools/etc
|
||||
@@ -29,6 +36,12 @@ idstoolsetcsync:
|
||||
- group: 939
|
||||
- template: jinja
|
||||
|
||||
/usr/sbin/so-ruleupdate.sh > /opt/so/log/idstools/download.log:
|
||||
cron.present:
|
||||
- user: root
|
||||
- minute: '1'
|
||||
- hour: '7'
|
||||
|
||||
rulesdir:
|
||||
file.directory:
|
||||
- name: /opt/so/rules/nids
|
||||
|
||||
Reference in New Issue
Block a user