Skip to content

Allow to parameterize the policies #67

@as42sl

Description

@as42sl

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions