kubewarden / policy-hub

A place where to find and discover policies
https://hub.kubewarden.io
3 stars 3 forks source link

Create PSP `host-namespaces` policy #23

Closed flavio closed 3 years ago

flavio commented 3 years ago

Write a Kubewarden policy that implements the host namespaces psp.

Configuration

allowHostPID: true
allowHostIPC: false
allowHostNetwork: false
allowedHostPortRange: [1024, 2048]

Default behaviour of the configuration knobs

Settings validation:

ereslibre commented 3 years ago

On PodSecurityPolicies the allowed host port range is a list of ranges, such as:

  hostPorts:
  - min: 0
    max: 65535

This policy could allow this instead of the proposed settings, by allowing a list of allowedHostPortRanges, such as:

allowedHostPortRanges:
  - portMin: 80
    portMax: 443
  - portMin: 8000
    portMax: 8443

in a single policy instance.

ereslibre commented 3 years ago

~@flavio do we want to add allowedHostPaths as well on this policy?~

NVM, just saw https://github.com/kubewarden/policy-hub/issues/26, sorry.

ereslibre commented 3 years ago

Implemented in https://github.com/kubewarden/psp-host-namespaces.

The only remaining bit is the notifying of the policy hub.