Log all actions polkit actions

This commit is contained in:
ItsDrike 2024-04-15 22:57:39 +02:00
parent c3dda54f90
commit 4eb78554dd
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
2 changed files with 15 additions and 0 deletions

View file

@ -2,5 +2,6 @@
imports = [
./apparmor.nix
./auditd.nix
./polkit.nix
];
}

View file

@ -0,0 +1,14 @@
{ config, lib, ... }: {
security.polkit = {
enable = true;
debug = lib.mkDefault true;
# Have polkit log all actions, if debug is enabled
extraConfig = lib.mkIf config.security.polkit.debug ''
/* Log authorization checks. */
polkit.addRule(function(action, subject) {
polkit.log("user " + subject.user + " is attempting action " + action.id + " from PID " + subject.pid);
});
'';
};
}