bundles/rspamd: first draft for automatically-rotating dkim keys

This commit is contained in:
Franzi 2020-11-08 13:16:00 +01:00
parent 52c36ae3fa
commit 56f1b1a6c6
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 14 additions and 6 deletions

View file

@ -56,11 +56,22 @@ if node.metadata.get('rspamd', {}).get('dkim', False):
for i in {'arc', 'dkim_signing'}:
files[f'/etc/rspamd/local.d/{i}.conf'] = {
'source': 'dkim.conf',
'content_type': 'mako',
'needs': {
'action:rspamd_generate_dkim_key',
},
'triggers': {
'svc_systemd:rspamd:restart',
},
}
actions = {
'rspamd_generate_dkim_key': {
'command': node.metadata['rspamd']['dkim'].format_into('cd /var/lib/rspamd/dkim && /usr/bin/rspamadm dkim_keygen -s "{fault}" -b 2048 -k "{fault}.key" > "{fault}.txt"'),
'unless': node.metadata['rspamd']['dkim'].format_into('test -f "/var/lib/rspamd/dkim/{fault}.key"'),
},
}
if 'password' in node.metadata.get('rspamd', {}):
files['/etc/rspamd/local.d/worker-controller.inc'] = {
'content_type': 'mako',

View file

@ -31,6 +31,9 @@ defaults = {
},
},
},
'rspamd': {
'dkim': repo.vault.password_for(node.name + ' rspamd dkim key'),
},
}

View file

@ -58,11 +58,6 @@ nodes['htz.ex42-1048908'] = {
'deb http://deb.debian.org/debian {os_release}-backports main',
],
},
'rspamd': {
'items': {
'deb [arch=amd64] http://rspamd.com/apt-stable/ {os_release} main',
},
},
'weechat': {
'items': {
'deb https://weechat.org/debian {os_release} main',
@ -304,7 +299,6 @@ nodes['htz.ex42-1048908'] = {
},
},
'rspamd': {
'dkim': True,
'ignore_spam_check_for_ips': {
# entropia
'188.40.158.213',