mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-01-30 06:45:10 +01:00
Add CNI for containerd
This commit is contained in:
parent
4a37cd1149
commit
9ea910d1a0
3 changed files with 79 additions and 0 deletions
26
apparmor.d/groups/virt/calico
Normal file
26
apparmor.d/groups/virt/calico
Normal file
|
@ -0,0 +1,26 @@
|
|||
abi <abi/3.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = /{opt/,}{cni/,}bin/calico
|
||||
profile calico @{exec_path} flags=(complain) {
|
||||
include <abstractions/base>
|
||||
|
||||
@{exec_path} rix,
|
||||
@{exec_path}-ipam rix,
|
||||
|
||||
network inet,
|
||||
|
||||
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
|
||||
/var/lib/calico/ r,
|
||||
/var/lib/calico/** r,
|
||||
/etc/cni/net.d/ r,
|
||||
/etc/cni/net.d/** r,
|
||||
|
||||
/var/log/calico/cni/ r,
|
||||
/var/log/calico/cni/cni.log wr,
|
||||
|
||||
/run/calico/ipam.lock rwk,
|
||||
|
||||
include if exists <local/calico>
|
||||
}
|
35
apparmor.d/groups/virt/cni
Normal file
35
apparmor.d/groups/virt/cni
Normal file
|
@ -0,0 +1,35 @@
|
|||
abi <abi/3.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
profile loopback /{opt/,}{cni/,}bin/loopback {
|
||||
include <abstractions/base>
|
||||
|
||||
/opt/cni/bin/loopback rix,
|
||||
|
||||
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
|
||||
|
||||
include if exists <local/loopback>
|
||||
}
|
||||
|
||||
profile portmap /{opt/,}{cni/,}bin/portmap {
|
||||
include <abstractions/base>
|
||||
|
||||
/opt/cni/bin/portmap rix,
|
||||
|
||||
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
|
||||
|
||||
include if exists <local/portmap>
|
||||
}
|
||||
|
||||
profile bandwidth /{opt/,}{cni/,}bin/bandwidth {
|
||||
include <abstractions/base>
|
||||
|
||||
/opt/cni/bin/bandwidth rix,
|
||||
|
||||
network inet,
|
||||
network netlink raw,
|
||||
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
|
||||
|
||||
include if exists <local/bandwidth>
|
||||
}
|
|
@ -9,6 +9,7 @@ include <tunables/global>
|
|||
@{exec_path} = /{usr/,}bin/containerd
|
||||
profile containerd @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability dac_read_search,
|
||||
capability net_admin,
|
||||
|
@ -16,6 +17,10 @@ profile containerd @{exec_path} {
|
|||
|
||||
signal (receive) set=term peer=dockerd,
|
||||
|
||||
# Pulling container images
|
||||
network inet,
|
||||
network inet6,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/{usr/,}bin/containerd-shim-runc-v2 rPUx,
|
||||
|
@ -26,6 +31,19 @@ profile containerd @{exec_path} {
|
|||
/etc/cni/net.d/ rw,
|
||||
/etc/containerd/*.toml r,
|
||||
|
||||
/opt/cni/bin/loopback Px,
|
||||
/opt/cni/bin/portmap Px,
|
||||
/opt/cni/bin/bandwidth Px,
|
||||
/opt/cni/bin/calico Px,
|
||||
|
||||
/var/log/pods/**/[0-9]*.log w,
|
||||
@{run}/calico/ w,
|
||||
|
||||
@{run}/netns/ w,
|
||||
@{run}/netns/cni-@{uuid} rw,
|
||||
/var/lib/cni/results/cni-loopback-@{uuid}-lo l,
|
||||
@{PROC}/@{pid}/task/[0-9]*/ns/net rw,
|
||||
|
||||
/var/lib/containerd/{,**} rwk,
|
||||
/var/lib/docker/containerd/{,**} rwk,
|
||||
@{run}/containerd/{,**} rwk,
|
||||
|
|
Loading…
Reference in a new issue