Apparmor-loader project to deploy profiles through a kubernetes daemonset.
This app provide dynamic loading and unloading of AppArmor profiles to a Kubernetes cluster through a configmap.
The app doesn’t need an operator and it will be managed by a DaemonSet filtering the linux nodes to schedule the app pod.
The custom profiles deployed in the configmap will be copied in a directory (/etc/apparmor.d/custom
by default) since apparmor_parser needs the profiles definitions also to remove them. Once you will deploy a configmap with different profiles, Kapparmor will notice the missing ones and it will remove them from the apparmor cache and from the node directory.
If you modify only the content of a profile leaving the same name, Kapparmor should notice it anyway since a byte comparison is done when configmap profiles names and local profiles names match.
You can view which profiles are loaded on a node by checking the /sys/kernel/security/apparmor/profiles, so its parent will need to be mounted in the pod.
This work was inspired by kubernetes/apparmor-loader.
You can install the helm chart like this
helm repo add tuxerrante https://tuxerrante.github.io/kapparmor
helm upgrade kapparmor --install --atomic --timeout 120s --debug --set image.tag=pr-16 tuxerrante/kapparmor
profile
keyword presence before of a opening curly bracket {
.custom.
and to be equal to their filename.There is a whole project meant to be a demo for this one, have fun.
Or you can find more info in docs/testing.md
config/config
file with the right app, chart and go version.charts/kapparmor/Chart.yaml
../build
scripts and following docs/testing.md instructions (go test, go lint, helm lint, helm template, helm install dry run…).