A GitHub action that validates the policy using OPA.
This example checks policy using Open Policy Agent (OPA).
name: Policy validation using OPA
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@latest
- name: Check policy using Open Policy Agent (OPA)
uses: opsverse/[email protected]
with:
opaServerUrl: "https://opa.example.com"
opaServerAuthToken: ${{ secrets.OPA_SERVER_AUTH_TOKEN }}
opaServerInput: '{"input": null}'
opaServerPackageName: "example/include" # Package name to be given using `/` as the delimiter instead of `.`. For instance package `example.include` should be given as `example/include`
skipTlsValidation: true # Skip TLS validation. Get the data from OPA by ignoring the certificate.
NOTE: Following is a simple policy in the OPA server.
include.rego
:
package example.include
allow := false
Input | Description |
---|---|
opaServerUrl |
Open Policy Agent (OPA) Server address (with protocol) |
opaServerAuthToken |
Open Policy Agent (OPA) Auth token |
opaServerInput |
Open Policy Agent (OPA) input |
opaServerPackageName |
Open Policy Agent (OPA) package name from which the server should fetch the policy |
skipTlsValidation |
Skip TLS validation. Get the data from OPA by ignoring the certificate (default = false) |
You can check the policy using Open Policy Agent (OPA).
name: Policy validation using OPA
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@latest
- name: Check policy using Open Policy Agent (OPA)
uses: opsverse/[email protected]
with:
opaServerUrl: "https://opa.example.com"
opaServerAuthToken: ${{ secrets.OPA_SERVER_AUTH_TOKEN }}
opaServerInput: '{"input": null}'
opaServerPackageName: "example/include" # Package name to be given using `/` as the delimiter instead of `.`. For instance package `example.include` should be given as `example/include`
skipTlsValidation: true # Skip TLS validation. Get the data from OPA by ignoring the certificate.
NOTE: Following is a simple policy in the OPA server.
include.rego
:
package example.include
allow := false