Documentation Index
Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Run automated security and code quality scanning on your repository with comprehensive analysis, vulnerability detection, and detailed insights. Reference Repository: ci-scan-codeantFeatures
- 🛡️ Automated security and code quality scanning
- 🔍 Deep code analysis and vulnerability detection
- 📊 Detailed reports and insights
- ⚡ Fast and easy integration
Setup
1. Get Your Access Token
Bitbucket supports two token scopes — use whichever fits your setup:| Token Type | Best For | Where to Create |
|---|---|---|
| Repository Access Token | Single repository | Repository Settings → Security → Access tokens |
| Workspace Access Token | All repos in a workspace | Workspace Settings → Security → Access tokens |
- Go to your repository Settings
- Navigate to Security > Access tokens
- Click Create repository access token
- Select permissions:
- Repositories: Read, Write (allow repository read/write access)
- Pull requests: Read, Write (allow pull request read/write access)
- Copy the generated token
- Go to your workspace Settings
- Navigate to Security > Access tokens
- Click Create workspace access token
- Select the same permissions as above
- Copy the generated token

Note: Do not use an Atlassian API Token (generated at id.atlassian.com) — that token authenticates with Jira Cloud, Confluence Cloud, and Jira Align only, and will not work with Bitbucket. See Atlassian docs. Use a Bitbucket Repository Access Token or Workspace Access Token instead.
2. Configure Repository Variables
Before using the pipe, configure these repository variables in Repository Settings → Pipelines → Repository variables:BITBUCKET_ACCESS_TOKEN- Your Bitbucket Repository Access Token (set this as a repository variable). Note: pipeline examples referenceACCESS_TOKEN— ensure you assignACCESS_TOKEN: $BITBUCKET_ACCESS_TOKENin your pipeline steps or setACCESS_TOKENdirectly as a repository variable.
Basic Usage
Example 1: Run CI Scan on Every Push
Example 2: Run CI Scan on Pull Requests Only
Example 3: Branch-Specific Scanning
Example 4: Custom File Filtering with Timeout and Scanners
Example 5: Manual Trigger Pipeline
Configuration Variables
| Variable | Required | Default | Description |
|---|---|---|---|
BITBUCKET_ACCESS_TOKEN | Yes | - | Bitbucket Repository Access Token for authentication (set as repository variable and pass as ACCESS_TOKEN: $BITBUCKET_ACCESS_TOKEN in pipeline) |
API_BASE | No | https://api.codeant.ai | Base URL for CodeAnt API |
SCANNERS | No | sast,sca | Comma-separated list of scanners to run (e.g., all, sast, sast,sca,secrets) |
INCLUDE_PATHS | No | '' | Comma-separated paths to include in scan (e.g., src,lib) |
EXCLUDE_PATHS | No | '' | Comma-separated paths to exclude from scan (e.g., tests,docs) |
TIMEOUT | No | 300 | Maximum time in seconds to wait for scan results |
POLLING_INTERVAL | No | 30 | Time in seconds between polling attempts |
Scanner Options
🔍 Available Scanners: TheSCANNERS variable allows you to customize which security scanners run during analysis:
sast- Static Application Security Testing (code vulnerabilities)sca- Software Composition Analysis (dependency vulnerabilities)secrets- Secret detection (API keys, passwords, tokens)antipatterns- Code quality and duplicate code detectioniac- Infrastructure as Code security (Terraform, CloudFormation, etc.)all- Run all available scanners
sast,sca
Examples:
- Run all scanners:
SCANNERS: 'all' - Only SAST:
SCANNERS: 'sast' - SAST + Secrets:
SCANNERS: 'sast,secrets' - Full security suite:
SCANNERS: 'sast,sca,secrets,iac'
Scanner Configuration Examples
Run All Scanners
Security-Focused Scan
How It Works
-
Download script
We fetch a small Bash helper (
start_scan.sh) from the CodeAnt CI endpoint. - Make it runnable Mark the script executable so you can invoke it directly.
-
Invoke the scan
The script POSTs your repo, commit, and file-globs to
/analysis/ci/scan, using your token for auth. -
Pipeline feedback
- On success, you’ll see a parsed JSON response in the job log.
- On failure (non-2xx HTTP), the script exits non-zero, failing your pipeline immediately.
Execution Time Considerations
⏱️ Performance Options:-
Default behavior (with result waiting): ~5-7 minutes
- Triggers scan and waits for complete analysis results
- Includes both security and SCA (Software Composition Analysis) results
- Best for comprehensive CI/CD pipelines where you need immediate feedback
-
Custom timeout settings: Adjust based on repository size
- Use
TIMEOUT: '900'(15 minutes) for larger repositories - Use
POLLING_INTERVAL: '45'to reduce API polling frequency - Results can also be viewed in the CodeAnt dashboard
- Use
SCANNERS variable for targeted or comprehensive security analysis.
Troubleshooting
Pipeline Fails Immediately
Issue: Pipeline fails with “ACCESS_TOKEN is required but not set” Solution: Ensure you’ve setBITBUCKET_ACCESS_TOKEN in your repository variables and it’s marked as secured.
Scan Failures
Issue: Scan fails or returns errors Solution: Verify your repository is accessible, check the API base URL is correct, and review pipeline logs for specific error messages.Authentication Errors
Issue: Authentication errors during scan Solution: Verify yourBITBUCKET_ACCESS_TOKEN is valid, has necessary permissions, and is not expired.
Pipe Not Found
Issue: Cannot pull the Docker image Solution: Verify the pipe image pathdocker://public.ecr.aws/d2p9q4a9/ci-scan-codeant:latest is correct and your workspace has access to pull public Docker images.
Support
- 📧 Email: support@codeant.ai
- 📚 Documentation: https://docs.codeant.ai
- 🐛 Repository: https://bitbucket.org/codeantworkspace/ci-scan-codeant/src/main/