Skip to content

Replacement for the Kubernetes Pod Security Policy that controls the usage of SELinux

License

Notifications You must be signed in to change notification settings

kubewarden/selinux-psp-policy

Folders and files

NameName
Last commit message
Last commit date
Mar 3, 2025
Aug 31, 2023
Nov 18, 2021
Jan 26, 2022
Feb 7, 2022
Oct 25, 2023
Mar 3, 2025
Feb 10, 2025
Nov 18, 2021
Jun 5, 2024
May 31, 2024
Oct 16, 2023
Jul 19, 2022
Dec 3, 2021
Jul 7, 2023
Mar 16, 2023
Feb 10, 2022

Repository files navigation

Kubewarden Policy Repository Stable

Kubewarden policy psp-selinux

Description

Replacement for the Kubernetes Pod Security Policy that controls the usage of SELinux in the pod security context and on containers, init containers and ephemeral containers. This policy will inspect the .spec.securityContext.seLinuxOptions of the pod if the container has no specific .spec.securityContext.seLinuxOptions. In other words, the seLinuxOptions of the container, init container and ephemeral containers take precendence over the pod seLinuxOptions, if any.

Settings

This policy works by defining what seLinuxOptions can be set at the pod level and at the container level.

One of the following setting keys are accepted for this policy:

  • MustRunAs: contains the desired value for the seLinuxOptions parameter. If the pod does not contain a .securityContext, or a .securityContext.seLinuxOptions, then this policy acts as mutating and defaults the seLinuxOptions attribute to the one provided in the configuration. In all cases, pod containers, init container and ephemeral containers .seLinuxOptions are checked for compatibility if they override the Pod Security Context seLinuxOptions value.
  • RunAsAny: always accepts the request.

Configuration examples:

rule: RunAsAny
rule: MustRunAs
user: user
role: role
type: type
level: s0:c0,c6