Automated Scanning
CodeStax offers multiple ways to automate security scanning in your development workflow.
Auto-Scan on Push
When enabled, CodeStax automatically triggers a scan whenever code is pushed to your repository.
How It Works
- CodeStax registers a webhook on your GitHub or Bitbucket repository
- When you push code, the SCM provider sends a webhook event to CodeStax
- CodeStax triggers a scan with your configured default scan type
- Results appear on your dashboard automatically
Enable/Disable
Go to Settings → General → Scanning Preferences:
- Toggle Auto-scan on Push on or off
Scheduled Scans
Set up recurring scans on a schedule.
Creating a Schedule
- Go to a repository’s settings
- Set a cron expression for the schedule
Common schedules:
| Schedule | Cron Expression | Description |
|---|---|---|
| Daily at midnight | 0 0 * * * | Nightly security check |
| Every Monday 9 AM | 0 9 * * 1 | Weekly team review |
| Every 6 hours | 0 */6 * * * | Frequent monitoring |
| First of month | 0 0 1 * * | Monthly compliance scan |
Schedule Options
- Scan Type — Smart or Deep
- Branch Filter — Which branch to scan (default:
main) - Active/Inactive — Pause a schedule without deleting it
Schedule Limits
| Plan | Max Scheduled Scans |
|---|---|
| Free | 0 |
| Pro | 2 |
| Team | 20 |
| Enterprise | Unlimited |
Webhook Integration
GitHub Webhooks
CodeStax listens for GitHub webhook events to trigger automated PR reviews.
Supported events:
pull_request.opened— New PR openedpull_request.synchronize— New commits pushed to PRpull_request.reopened— Previously closed PR reopened
Webhook payloads are verified using HMAC SHA-256 signatures to ensure they originate from GitHub.
Bitbucket Webhooks
Similar webhook support for Bitbucket pull requests.
CI/CD Integration
Use the CodeStax API to integrate security scanning into your CI/CD pipeline. See API Reference for details on triggering scans programmatically.
Example: GitHub Actions
- name: Trigger CodeStax Scan
run: |
curl -X POST \
-H "X-API-Key: ${{ secrets.CODESTAX_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"repository_id": "your-repo-id", "scan_type": "smart"}' \
https://codestax.co/api/scans/triggerScan Timeouts
Configure scan timeout in Settings → General → Scanning Preferences:
| Option | Duration |
|---|---|
| Default | 15 minutes |
| Extended | 30 minutes |
| Long | 1 hour |
| Maximum | 2 hours |