Add system user and group for webref in NixOS tests. Update database accessibility check to use webref user for improved security testing.
This commit is contained in:
@@ -158,6 +158,13 @@
|
||||
}];
|
||||
};
|
||||
|
||||
# Create system user for testing
|
||||
users.users.webref = {
|
||||
isSystemUser = true;
|
||||
group = "webref";
|
||||
};
|
||||
users.groups.webref = {};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
python3
|
||||
nmap
|
||||
@@ -169,7 +176,7 @@
|
||||
start_all()
|
||||
machine.wait_for_unit("postgresql.service")
|
||||
|
||||
# Verify database is accessible locally
|
||||
# Verify database is accessible with webref user
|
||||
machine.succeed("sudo -u webref psql webref -c 'SELECT 1;'")
|
||||
|
||||
machine.succeed("echo '✅ Security test passed'")
|
||||
|
||||
Reference in New Issue
Block a user