KubeArmor supports configurable default security posture. The security posture could be allow/audit/deny. Default Posture is used when there's atleast one Allow policy for the given deployment i.e. KubeArmor is handling policies in whitelisting manner (more about this in Considerations in Policy Action ).
There are two default mode of operations available block and audit. block mode blocks all the operations that are not allowed in the policy. audit generates telemetry events for operations that would have been blocked otherwise.
KubeArmor has 4 types of resources: Process, File, Network and Capabilities. Default Posture is configurable for each of the resources seperately except Process. Process based operations are treated under File resource only.
Configuring Default Posture
Global Default Posture
Note By default, KubeArmor set the Global default posture to audit
Global default posture is configured using configuration options passed to KubeArmor using configuration file
defaultFilePosture:block# or auditdefaultNetworkPosture:block# or auditdefaultCapabilitiesPosture:block# or audit
Or using command line flags with the KubeArmor binary
We use namespace annotations to configure default posture per namespace. Supported annotations keys are kubearmor-file-posture,kubearmor-network-posture and kubearmor-capabilities-posture with values block or audit. If a namespace is annotated with a supported key and an invalid value ( like kubearmor-file-posture=invalid), KubeArmor will update the value with the global default posture ( i.e. to kubearmor-file-posture=block).
Example
Let's start KubeArmor with configuring default network posture to audit in the following YAML.
We can see that, annotation value was automatically updated to audit since that was global mode of operation for network in the KubeArmor configuration.