Skip to content

OP-24522: Feature Implementation Pipeline Runtime Policies direct with OPA - #269

Open
sudhakaropsmx wants to merge 1 commit into
v4.0from
feature/OP-24522_Pipeline_Runtime_Policy
Open

OP-24522: Feature Implementation Pipeline Runtime Policies direct with OPA#269
sudhakaropsmx wants to merge 1 commit into
v4.0from
feature/OP-24522_Pipeline_Runtime_Policy

Conversation

@sudhakaropsmx

@sudhakaropsmx sudhakaropsmx commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

https://devopsmx.atlassian.net/browse/OP-24522

Sample configuration for OPA and runtime policies in orca-local.yml

policy:
  opa:
    enabled: true
    url: http://oes-sapor:8085/
    runtimeUrl: http://opa:8181/ # RUN OPA policy check
    runtime:   # RUN OPA policy check
      enabled: false
      policies:
        - name: test                # RUN OPA policy check
          packageName: testopa      # RUN OPA policy check
    manualjudgment:
      enabled: true
      policies:
        - name: test                # RUN OPA policy check
          packageName: testmj    # RUN OPA policy check
    failOpen:
      enabled: false
      timeout: 10

Plugin Conguration in orca-local.yml

spinnaker:
  extensibility:
    plugins:
      Opsmx.PipelineRuntimePolicyPlugin:    # RUN OPA policy check
        enabled: true
        version: 1.0.3
    repositories:
      opsmx-repo:
        url: https://raw.githubusercontent.com/OpsMx/spinnakerPluginRepository/refs/heads/wu-pipeline-policy-validate/plugins.json

@sudhakaropsmx
sudhakaropsmx force-pushed the feature/OP-24522_Pipeline_Runtime_Policy branch from 2e9f5e0 to 62098d5 Compare June 22, 2026 04:47
@yugaa22

yugaa22 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator
package testmj

default allow = false

deny[msg] {
    stage := input.pipeline.stages[_]
    stage.type == "manualJudgment"

    trigger_user := input.pipeline.trigger.user
    modified_by := stage.context.lastModifiedBy

    trigger_user == modified_by

    msg := sprintf("Approval denied: trigger user '%s' cannot approve manual judgment they modified.", [trigger_user])
}

allow {
    count(deny) == 0
}

sample OPA code tested and working

@sudhakaropsmx
sudhakaropsmx requested review from emanipravallika and rakeshkrmeena and removed request for rakeshkrmeena June 23, 2026 04:34

@emanipravallika emanipravallika left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

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

Successfully merging this pull request may close these issues.

3 participants