firewall: generally accept "jump" param and use tripleo:firewall for log rule
Tentative fix for bug #1669763, trying to use the same class for every rule we want to add to the chain. Change-Id: I4ba451c1b258391c8f1cfb4d73e38828c437b1c1 Closes-Bug: #1669763
This commit is contained in:

committed by
Alex Schultz

parent
bd89e21fe8
commit
c0c850d598
@@ -36,7 +36,7 @@ class tripleo::firewall::post(
|
|||||||
if $debug {
|
if $debug {
|
||||||
warning('debug is enabled, the traffic is not blocked.')
|
warning('debug is enabled, the traffic is not blocked.')
|
||||||
} else {
|
} else {
|
||||||
firewall { '998 log all':
|
tripleo::firewall::rule{ '998 log all':
|
||||||
proto => 'all',
|
proto => 'all',
|
||||||
jump => 'LOG',
|
jump => 'LOG',
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,10 @@
|
|||||||
# (optional) The action policy associated to the rule.
|
# (optional) The action policy associated to the rule.
|
||||||
# Defaults to 'accept'
|
# Defaults to 'accept'
|
||||||
#
|
#
|
||||||
|
# [*jump*]
|
||||||
|
# (optional) The chain to jump to.
|
||||||
|
# If present, overrides action
|
||||||
|
#
|
||||||
# [*state*]
|
# [*state*]
|
||||||
# (optional) Array of states associated to the rule..
|
# (optional) Array of states associated to the rule..
|
||||||
# Defaults to ['NEW']
|
# Defaults to ['NEW']
|
||||||
@@ -75,6 +79,7 @@ define tripleo::firewall::rule (
|
|||||||
$chain = 'INPUT',
|
$chain = 'INPUT',
|
||||||
$destination = undef,
|
$destination = undef,
|
||||||
$extras = {},
|
$extras = {},
|
||||||
|
$jump = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if $port == 'all' {
|
if $port == 'all' {
|
||||||
@@ -85,16 +90,25 @@ define tripleo::firewall::rule (
|
|||||||
$port_real = $port
|
$port_real = $port
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $jump != undef {
|
||||||
|
$jump_real = $jump
|
||||||
|
$action_real = undef
|
||||||
|
} else {
|
||||||
|
$jump_real = undef
|
||||||
|
$action_real = $action
|
||||||
|
}
|
||||||
|
|
||||||
$basic = {
|
$basic = {
|
||||||
'port' => $port_real,
|
'port' => $port_real,
|
||||||
'dport' => $dport,
|
'dport' => $dport,
|
||||||
'sport' => $sport,
|
'sport' => $sport,
|
||||||
'proto' => $proto,
|
'proto' => $proto,
|
||||||
'action' => $action,
|
'action' => $action_real,
|
||||||
'source' => $source,
|
'source' => $source,
|
||||||
'iniface' => $iniface,
|
'iniface' => $iniface,
|
||||||
'chain' => $chain,
|
'chain' => $chain,
|
||||||
'destination' => $destination,
|
'destination' => $destination,
|
||||||
|
'jump' => $jump_real,
|
||||||
}
|
}
|
||||||
if $proto == 'icmp' {
|
if $proto == 'icmp' {
|
||||||
$ipv6 = {
|
$ipv6 = {
|
||||||
|
Reference in New Issue
Block a user