Skip to content

Commit

Permalink
apparmor: add apparmor_parser config file
Browse files Browse the repository at this point in the history
If the config does not exist, then apparmor_parser will throw a warning.
To avoid that and make the parser configurable, we now add a new option
to it.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
  • Loading branch information
saschagrunert committed Aug 22, 2020
1 parent 6a7b110 commit 2259fbd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nixos/modules/security/apparmor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ in
default = [];
description = "List of packages to be added to apparmor's include path";
};
parserConfig = mkOption {
type = types.str;
default = "";
description = "AppArmor parser configuration file content";
};
};
};

config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.apparmor-utils ];
environment.etc."apparmor/parser.conf".text = cfg.parserConfig;

boot.kernelParams = [ "apparmor=1" "security=apparmor" ];

Expand Down

0 comments on commit 2259fbd

Please sign in to comment.