kubewarden / allow-privilege-escalation-psp-policy

A Kubewarden Pod Security Policy that controls usage of allowPrivilegeEscalation
https://kubewarden.io
Apache License 2.0
6 stars 7 forks source link

feat: Add Rancher Helm chart folder #30

Closed viccuad closed 2 years ago

viccuad commented 2 years ago

Description

Relates to https://github.com/kubewarden/rfc/pull/12

The policy resource template is rendered completely from whatever Helm values are passed. This is done by consuming everything in values.yaml, and of course accepts --set to overwrite, expand, or remove things that end in the template.

Test

To create an AdmissionPolicy instead of the default ClusterAdmissionPolicy: helm template . --set kind="AdmissionPolicy"

To set the policy as non-mutating: helm template . --set kind="AdmissionPolicy" --set mutating="false"

And so on.

Additional Information

Tradeoff

See RFC 10.

flavio commented 2 years ago

Does all of that have to live inside of the root of the repository? Can we put that under a dedicated directory instead (like rancher-helm-chart or something similar)?

viccuad commented 2 years ago

Yeah, simpler, no need for readme and so. Repushed the branch that way.

flavio commented 2 years ago

Yeah, simpler, no need for readme and so. Repushed the branch that way.

Thanks, I think this reduces the clutter and also makes it easy to find all the files that have to be touched in order to update the rancher chart

flavio commented 2 years ago

I spent more time looking into this PR, I was thinking about the conversation we had about adding all these information into the metadata.yml and then have a scaffold tool that generates these files. While doing that I came to some realizations.

Chart.yml file

questions.yaml file

policy.yaml and values.yaml file

I think the current contents of the values.yaml file should be moved into the policy.yaml file. The policy.yaml file should be a templated policy definition.

Things that should be templated are:

Summary

I wonder if it makes sense to have all this information stored into metadata.yml file. Is it going to be worth the effort given how few parts of the file need to be changed across releases?

Also, is it possible to have a really generic scaffold that covers all the policies? What about the exceptions, how are we going to handle them... These are questions for the RFC probably

viccuad commented 2 years ago

Superseded by https://github.com/kubewarden/helm-charts/pull/130/files.