-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add apparmor support to further harden the priviledge seperation on L…
…inux in a similar way pledge() is used on OpenBSD. The apparmor config contains profiles for the different iked processes (parent,ikev2,ca,control). Each process switches to their respective policy with aa_change_profile() before calling chroot() and setuid() to drop priviledges.
- Loading branch information
Showing
4 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Last Modified: Thu Apr 14 17:48:19 2022 | ||
abi <abi/3.0>, | ||
|
||
include <tunables/global> | ||
|
||
profile iked /usr/sbin/iked { | ||
include <abstractions/base> | ||
|
||
capability kill, | ||
|
||
# address/route configuration | ||
capability net_admin, | ||
network netlink dgram, | ||
|
||
# config file | ||
include <abstractions/nameservice> | ||
/etc/iked.conf r, | ||
/etc/iked/** r, | ||
|
||
# switch profile | ||
owner @{PROC}/@{tid}/mounts r, | ||
owner @{PROC}/@{tid}/attr/current w, | ||
change_profile -> iked//ca, | ||
change_profile -> iked//control, | ||
change_profile -> iked//ikev2, | ||
|
||
signal (send) peer=iked//ca, | ||
signal (send) peer=iked//control, | ||
signal (send) peer=iked//ikev2, | ||
signal (send) peer=iked//resolvectl, | ||
|
||
owner /run/iked.sock w, | ||
network key raw, | ||
|
||
/usr/bin/resolvectl cx -> resolvectl, | ||
profile resolvectl { | ||
include <abstractions/base> | ||
include <abstractions/dbus> | ||
|
||
signal (receive) peer=iked, | ||
|
||
/usr/bin/resolvectl r, | ||
} | ||
|
||
profile ca { | ||
include <abstractions/base> | ||
|
||
# privsep | ||
capability setuid, | ||
capability setgid, | ||
capability sys_chroot, | ||
signal (receive) peer=iked, | ||
|
||
# certs/keys | ||
/etc/iked/** r, | ||
} | ||
|
||
profile control { | ||
include <abstractions/base> | ||
|
||
# privsep | ||
capability setuid, | ||
capability setgid, | ||
capability sys_chroot, | ||
signal (receive) peer=iked, | ||
|
||
# ikectl control sock | ||
network unix raw, | ||
} | ||
|
||
profile ikev2 { | ||
include <abstractions/base> | ||
|
||
# privsep | ||
capability setuid, | ||
capability setgid, | ||
capability sys_chroot, | ||
signal (receive) peer=iked, | ||
|
||
# IKEv2 | ||
network inet dgram, | ||
network inet6 dgram, | ||
# PFKEY | ||
network key raw, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters