This commit is contained in:
mwiegand 2021-07-09 00:43:29 +02:00
parent b8f5888c3e
commit ca52fc7b64
7 changed files with 32 additions and 4 deletions

View file

@ -1,6 +1,6 @@
connect = host=${host} dbname=${name} user=${user} password=${password}
driver = pgsql
default_pass_scheme = SHA512-CRYPT
default_pass_scheme = ARGON2ID
password_query = SELECT CONCAT(users.name, '@', domains.name) AS user, password\
FROM users \

View file

@ -0,0 +1 @@
www-data ALL=(ALL) NOPASSWD: /usr/bin/doveadm pw -s ARGON2ID

View file

@ -9,7 +9,9 @@ $config['password_log'] = true;
$config['password_hosts'] = null;
$config['password_force_save'] = false;
$config['password_force_new_user'] = false;
$config['password_algorithm'] = 'sha512-crypt';
$config['password_algorithm_prefix'] = '{SHA512-CRYPT}';
$config['password_algorithm'] = 'dovecot';
$config['password_dovecotpw'] = '/usr/bin/sudo /usr/bin/doveadm pw';
$config['password_dovecotpw_method'] = 'ARGON2ID';
$config['password_dovecotpw_with_method'] = true;
$config['password_db_dsn'] = 'pgsql://mailserver:${mailserver_db_password}@localhost/mailserver';
$config['password_query'] = "UPDATE users SET password=%P FROM domains WHERE domains.id = domain_id AND domains.name = %d AND users.name = %l";
$config['password_query'] = "UPDATE users SET password=%D FROM domains WHERE domains.id = domain_id AND domains.name = %d AND users.name = %l";

View file

@ -51,6 +51,9 @@ defaults = {
},
},
},
'sudoers': {
'www-data': ['/usr/bin/doveadm pw -s ARGON2ID'],
},
}
@metadata_reactor.provides(

11
bundles/sudo/items.py Normal file
View file

@ -0,0 +1,11 @@
directories = {
'/etc/sudoers.d': {
'purge': True,
},
}
for user, commands in node.metadata.get('sudoers').items():
files[f'/etc/sudoers.d/{user}'] = {
'content': f"{user} ALL=(ALL) NOPASSWD: {', '.join(commands)}",
'mode': '500',
}

10
bundles/sudo/metadata.py Normal file
View file

@ -0,0 +1,10 @@
defaults = {
'apt': {
'packages': {
'sudo': {},
},
},
'sudoers': {
'root': ['ALL'],
},
}

View file

@ -1,5 +1,6 @@
{
'bundles': [
'sudo',
'users',
'zsh',
],