29 lines
625 B
Python
29 lines
625 B
Python
from bundlewrap.metadata import atomic
|
|
|
|
defaults = {
|
|
'monit': {
|
|
'services': {
|
|
'openssh': {
|
|
'bin': '/usr/sbin/sshd',
|
|
'systemd_unit': 'sshd',
|
|
'ports': {
|
|
'22': {
|
|
'protocol': 'ssh',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
@metadata_reactor.provides(
|
|
'firewall/port_rules/22',
|
|
)
|
|
def firewall(metadata):
|
|
return {
|
|
'firewall': {
|
|
'port_rules': {
|
|
'22': atomic(metadata.get('openssh/restrict-to', {'*'})),
|
|
},
|
|
},
|
|
}
|