2021-03-21 09:37:28 +00:00
|
|
|
from bundlewrap.metadata import atomic
|
|
|
|
|
2020-11-14 13:35:54 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
'openssh-client': {},
|
|
|
|
'openssh-server': {},
|
|
|
|
'openssh-sftp-server': {},
|
|
|
|
},
|
|
|
|
},
|
2021-02-18 13:24:57 +00:00
|
|
|
'pacman': {
|
|
|
|
'packages': {
|
|
|
|
'openssh': {},
|
|
|
|
},
|
|
|
|
},
|
2020-11-14 13:35:54 +00:00
|
|
|
}
|
2021-03-21 09:37:28 +00:00
|
|
|
|
|
|
|
@metadata_reactor.provides(
|
2021-06-03 11:59:15 +00:00
|
|
|
'firewall/port_rules/22',
|
2021-03-21 09:37:28 +00:00
|
|
|
)
|
2021-06-03 11:59:15 +00:00
|
|
|
def firewall(metadata):
|
2021-03-21 09:37:28 +00:00
|
|
|
return {
|
2021-06-03 11:59:15 +00:00
|
|
|
'firewall': {
|
2021-03-21 09:37:28 +00:00
|
|
|
'port_rules': {
|
2021-04-04 08:34:55 +00:00
|
|
|
'22': atomic(metadata.get('openssh/restrict-to', {'*'})),
|
2021-03-21 09:37:28 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|