Bitbucket App
OX Security supports integration with Bitbucket Cloud using the OX Bitbucket App.
This integration enables automatic pipeline scans triggered by events such as push and pull requests, without modifying your CI/CD pipeline configuration.
OX listens for push and pull request events from Bitbucket Cloud. When an event is detected, OX identifies the modified files and triggers a pipeline scan for the specific repository.
Scans run outside the Bitbucket pipeline and results are displayed in the OX platform.
Prerequisites
Bitbucket Cloud account
Admin access to your Bitbucket workspace
The OX Bitbucket App is installed and authorized for your repositories
Required Configuration
OX initiates scans using webhook data from BitBucket. You do not need to add variables or modify settings. You just need to make sure that webhooks are enabled.
To connect to Bitbucket app:
Go to the OX platform and navigate to Connectors > Source Control.
Select Bitbucket App and click Connect. You are redirected to Bitbucket.
Approve the OX Security app.
Select the repositories you want to monitor with OX. When connected, OX automatically receives webhook events and performs scans on changes.
Block pull request merges based on OX scan results
You can configure Bitbucket branch restrictions to prevent pull requests from being merged when OX detects issues that match your blocking policies.
OX reports scan results to Bitbucket as build results. When a scan finds issues that match your blocking policies, the build fails, and Bitbucket prevents the pull request from being merged.
To require successful OX scans before merging:
In Bitbucket, open the repository and select Repository settings.
Select Branch restrictions.

Select Add a branch restriction or edit an existing restriction for the target branch.

On the Merge settings tab, select Minimum number of successful builds for the last commit with no failed builds and no in progress builds.
Set the value to 1.
Select Save.
After the restriction is configured, pull requests cannot be merged until all required builds complete successfully. If OX finds issues that match your blocking policies, the build fails and Bitbucket blocks the merge until the issues are resolved.
Last updated
