Description

PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container.

Type

object

Specification

Property Type Description

.apiVersion

string

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

.kind

string

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

.metadata

ObjectMeta meta/v1

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

.spec

object

PodSecurityPolicySpec defines the policy enforced.

.spec
Description

PodSecurityPolicySpec defines the policy enforced.

Type

object

Required
  • seLinux

  • runAsUser

  • supplementalGroups

  • fsGroup

Property Type Description

allowPrivilegeEscalation

boolean

allowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true.

allowedCSIDrivers

array

AllowedCSIDrivers is a whitelist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. An empty value indicates that any CSI driver can be used for inline ephemeral volumes. This is an alpha field, and is only honored if the API server enables the CSIInlineVolume feature gate.

allowedCSIDrivers[]

object

AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used.

allowedCapabilities

array (string)

allowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author’s discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities.

allowedFlexVolumes

array

allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the "volumes" field.

allowedFlexVolumes[]

object

AllowedFlexVolume represents a single Flexvolume that is allowed to be used.

allowedHostPaths

array

allowedHostPaths is a white list of allowed host paths. Empty indicates that all host paths may be used.

allowedHostPaths[]

object

AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.

allowedProcMountTypes

array (string)

AllowedProcMountTypes is a whitelist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled.

allowedUnsafeSysctls

array (string)

allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "" in which case it is considered as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection.

Examples: e.g. "foo/" allows "foo/bar", "foo/baz", etc. e.g. "foo.*" allows "foo.bar", "foo.baz", etc.

defaultAddCapabilities

array (string)

defaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list.

defaultAllowPrivilegeEscalation

boolean

defaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process.

forbiddenSysctls

array (string)

forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "" in which case it is considered as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.

Examples: e.g. "foo/" forbids "foo/bar", "foo/baz", etc. e.g. "foo.*" forbids "foo.bar", "foo.baz", etc.

fsGroup

object

FSGroupStrategyOptions defines the strategy type and options used to create the strategy.

hostIPC

boolean

hostIPC determines if the policy allows the use of HostIPC in the pod spec.

hostNetwork

boolean

hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.

hostPID

boolean

hostPID determines if the policy allows the use of HostPID in the pod spec.

hostPorts

array

hostPorts determines which host port ranges are allowed to be exposed.

hostPorts[]

object

HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.

privileged

boolean

privileged determines if a pod can request to be run as privileged.

readOnlyRootFilesystem

boolean

readOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to.

requiredDropCapabilities

array (string)

requiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added.

runAsGroup

object

RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.

runAsUser

object

RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.

runtimeClass

object

RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses for a pod.

seLinux

object

SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.

supplementalGroups

object

SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.

volumes

array (string)

volumes is a white list of allowed volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use '*'.

.spec.allowedCSIDrivers
Description

AllowedCSIDrivers is a whitelist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. An empty value indicates that any CSI driver can be used for inline ephemeral volumes. This is an alpha field, and is only honored if the API server enables the CSIInlineVolume feature gate.

Type

array

.spec.allowedCSIDrivers[]
Description

AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used.

Type

object

Required
  • name

Property Type Description

name

string

Name is the registered name of the CSI driver

.spec.allowedFlexVolumes
Description

allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the "volumes" field.

Type

array

.spec.allowedFlexVolumes[]
Description

AllowedFlexVolume represents a single Flexvolume that is allowed to be used.

Type

object

Required
  • driver

Property Type Description

driver

string

driver is the name of the Flexvolume driver.

.spec.allowedHostPaths
Description

allowedHostPaths is a white list of allowed host paths. Empty indicates that all host paths may be used.

Type

array

.spec.allowedHostPaths[]
Description

AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.

Type

object

Property Type Description

pathPrefix

string

pathPrefix is the path prefix that the host volume must match. It does not support *. Trailing slashes are trimmed when validating the path prefix with a host path.

Examples: /foo would allow /foo, /foo/ and /foo/bar /foo would not allow /food or /etc/foo

readOnly

boolean

when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly.

.spec.fsGroup
Description

FSGroupStrategyOptions defines the strategy type and options used to create the strategy.

Type

object

Property Type Description

ranges

array

ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs.

ranges[]

object

IDRange provides a min/max of an allowed range of IDs.

rule

string

rule is the strategy that will dictate what FSGroup is used in the SecurityContext.

.spec.fsGroup.ranges
Description

ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs.

Type

array

.spec.fsGroup.ranges[]
Description

IDRange provides a min/max of an allowed range of IDs.

Type

object

Required
  • min

  • max

Property Type Description

max

integer

max is the end of the range, inclusive.

min

integer

min is the start of the range, inclusive.

.spec.hostPorts
Description

hostPorts determines which host port ranges are allowed to be exposed.

Type

array

.spec.hostPorts[]
Description

HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.

Type

object

Required
  • min

  • max

Property Type Description

max

integer

max is the end of the range, inclusive.

min

integer

min is the start of the range, inclusive.

.spec.runAsGroup
Description

RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.

Type

object

Required
  • rule

Property Type Description

ranges

array

ranges are the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs.

ranges[]

object

IDRange provides a min/max of an allowed range of IDs.

rule

string

rule is the strategy that will dictate the allowable RunAsGroup values that may be set.

.spec.runAsGroup.ranges
Description

ranges are the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs.

Type

array

.spec.runAsGroup.ranges[]
Description

IDRange provides a min/max of an allowed range of IDs.

Type

object

Required
  • min

  • max

Property Type Description

max

integer

max is the end of the range, inclusive.

min

integer

min is the start of the range, inclusive.

.spec.runAsUser
Description

RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.

Type

object

Required
  • rule

Property Type Description

ranges

array

ranges are the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs.

ranges[]

object

IDRange provides a min/max of an allowed range of IDs.

rule

string

rule is the strategy that will dictate the allowable RunAsUser values that may be set.

.spec.runAsUser.ranges
Description

ranges are the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs.

Type

array

.spec.runAsUser.ranges[]
Description

IDRange provides a min/max of an allowed range of IDs.

Type

object

Required
  • min

  • max

Property Type Description

max

integer

max is the end of the range, inclusive.

min

integer

min is the start of the range, inclusive.

.spec.runtimeClass
Description

RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses for a pod.

Type

object

Required
  • allowedRuntimeClassNames

Property Type Description

allowedRuntimeClassNames

array (string)

allowedRuntimeClassNames is a whitelist of RuntimeClass names that may be specified on a pod. A value of "*" means that any RuntimeClass name is allowed, and must be the only item in the list. An empty list requires the RuntimeClassName field to be unset.

defaultRuntimeClassName

string

defaultRuntimeClassName is the default RuntimeClassName to set on the pod. The default MUST be allowed by the allowedRuntimeClassNames list. A value of nil does not mutate the Pod.

.spec.seLinux
Description

SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.

Type

object

Required
  • rule

Property Type Description

rule

string

rule is the strategy that will dictate the allowable labels that may be set.

seLinuxOptions

SELinuxOptions core/v1

seLinuxOptions required to run as; required for MustRunAs More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

.spec.supplementalGroups
Description

SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.

Type

object

Property Type Description

ranges

array

ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs.

ranges[]

object

IDRange provides a min/max of an allowed range of IDs.

rule

string

rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.

.spec.supplementalGroups.ranges
Description

ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs.

Type

array

.spec.supplementalGroups.ranges[]
Description

IDRange provides a min/max of an allowed range of IDs.

Type

object

Required
  • min

  • max

Property Type Description

max

integer

max is the end of the range, inclusive.

min

integer

min is the start of the range, inclusive.