bundles/openssh: move iptables rules to metadata reactor
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
b943d2d465
commit
c9f008ad82
3 changed files with 14 additions and 6 deletions
|
@ -1 +0,0 @@
|
||||||
iptables_both -A INPUT -p tcp --dport 22 -j ACCEPT
|
|
|
@ -21,11 +21,6 @@ files = {
|
||||||
'action:iptables_enforce',
|
'action:iptables_enforce',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'/etc/iptables-rules.d/00-defaults': {
|
|
||||||
'triggers': {
|
|
||||||
'action:iptables_enforce',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for bundle, rules in node.metadata.get('iptables/bundle_rules', {}).items():
|
for bundle, rules in node.metadata.get('iptables/bundle_rules', {}).items():
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from bundlewrap.metadata import atomic
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
'apt': {
|
'apt': {
|
||||||
'packages': {
|
'packages': {
|
||||||
|
@ -12,3 +14,15 @@ defaults = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@metadata_reactor.provides(
|
||||||
|
'iptables/port_rules/22',
|
||||||
|
)
|
||||||
|
def iptables(metadata):
|
||||||
|
return {
|
||||||
|
'iptables': {
|
||||||
|
'port_rules': {
|
||||||
|
'22': atomic(metadata.get('openssh/restrict-to', set('*'))),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue