AppArmorProfile CRD is created and AppArmorProfile objects are stored in etcd.
Actual AppArmor profiles will be created(updated) across all worker nodes through synchronizing with AppArmorProfile objects.
AppArmorProfile Object Explained
apiVersion: crd.security.sysdig.com/v1alpha1
kind: AppArmorProfile
metadata:
name: apparmorprofile-sample
spec:
rules: |
# This is the default deny mode of AppArmor profile.
# List the allow rules here separated by new line character.
# allow few read/write activities
allow /etc/* r,
allow /tmp/* rw,
# allow few commands execution
allow /bin/echo mrix,
allow /bin/sleep mrix,
allow /bin/cat mrix,
enforced: true # set profile to enforcement mode if true (complain mode if false)
Install as a Krew Plugin
Follow the instructions to install krew. Then run the following command:
kubectl krew install apparmor-manager
The plugin will be available as kubectl apparmor-manager.
Configure Environment
SSH_USERNAME: SSH username to access worker nodes (default: admin)
SSH_PERM_FILE: SSH private key to access worker ndoes (default: $HOME/.ssh/id_rsa)
SSH_PASSPHRASE: SSH passphrase (only applicable if the private key is passphrase protected)
Usage
Usage:
kube-apparmor-manager [command]
Available Commands:
enabled Check AppArmor status on worker nodes
enforced Check AppArmor profile enforcement status on worker nodes
help Help about any command
init Install CRD in the cluster and AppArmor services on worker nodes
sync Synchronize the AppArmor profiles from the Kubernetes database (etcd) to worker nodes
kube-apparmor-manager
Manage AppArmor profiles for Kubernetes cluster
Behind the Scenes
AppArmorProfileCRD is created andAppArmorProfileobjects are stored in etcd.AppArmorProfileobjects.AppArmorProfile Object Explained
Install as a Krew Plugin
Follow the instructions to install
krew. Then run the following command:The plugin will be available as
kubectl apparmor-manager.Configure Environment
SSH_USERNAME: SSH username to access worker nodes (default: admin)SSH_PERM_FILE: SSH private key to access worker ndoes (default: $HOME/.ssh/id_rsa)SSH_PASSPHRASE: SSH passphrase (only applicable if the private key is passphrase protected)Usage
Example Output
AppArmor enabled status
AppArmor enforced profiles
Sync
When ever there is change to
AppArmorProfileobject, runsyncto synchronize across all the worker nodes.