OPA (Open Policy Agent) Upload

OPA (Open Policy Agent) Upload

Certified
Enterprise Edition

Upload or replace an OPA policy

PUTs a Rego module to /v1/policies/{id}; overwrites existing content. Sends source as text/plain.

yaml
type: io.kestra.plugin.ee.opa.policy.Upload

Upload an OPA policy

yaml
id: upload_policy
namespace: company.team

tasks:
  - id: upload_policy
    type: io.kestra.plugin.ee.opa.policy.Upload
    url: "{{ secret('OPA_URL') }}"
    token: "{{ secret('OPA_TOKEN') }}"
    policyId: "kubernetes-admission"
    policy: |
      package kubernetes.admission

      deny contains msg if {
        input.request.kind == "Deployment"
        not input.request.object.spec.template.spec.securityContext.runAsNonRoot
        msg := "Containers must not run as root"
      }

      deny contains msg if {
        input.request.kind == "Deployment"
        input.request.object.spec.replicas > 10
        input.request.namespace != "production"
        msg := "Non-production deployments cannot exceed 10 replicas"
      }
Properties

Policy source

Rego policy source code to create or update.

Policy ID

Unique identifier of the policy module in OPA.

OPA base URL

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Bearer token