Page MenuHomePhabricator

Create ValidatingAdmissionPolicies to replace mediawiki PSP
Closed, ResolvedPublic

Description

We need a replacement for the mediawiki PSP that basically consists of the restricted PodSecurityStandard profile but allows for SYS_PTRACE and access to specific host paths:

- pathPrefix: /usr/share/GeoIP
  readOnly: true
- pathPrefix: /usr/share/GeoIPInfo
  readOnly: true

The idea from the parent task and https://wikitech.wikimedia.org/wiki/User:JMeybohm/PSP_Replacement is to have ValidatingAdmissionPolicies replicating the various rules of the PSS profiles in a way that allows us to selectively enable/disable/replace particular rules for specific namespaces.

Event Timeline

Although this is not technically blocking the k8s upgrade (because ValidationAdmissionPolicies require k8s >=1.26 anyways), we need this to be ready to deploy together with the next k8s upgrade or we'll have to configure mediawiki namespaces with the privileged PSS after the update.

Change #1052964 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/deployment-charts@master] Add kyverno_policy_parser

https://gerrit.wikimedia.org/r/1052964

JMeybohm renamed this task from Create ValidationAdmissionPolicies to replace mediawiki PSP to Create ValidatingAdmissionPolicies to replace mediawiki PSP.Jul 12 2024, 9:07 AM
JMeybohm updated the task description. (Show Details)

Change #1053911 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/deployment-charts@master] Initial commit validating-admission-policies chart

https://gerrit.wikimedia.org/r/1053911

Change #1053934 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/debs/helm3@master] New upstream version 3.11.3

https://gerrit.wikimedia.org/r/1053934

Change #1052964 abandoned by JMeybohm:

[operations/deployment-charts@master] Add kyverno_policy_parser

Reason:

Moved to https://gitlab.wikimedia.org/repos/sre/kyverno-policy-parser due to popular demand

https://gerrit.wikimedia.org/r/1052964

Change #1053934 merged by JMeybohm:

[operations/debs/helm3@master] New upstream version 3.11.3

https://gerrit.wikimedia.org/r/1053934

Change #1054802 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[integration/config@master] Docker: [helm-linter] Update helm to 3.11.3

https://gerrit.wikimedia.org/r/1054802

Change #1054803 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[integration/config@master] jjib: [helm-lint] Update helm-linter image

https://gerrit.wikimedia.org/r/1054803

Change #1054802 merged by jenkins-bot:

[integration/config@master] Docker: [helm-linter] Update helm to 3.11.3

https://gerrit.wikimedia.org/r/1054802

Change #1054803 merged by jenkins-bot:

[integration/config@master] jjb: [helm-lint] Update helm-linter image

https://gerrit.wikimedia.org/r/1054803

Change #1054891 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/deployment-charts@master] Add policy to allow only SYS_PTRACE

https://gerrit.wikimedia.org/r/1054891

Change #1054905 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/deployment-charts@master] Add policy to allow GeoIP hostPath volumes

https://gerrit.wikimedia.org/r/1054905

Implementation is (I think) completed. There is a README which hopefully explains what my intentions where and how the policies can be used to create something PSS like but with exceptions.

Change #1053911 merged by jenkins-bot:

[operations/deployment-charts@master] Initial commit validating-admission-policies chart

https://gerrit.wikimedia.org/r/1053911

Change #1054891 merged by jenkins-bot:

[operations/deployment-charts@master] Add policy to allow only SYS_PTRACE

https://gerrit.wikimedia.org/r/1054891

Change #1054905 merged by jenkins-bot:

[operations/deployment-charts@master] Add policy to allow GeoIP hostPath volumes

https://gerrit.wikimedia.org/r/1054905