CI/CD Integrations
Bitbucket Pipeline Setup for Local Code Scanning
Run the CybeDefend CLI in Bitbucket Pipelines to securely upload and scan your repository code.
Use Bitbucket Pipelines to automate local scanning with the CybeDefend CLI. This approach is ideal if you want to keep direct repository access closed and rely on your pipeline to handle code uploads.
Prerequisites
- API Key: Create it and store in Bitbucket’s Repository Settings → Pipelines → Repository Variables.
- Bitbucket Pipelines: Enable pipelines in your repository.
Example bitbucket-pipelines.yml
Explanation
- image
ubuntu:latest
is sufficient for installing cURL and the CLI. - Install CLI
Similar approach as other platforms. - Run the Scan
Use environment variables$CYBEDEFEND_API_KEY
and$CYBEDEFEND_PROJECT_ID
defined in Bitbucket’s pipeline settings.
You can add advanced steps, such as storing results in artifacts or gating merges based on severity thresholds.
Where to Check Results
- Pipeline Logs: The CLI’s console output shows a summary.
- Local Results: Optionally fetch
sarif
orhtml
outputs in subsequent steps: - CybeDefend Dashboard: Provides a deeper analysis of all vulnerabilities discovered.
Bitbucket Pipelines may have build minute limitations. Ensure your scans complete within your pipeline’s allotted time.
For huge codebases, consider partial scans or artifact caching to reduce pipeline duration.