Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7878d35587 |
@@ -147,6 +147,16 @@ profiles::yum::global::repos:
|
||||
baseurl: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/postgresql/common/redhat/rhel-%{facts.os.release.major}-%{facts.os.architecture}
|
||||
gpgkey: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/postgresql/keys/PGDG-RPM-GPG-KEY-RHEL
|
||||
|
||||
# Rspamd repositories
|
||||
rspamd:
|
||||
ensure: absent
|
||||
name: rspamd
|
||||
descr: rspamd repository
|
||||
target: /etc/yum.repos.d/rspamd.repo
|
||||
baseurl: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/rspamd/rpm-stable/centos-%{facts.os.release.major}/%{facts.os.architecture}
|
||||
gpgkey: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/rspamd/rpm/rspamd.asc
|
||||
mirrorlist: absent
|
||||
|
||||
# Ceph repositories
|
||||
ceph:
|
||||
ensure: absent
|
||||
|
||||
@@ -1,4 +1,58 @@
|
||||
---
|
||||
hiera_include:
|
||||
- redis
|
||||
|
||||
profiles::yum::global::repos:
|
||||
rspamd:
|
||||
ensure: present
|
||||
|
||||
# local redis for rspamd bayes and history; bayes tokens carry a ttl so volatile-ttl can evict
|
||||
redis::maxmemory: '128mb'
|
||||
redis::maxmemory_policy: 'volatile-ttl'
|
||||
|
||||
# local rspamd, deterministic checks only; module defaults cover spf/dkim/dmarc/arc/rbl/phishing/mime_types/fuzzy_check
|
||||
profiles::rspamd::edge::rules:
|
||||
edge.cf: 'https://git.unkin.net/unkin/rspamd-rules/raw/branch/main/edge.cf'
|
||||
profiles::rspamd::edge::local_d:
|
||||
worker-proxy.inc: |
|
||||
bind_socket = "127.0.0.1:11332";
|
||||
milter = yes;
|
||||
timeout = 120s;
|
||||
count = 1;
|
||||
upstream "local" {
|
||||
default = yes;
|
||||
self_scan = yes;
|
||||
}
|
||||
worker-normal.inc: |
|
||||
enabled = false;
|
||||
redis.conf: |
|
||||
servers = "127.0.0.1:6379";
|
||||
actions.conf: |
|
||||
reject = 13;
|
||||
add_header = 6;
|
||||
rewrite_subject = null;
|
||||
greylist = null;
|
||||
greylist.conf: |
|
||||
enabled = false;
|
||||
gpt.conf: |
|
||||
enabled = false;
|
||||
classifier-bayes.conf: |
|
||||
backend = "redis";
|
||||
expire = 8640000;
|
||||
autolearn {
|
||||
spam_threshold = 6.0;
|
||||
ham_threshold = -0.5;
|
||||
check_balance = true;
|
||||
}
|
||||
spamassassin.conf: |
|
||||
ruleset = "/etc/rspamd/rules/*.cf";
|
||||
alpha = 0.1;
|
||||
settings.conf: |
|
||||
smarthost_outbound {
|
||||
priority = high;
|
||||
ip = "103.216.191.185";
|
||||
want_spam = yes;
|
||||
}
|
||||
|
||||
# base postfix configuration (passed to postfix class)
|
||||
postfix::relayhost: 'direct'
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# local rspamd milter for the mail edge gateways
|
||||
# - local_d: /etc/rspamd/local.d file name => content
|
||||
# - rules: /etc/rspamd/rules file name => url, re-fetched every puppet run
|
||||
class profiles::rspamd::edge (
|
||||
Hash[String, String] $local_d = {},
|
||||
Hash[String, Stdlib::HTTPSUrl] $rules = {},
|
||||
) {
|
||||
|
||||
package { 'rspamd':
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
$local_d.each |$name, $content| {
|
||||
file { "/etc/rspamd/local.d/${name}":
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => $content,
|
||||
require => Package['rspamd'],
|
||||
notify => Service['rspamd'],
|
||||
}
|
||||
}
|
||||
|
||||
file { '/etc/rspamd/rules':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
require => Package['rspamd'],
|
||||
}
|
||||
|
||||
$rules.each |$name, $url| {
|
||||
file { "/etc/rspamd/rules/${name}":
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => $url,
|
||||
notify => Service['rspamd'],
|
||||
}
|
||||
}
|
||||
|
||||
# reload keeps the milter answering while config changes apply
|
||||
service { 'rspamd':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
restart => '/usr/bin/systemctl reload rspamd',
|
||||
require => Package['rspamd'],
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ class roles::infra::mail::gateway {
|
||||
}else{
|
||||
include profiles::defaults
|
||||
include profiles::base
|
||||
include profiles::rspamd::edge
|
||||
include profiles::postfix::gateway
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user