mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
auto-apply firewall rules
This commit is contained in:
@@ -97,6 +97,8 @@ echo "$IP" >> $local_salt_dir/hostgroups/$ROLE
|
|||||||
if [ "$APPLY" = "true" ]; then
|
if [ "$APPLY" = "true" ]; then
|
||||||
echo "Applying the firewall rules"
|
echo "Applying the firewall rules"
|
||||||
salt-call state.apply firewall queue=True
|
salt-call state.apply firewall queue=True
|
||||||
|
echo "Firewall rules have been applied... Review logs further if there were errors."
|
||||||
|
echo ""
|
||||||
else
|
else
|
||||||
echo "Firewall rules will be applied next salt run"
|
echo "Firewall rules will be applied next salt run"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -54,25 +54,25 @@ fi
|
|||||||
'EVAL' | 'MANAGERSEARCH' | 'STANDALONE' | 'IMPORT')
|
'EVAL' | 'MANAGERSEARCH' | 'STANDALONE' | 'IMPORT')
|
||||||
so-firewall --role=manager --ip="$IP"
|
so-firewall --role=manager --ip="$IP"
|
||||||
so-firewall --role=sensors --ip="$IP"
|
so-firewall --role=sensors --ip="$IP"
|
||||||
so-firewall --apply --role=searchnodes --ip="$IP"
|
so-firewall --apply=true --role=searchnodes --ip="$IP"
|
||||||
;;
|
;;
|
||||||
'SENSOR' | 'SEARCHNODE' | 'HEAVYNODE' | 'IDH' | 'RECEIVER')
|
'SENSOR' | 'SEARCHNODE' | 'HEAVYNODE' | 'IDH' | 'RECEIVER')
|
||||||
case "$ROLE" in
|
case "$ROLE" in
|
||||||
'SENSOR')
|
'SENSOR')
|
||||||
so-firewall --apply --role=sensors --ip="$IP"
|
so-firewall --apply=true --role=sensors --ip="$IP"
|
||||||
;;
|
;;
|
||||||
'SEARCHNODE')
|
'SEARCHNODE')
|
||||||
so-firewall --apply --role=searchnodes --ip="$IP"
|
so-firewall --apply=true --role=searchnodes --ip="$IP"
|
||||||
;;
|
;;
|
||||||
'HEAVYNODE')
|
'HEAVYNODE')
|
||||||
so-firewall --role=sensors --ip="$IP"
|
so-firewall --role=sensors --ip="$IP"
|
||||||
so-firewall --apply --role=heavynodes --ip="$IP"
|
so-firewall --apply=true --role=heavynodes --ip="$IP"
|
||||||
;;
|
;;
|
||||||
'IDH')
|
'IDH')
|
||||||
so-firewall --apply --role=sensors --ip="$IP"
|
so-firewall --apply=true --role=sensors --ip="$IP"
|
||||||
;;
|
;;
|
||||||
'RECEIVER')
|
'RECEIVER')
|
||||||
so-firewall --apply --role=receivers --ip="$IP"
|
so-firewall --apply=true --role=receivers --ip="$IP"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user