Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create policy library #113

Open
AndresPinerosZen opened this issue Dec 30, 2023 · 4 comments
Open

Create policy library #113

AndresPinerosZen opened this issue Dec 30, 2023 · 4 comments

Comments

@AndresPinerosZen
Copy link

AndresPinerosZen commented Dec 30, 2023

It would be nice if instead of having an "examples" folder there was a folder with actual implementation of the common rules that competitors already have. Things like "Don't allow the latest tag in any PodTemplate/JobTemplate (Deployment, Job, CronJob, Statefulset...) container image".

Having a library of rules for commonly used policies is an incentive for people to adopt the project.

This would also help people compare the difficulty of writing policies in Rego vs JSPolicy. Having a mapping between common OPA policies and their JSPolicy counterpart would help to demonstrate the "Easier & Faster policies" point.

@FabianKramm
Copy link
Member

Thanks for the issue @AndresPinerosZen! Yeah thats a good idea, we are currently pretty short staffed on JsPolicy, so if somebody wants to create a couple of common rules, we would be more than happy to merge that PR!

@epasham
Copy link
Contributor

epasham commented Apr 5, 2024

Can we create a Policy-Library directory place holder for storing the examples. we will build the rules for all the examples from OPA library so that people have choice to chose between jspolicy and other policy management tools

@epasham
Copy link
Contributor

epasham commented Apr 10, 2024

I have picked up below 10 references from OPA library, we will convert them jspolicy compatible and then will check into the repo
BlockNodePort Service Type
BlockLoadBalancer Service Type
AllowedRepos
DisAllowedRepos
DisAllowedTags
ReplicaLimits
RequiredLabels
RequiredAnnotations
RequiredProbes
AllowedStorageClass

@epasham
Copy link
Contributor

epasham commented Apr 11, 2024

Added policy libray and included below samples
BlockNodePort Service Type
BlockLoadBalancer Service Type
AllowedRepos

Submitted the pull request. please review and merge it. will be adding more samples from the list above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants