mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-21 11:18:06 +00:00
mirror_traffic_to_ids_iptables: rule update for IDS traffic mirroring
This commit is contained in:
@@ -5,11 +5,21 @@ class mirror_traffic_to_ids_iptables::install {
|
||||
ensure_packages(['iptables-persistent'])
|
||||
|
||||
# force it to not be enabled because the interface in the config may be wrong
|
||||
exec { 'save iptables':
|
||||
exec { 'save iptables prerouting':
|
||||
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
|
||||
command => "iptables -t mangle -A PREROUTING -i `ls /sys/class/net | grep lo -v | head -n1` -j TEE --gateway $ids_IP_address ; iptables-save > /etc/iptables/rules.v4",
|
||||
provider => shell,
|
||||
}->
|
||||
exec { 'save iptables forward':
|
||||
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
|
||||
command => "iptables -t mangle -A FORWARD -i `ls /sys/class/net | grep lo -v | head -n1` -j TEE --gateway $ids_IP_address ; iptables-save > /etc/iptables/rules.v4",
|
||||
provider => shell,
|
||||
}->
|
||||
exec { 'save iptables output':
|
||||
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
|
||||
command => "iptables -t mangle -A OUTPUT -i `ls /sys/class/net | grep lo -v | head -n1` -j TEE --gateway $ids_IP_address ; iptables-save > /etc/iptables/rules.v4",
|
||||
provider => shell,
|
||||
}->
|
||||
service { 'netfilter-persistent':
|
||||
enable => true,
|
||||
ensure => 'running',
|
||||
|
||||
Reference in New Issue
Block a user