OperationPolicy
Scope: Cluster
Version: v1alpha1
Describes an operation policy for a cluster.
Each CustomResource OperationPolicy
describes rules for objects in a cluster.
- string
The enforcement action to control what to do with the result of the constraint.
Deny
— Deny action.Dryrun
— No action. It is used when debugging. Information about the event can be viewed in Grafana in dashboardSecurity/Admission policy engine
.Warn
— Same asDryrun
. In addition to the event information, it provides some info on why that constraint would have been denied if you had setDeny
instead ofWarn
.
Default:
"Deny"
Allowed values:
Warn
,Deny
,Dryrun
- object
Specifies the label selector to filter Pods with.
You can get more into here.
- array of objects
List of label expressions for Pods.
Example:
matchExpressions: - key: tier operator: In values: - production - staging
- object
Required value
Specifies the Namespace selector to filter objects with.
- object
Specifies the label selector to filter namespaces.
You can get more info in the documentation.
- array of objects
List of label expressions for namespaces.
Example:
matchExpressions: - key: tier operator: In values: - production - staging
- array of strings
The list of prefixes a container image is allowed to have.
- array of strings
Requires container images to have an image tag different from the ones in the specified list.
Example:
disallowedImageTags: latest
- array of strings
The list of kubernetes objects in the format
$apiGroup/$kind
to watch the annotations on.
- array of strings
The list of kubernetes objects in the format
$apiGroup/$kind
to watch the labels on.
- array of strings
The list of probes that are required (e.g.
readinessProbe
andlivenessProbe
)Example:
requiredProbes: - readinessProbe - livenessProbe
- array of strings
A list of limits that should be enforced (CPU, memory, or both).
Default:
["memory"]
- array of strings
A list of requests that should be enforced (CPU, memory, or both).
Default:
["cpu","memory"]
SecurityPolicy
Scope: Cluster
Version: v1alpha1
Describes a security policy for a cluster.
Each SecurityPolicy
custom resource describes rules for the objects in the cluster.
- string
An enforcement action as a result of the constraint:
Deny
— Deny action.Dryrun
— No action. Used for debugging. Information about the event can be viewed in Grafana in dashboardSecurity/Admission policy engine
.Warn
— No action; similar toDryrun
. Provides information about the constraint that would result in a denial if theDeny
action is used.
Default:
"Deny"
Allowed values:
Warn
,Deny
,Dryrun
- object
Required value
Container filtering rules. Use selectors to specify the pods and containers to which you want to apply the policy.
- object
Specifies the label selector to filter Pods with.
You can get more into here.
- array of objects
The list of label expressions for Pods.
Example:
matchExpressions: - key: tier operator: In values: - production - staging
- object
Required value
Specifies the Namespace selector to filter objects with.
- object
Specifies the label selector to filter namespaces.
You can get more info in the documentation.
- array of objects
The list of label expressions for namespaces.
Example:
matchExpressions: - key: tier operator: In values: - production - staging
- array of strings
The list of AppArmor profiles the containers are permitted to use.
Example:
allowedAppArmor: - runtime/default - unconfined
- array of strings
The list of capabilities that the containers are permitted to use.
To allow all capabilities, use
ALL
.Example:
allowedCapabilities: - SETGID - SETUID - NET_BIND_SERVICE
- string
A linux capability.
Allowed values:
ALL
,SETPCAP
,SYS_MODULE
,SYS_RAWIO
,SYS_PACCT
,SYS_ADMIN
,SYS_NICE
,SYS_RESOURCE
,SYS_TIME
,SYS_TTY_CONFIG
,MKNOD
,AUDIT_WRITE
,AUDIT_CONTROL
,MAC_OVERRIDE
,MAC_ADMIN
,NET_ADMIN
,SYSLOG
,CHOWN
,NET_RAW
,DAC_OVERRIDE
,FOWNER
,DAC_READ_SEARCH
,FSETID
,KILL
,SETGID
,SETUID
,LINUX_IMMUTABLE
,NET_BIND_SERVICE
,NET_BROADCAST
,IPC_LOCK
,IPC_OWNER
,SYS_CHROOT
,SYS_PTRACE
,SYS_BOOT
,LEASE
,SETFCAP
,WAKE_ALARM
,BLOCK_SUSPEND
- array of objects
The list of Flex Volume drivers the containers are permitted to use.
- array of objects
The list of allowed hostpath prefixes. An empty list means any path can be used.
Example:
allowedHostPaths: - pathPrefix: "/dev" readOnly: true
- string
Required value
The path prefix to match against the host volume.
It does not support the
*
mask. Trailing slashes are trimmed when validating the path prefix with a host path.For example, the
/foo
prefix allows/foo
,/foo/
and/foo/bar
path, but doesn’t allow/food
or/etc/foo
path. - boolean
When set to true, allows host volumes to be matched against the pathPrefix only if all the volume mounts are read-only.
Default:
false
- array of strings
The set of the permitted volume plugins.
Example:
allowedVolumes: - hostPath - persistentVolumeClaim
- string
Allowed values:
*
,none
,awsElasticBlockStore
,azureDisk
,azureFile
,cephFS
,cinder
,configMap
,csi
,downwardAPI
,emptyDir
,fc
,flexVolume
,flocker
,gcePersistentDisk
,gitRepo
,glusterfs
,hostPath
,iscsi
,nfs
,persistentVolumeClaim
,photonPersistentDisk
,portworxVolume
,projected
,quobyte
,rbd
,scaleIO
,secret
,storageos
,vsphereVolume
- array of strings
The list of forbidden sysctls.
Takes precedence over allowed unsafe sysctls (allowedUnsafeSysctls).
Example:
forbiddenSysctls: - kernel.msg* - net.core.somaxconn
- array of objects
The list of
fsGroup
ID ranges that are allowed in `MustRunAs’ mode.
- boolean
If set to true, only the pods with the read-only root filesystem across all containers will be permitted to run. See the Kubernetes documentation for more details.
- array of strings
The list of capabilities that have to be dropped from the containers.
To exclude all capabilities, use
ALL
’.Example:
requiredDropCapabilities: - SETGID - SETUID - NET_BIND_SERVICE
- string
A linux capability to drop from the containers’ specs.
Allowed values:
ALL
,SETPCAP
,SYS_MODULE
,SYS_RAWIO
,SYS_PACCT
,SYS_ADMIN
,SYS_NICE
,SYS_RESOURCE
,SYS_TIME
,SYS_TTY_CONFIG
,MKNOD
,AUDIT_WRITE
,AUDIT_CONTROL
,MAC_OVERRIDE
,MAC_ADMIN
,NET_ADMIN
,SYSLOG
,CHOWN
,NET_RAW
,DAC_OVERRIDE
,FOWNER
,DAC_READ_SEARCH
,FSETID
,KILL
,SETGID
,SETUID
,LINUX_IMMUTABLE
,NET_BIND_SERVICE
,NET_BROADCAST
,IPC_LOCK
,IPC_OWNER
,SYS_CHROOT
,SYS_PTRACE
,SYS_BOOT
,LEASE
,SETFCAP
,WAKE_ALARM
,BLOCK_SUSPEND
- object
Specifies which
runAsGroup
values the security context is permitted to use.- array of objects
The list of group ID ranges that are allowed in `MustRunAs’ mode.
- object
Specifies which
runAsUser
values the security context is permitted to use.- array of objects
The list of user ID ranges that are allowed in `MustRunAs’ mode.
- array of objects
Specifies which SElinux labels the security context is permitted to use.
- object
Specifies the list of allowed profiles that can be set for the Pod or container’s seccomp annotations.
- object
Specifies what supplemental groups are allowed to be used by the security context.
- array of objects
The list of supplemental group ID ranges that are allowed in `MustRunAs’ mode.
- array of objects
List of policies to verify container images signatures.
Container images must be signed using Cosign.
This feature is available in enterprise edition only.
Example:
verifyImageSignatures: - reference: docker.io/myrepo/* publicKeys: - |- -----BEGIN PUBLIC KEY----- ..... -----END PUBLIC KEY----- - reference: company.registry.com/* dockerCfg: "<Base64_dockerCfg>" publicKeys: - |- -----BEGIN PUBLIC KEY----- ..... -----END PUBLIC KEY-----
- string
Required value
Absolute address or template for container images.
If it contains the
*
symbol, it is considered a template for container image addresses. The*
symbol can only appear once and only at the end. For example, for the valuecompany.registry.com/*
, any container images from the repositorycompany.registry.com
will be checked with the specified keys and access parameters.If it does not contain the
*
symbol, it is considered an absolute address for a container image. For example, for the valuecompany.registry.com/nginx
, only the nginx image from the repositorycompany.registry.com
will be checked with the specified keys and access parameters.Pattern:
^[a-z0-9\.\-:@\/]*\*?$
Examples:
reference: docker.io/myuser/*
reference: "*"