Skip to content

Commit 776f5ec

Browse files
authored
add mysql user to carp for makemysql (#353)
1 parent dab9ea8 commit 776f5ec

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

hosts/servers/carp.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
public = true;
3434
};
3535

36-
# this should be in ocf utils package somehow
37-
security.sudo.extraConfig = ''
38-
ALL ALL=(mysql) NOPASSWD: /run/current-system/sw/bin/makemysql-real
39-
'';
40-
4136
age.secrets.makemysql-conf = {
4237
rekeyFile = ../../secrets/master-keyed/carp/makemysql.conf.age;
4338
path = "/opt/share/makeservices/makemysql.conf";

modules/login-server.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ in
7272
ocf.auth.staffOnlySSH = false;
7373
ocf.ttyd.enable = true;
7474

75+
# makemysql-real runs as the mysql user for privilege separation
76+
# TODO rewrite the makemysql script and see if theres a better way to do this?
77+
# just carrying over what was done on our puppet host, tsunami
78+
users.users.mysql = {
79+
isSystemUser = true;
80+
group = "mysql";
81+
};
82+
users.groups.mysql = { };
83+
84+
security.sudo.extraConfig = ''
85+
ALL ALL=(mysql) NOPASSWD: /run/current-system/sw/bin/makemysql-real
86+
'';
87+
7588
security.pam.loginLimits = [
7689
{
7790
domain = "*";

0 commit comments

Comments
 (0)