Enable Application Security using OPA
Before you begin
This how-to involves working with a variety of tools and technologies such as Digital.ai Release, Digital.ai Deploy's DevOps as code (YAML files), GitHub, OPA, and so on. You can perform this task by simply following the instructions. However, being familiar with these tools and technologies can help you considerably when you try this out in your test environment.
What's the objective?
The objective is to set up an automated release and deployment pipeline—a pipeline of tools such as OPA, Application Security, Digital.ai Release, and have your application deployed to the required environment based on policy checks against guards and other security data.
Once you have this setup in place, all you would be doing is to push a code change to trigger a Parsing task in the automated release, evaluate the Application Security application output with predefined OPA policy, use the output to deploy the application in the test environment, verify the deployment to the test environment, and then approve the test deployment task to proceed with the deployment to your production environment.
What do you need?
- A Linux or Windows server (with root and Internet access) that has both Digital.ai and Release version 23.1.0 (or later) installed
- OPA plugin for Digital.ai Release (installed by default when you install Release)
- An OPA server running on local or remote host.
- An GitHub Actions/Jenkins Job with Application Security enabled (requires license for Application security software).
What do you have?
-
A xebialabs-community/application-security-opa GitHub repository that hosts the workflows and can be used to import the required templates.
-
A xebialabs-community/application-security-opa-policies GitHub repository that hosts the policies.
How does it work?

Here's a detailed step-by-step.
Step 1 — Set up Workflows for Templates
In Digital.ai Release,
- Create a new folder.
- From within the folder, in the left navigation pane, select Git versioning.
- Click Configure. The Git versioning settings screen opens.
- Under Git Repository, click on the New Repository link.
- Create a new connection by specifying the details of the GitHub Repository.
- Specify the branch as main and specify the Repository path as ApplicationSecurityWorkflows or use OpaManagementTasks for management templates.
- Click Save.
Note: In the Connections screen, create a connection to the OPA server with the name OPA Server1.

- In the Git versioning screen, select the latest version displayed and click Apply this version.
- The workflow templates are populated in the Templates screen.

Step 2 — Add Policy for Application Security using Create Policy Task
The Create Policy task creates a policy in the OPA server.
Sample Policies are hosted in the xebialabs-community/application-security-opa-policies repository, which can be used to enforce Android or Ios based application security.
- In the release flow tab of a Release template, add a task of type OPA > Create Policy.
- Click the added task to open it.
- In the Server field, select the configured OPA server.
- In the Name of policy to be created field, add the policy name.
- For policy that is a string, paste the policy in the Policy field.
- To fetch the policy as a code from the GitHub repository, add the URL of GitHub raw file in the Git File Url field, and the GitHub PAT in the Git PAT field.
