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

Allow to parameterize the policies #67

Open
as42sl opened this issue Aug 2, 2022 · 0 comments
Open

Allow to parameterize the policies #67

as42sl opened this issue Aug 2, 2022 · 0 comments
Assignees

Comments

@as42sl
Copy link

as42sl commented Aug 2, 2022

Do you have a plan for parameterizing the policies to avoid duplicated code?

For example when I want to deny multiple namespaces I could write generic code that gets the namespace as a parameter and then create multiple JsPolicy files that reference the same JsPolicyBundle:

apiVersion: policy.jspolicy.com/v1beta1
kind: JsPolicy
metadata:
  name: "deny-default-namespace.example.com"
spec:
  bundle: "deny-namespace.example.com"
  operations: ["CREATE"]
  resources: ["*"]
  scope: Namespaced
  parameters:
     namespace: default
apiVersion: policy.jspolicy.com/v1beta1
kind: JsPolicy
metadata:
  name: "deny-other-namespace.example.com"
spec:
  bundle: "deny-namespace.example.com"
  operations: ["CREATE"]
  resources: ["*"]
  scope: Namespaced
  parameters:
     namespace: other
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

2 participants