git.iko.soy/typeable/nixpkgs
on master help sign in
dnscrypt-proxy service: update AppArmor profile

This patch fixes the AppArmor profile path clause and adds (currently ignored) network rules. The AppArmor profile used to be defined for the path sbin/dnscrypt-proxy, but the real path is bin/dnscrypt-proxy (due to sbin now being a symlink to bin), which permitted the service to run unconfined. Adding the network rules has no effect other than improving correctness, as the version of AppArmor in the NixOS kernel fails to enforce network rules.

commit97bac259d0deae93934357dc7c4bf7628cae88f8 authorJoachim Fasting <joachifm@fastmail.fm> dateFri 9 Jan 2015, 13:57 (12 years ago) parentb6f8d1f
1 file changed+7−2
nixos/modules/services/networking/dnscrypt-proxy.nix+7−2
nixos/modules/services/networking/dnscrypt-proxy.nix+7−2
@@ -88,7 +88,12 @@ in
8888 security.apparmor.profiles = mkIf apparmorEnabled [
8989 (pkgs.writeText "apparmor-dnscrypt-proxy" ''
9090
91− ${dnscrypt-proxy}/sbin/dnscrypt-proxy {
91+ ${dnscrypt-proxy}/bin/dnscrypt-proxy {
92+ network inet stream,
93+ network inet6 stream,
94+ network inet dgram,
95+ network inet6 dgram,
96+
9297 capability ipc_lock,
9398 capability net_bind_service,
9499 capability net_admin,
@@ -126,7 +131,7 @@ in
126131 wantedBy = [ "multi-user.target" ];
127132 serviceConfig = {
128133 Type = "forking";
129− ExecStart = "${dnscrypt-proxy}/sbin/dnscrypt-proxy ${toString daemonArgs}";
134+ ExecStart = "${dnscrypt-proxy}/bin/dnscrypt-proxy ${toString daemonArgs}";
130135 };
131136 };
132137