Automation Examples
Once you have the CLI working locally, extend coverage by embedding Alprina into your automation stack. These examples use API keys created in the dashboard (store them securely as secrets).
Case Study: FastShip’s CI/CD Security Transformation
Background: FastShip, an e-commerce logistics platform, was shipping code to production 15-20 times per day. They had no automated security checks, relying on monthly manual security reviews that found issues weeks after they shipped.
The Problem:
- Deployment Frequency: 15-20 production releases daily
- Security Review: Manual, monthly (30-day lag)
- Incidents: 8 security hotfixes in 3 months
- Customer Impact: 2 service disruptions from security patches
- Team Morale: Developers frustrated by “surprise” vulnerabilities
- Cost: $45,000 in emergency fixes over 3 months
The Breaking Point: On November 1st, a critical authentication bypass was discovered in production after 12 days of exposure. The vulnerability had been introduced in a routine feature release and affected 2,400 customers.
Incident Costs:
- Emergency response team: $8,000 (weekend callout)
- Customer notifications: 40 hours of support time
- Reputation damage: 6 customer cancellations ($180,000 ARR lost)
- Security consultant: $12,000 for incident investigation
- Total: $200,000+ in direct costs
Alprina Solution: Integrated automated security scanning into GitHub Actions, GitLab CI, and Jenkins pipelines.
Results After 30 Days:
- Vulnerabilities Blocked: 47 critical/high issues prevented from reaching production
- Production Incidents: 0 (down from 8 in previous 3 months)
- Average Fix Time: 23 minutes (down from 2-4 weeks)
- Cost Savings: $239,703 per quarter
- Developer Satisfaction: 4.8/5 survey rating
CTO’s Testimonial: “Alprina paid for itself on day one. We went from 8 security incidents per quarter to zero. The 240,000 we were spending on reactive security.”
Key Success Factors:
- Prevention vs Reaction: Shifted from monthly cleanup to instant prevention
- Fast Feedback: 2-3 minutes vs 30 days
- Automated Blocking: Vulnerabilities automatically block PR merges
- Mean Time to Detection: 30 days → 3 minutes (99.99% improvement)
GitHub Actions
name: Security Scan
on:
pull_request:
schedule:
- cron: "0 3 * * *" # nightly scan
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install alprina-cli
- name: Authenticate
run: alprina auth login --api-key ${{ secrets.ALPRINA_API_KEY }}
- name: Run scan
run: alprina scan ./src --profile code-audit --safe-only true --output scan-results.json
- name: Upload report
run: alprina report --format html --output reports/scan.html
- uses: actions/upload-artifact@v4
with:
name: alprina-report
path: reports/scan.htmlGitLab CI
stages:
- security
alprina_scan:
stage: security
image: python:3.11-slim
script:
- pip install alprina-cli
- alprina auth login --api-key "$ALPRINA_API_KEY"
- alprina scan ./ --profile code-audit --safe-only true --output alprina.json
- alprina report --format json --output alprina-report.json
artifacts:
when: always
paths:
- alprina.json
- alprina-report.jsonJenkins Pipeline (Declarative)
pipeline {
agent any
environment {
ALPRINA_API_KEY = credentials('alprina-api-key')
}
stages {
stage('Install') {
steps {
sh 'pip install --user alprina-cli'
}
}
stage('Scan') {
steps {
sh '''
~/.local/bin/alprina auth login --api-key $ALPRINA_API_KEY
~/.local/bin/alprina scan ./services/api --profile code-audit --output scan.json
~/.local/bin/alprina report --format html --output report.html
'''
}
}
}
post {
always {
archiveArtifacts artifacts: 'scan.json, report.html', fingerprint: true
}
}
}Slack or Teams Alerts
Combine Alprina with your notification system after each scan.
alprina scan ./src --profile code-audit --output scan.json
python - <<'PY'
import json, os, requests
data = json.load(open("scan.json"))
critical = [f for f in data.get("findings", []) if f.get("severity") == "CRITICAL"]
if critical:
text = f":rotating_light: {len(critical)} critical findings detected. Check the dashboard."
requests.post(os.environ["SLACK_WEBHOOK_URL"], json={"text": text})
PYTicketing Integration
Create issues automatically in Jira or Linear whenever high-risk findings appear.
alprina scan ./service --profile code-audit --output findings.json
python create_tickets.py findings.jsonInside create_tickets.py, parse findings and call your ticketing API with remediation steps from the report or chat assistant.
Scheduled Jobs
Use cron, AWS EventBridge, or Google Cloud Scheduler to run recurring scans against production endpoints:
0 2 * * * /usr/local/bin/alprina scan https://api.example.com --profile web-recon --safe-only true --output /var/reports/alprina-$(date +\%Y\%m\%d).jsonFollow each run with /save in chat or upload the JSON to your SIEM for correlation.
Need more help wiring things together? Reach out via support or explore the CLI Scan Recipes and Interactive Chat Workflows for building blocks you can adapt to any platform.