2020-11-07 21:32:08 +00:00
|
|
|
# WIP
|
|
|
|
defaults = {
|
|
|
|
'apt': {
|
2020-11-08 09:43:51 +00:00
|
|
|
'repos': {
|
|
|
|
'rspamd': {
|
|
|
|
'items': {
|
|
|
|
'deb [arch=amd64] http://rspamd.com/apt-stable/ {os_release} main',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-07 21:32:08 +00:00
|
|
|
'packages': {
|
2020-11-08 09:43:51 +00:00
|
|
|
'clamav': {},
|
|
|
|
'clamav-daemon': {},
|
|
|
|
'clamav-freshclam': {},
|
|
|
|
'clamav-unofficial-sigs': {},
|
2020-11-07 21:32:08 +00:00
|
|
|
'rspamd': {},
|
|
|
|
},
|
|
|
|
},
|
2020-11-21 17:55:45 +00:00
|
|
|
'icinga2_api': {
|
|
|
|
'rspamd': {
|
|
|
|
'services': {
|
|
|
|
'RSPAMD PROCESS': {
|
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C rspamd -c 1:',
|
|
|
|
},
|
|
|
|
'RSPAMD PROXY PORT': {
|
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_tcp -H localhost -p 11332',
|
|
|
|
},
|
|
|
|
'RSPAMD WORKER PORT': {
|
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_tcp -H localhost -p 11333',
|
|
|
|
},
|
|
|
|
'RSPAMD WEB INTERFACE': {
|
|
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_http_url_for_string http://localhost:11334/ "Login to Rspamd"',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-13 11:37:26 +00:00
|
|
|
'backups': {
|
|
|
|
'paths': {
|
|
|
|
'/var/lib/rspamd',
|
|
|
|
},
|
|
|
|
},
|
2020-11-08 09:43:51 +00:00
|
|
|
'cron': {
|
2020-11-08 14:03:26 +00:00
|
|
|
'clamav-unofficial-sigs': f'{node.magic_number%60} */4 * * * clamav /usr/sbin/clamav-unofficial-sigs >/dev/null 2>&1',
|
2020-11-08 09:43:51 +00:00
|
|
|
},
|
2020-11-09 09:52:24 +00:00
|
|
|
'postfix': {
|
|
|
|
'aliases': {
|
|
|
|
'clamav': {
|
|
|
|
'root',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-08 12:16:00 +00:00
|
|
|
'rspamd': {
|
|
|
|
'dkim': repo.vault.password_for(node.name + ' rspamd dkim key'),
|
|
|
|
},
|
2020-11-07 21:32:08 +00:00
|
|
|
}
|
2020-11-08 09:43:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Nodes managed by us should always be able to send mail to all other
|
|
|
|
# servers.
|
2021-01-07 17:44:38 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'rspamd/ignore_spam_check_for_ips',
|
|
|
|
)
|
2020-11-08 09:43:51 +00:00
|
|
|
def populate_permitted_ips_list_with_ips_from_repo(metadata):
|
|
|
|
ips = set()
|
|
|
|
|
|
|
|
for rnode in repo.nodes:
|
2020-11-09 17:46:37 +00:00
|
|
|
for identifier, found_ips in repo.libs.tools.resolve_identifier(repo, rnode.name).items():
|
|
|
|
for ip in found_ips:
|
|
|
|
if not ip.is_private:
|
|
|
|
ips.add(str(ip))
|
2020-11-08 09:43:51 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
'rspamd': {
|
|
|
|
'ignore_spam_check_for_ips': ips,
|
|
|
|
},
|
|
|
|
}
|