nixos/mysql: secure access to database in one of the nixos tests
This commit is contained in:
parent
d0a147e841
commit
d9193f9eda
@ -28,6 +28,12 @@ import ./make-test.nix ({ pkgs, ...} : {
|
||||
{
|
||||
users.users.testuser = { };
|
||||
services.mysql.enable = true;
|
||||
services.mysql.initialScript = pkgs.writeText "mariadb-init.sql" ''
|
||||
echo "ALTER USER root@localhost IDENTIFIED WITH unix_socket;"
|
||||
echo "DELETE FROM mysql.user WHERE password = ''' AND plugin = ''';"
|
||||
echo "DELETE FROM mysql.user WHERE user = ''';"
|
||||
echo "FLUSH PRIVILEGES;"
|
||||
'';
|
||||
services.mysql.ensureDatabases = [ "testdb" ];
|
||||
services.mysql.ensureUsers = [{
|
||||
name = "testuser";
|
||||
|
Loading…
x
Reference in New Issue
Block a user