Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement comprehensive API security testing using the 42Crunch platform to perform static audit and dynamic conformance scanning of OpenAPI specifications.
.claude/skills/implementing-api-security-testing-with-42crunch/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-17 | ✗→✓ | ▲ Improved | — | — |
| case-06 | ✗→✓ | ▲ Improved | — | — |
| case-08 | ✗→✓ | ▲ Improved | — | — |
| case-10 | ✗→✓ | ▲ Improved | — | — |
42Crunch is an API security platform that combines Shift-Left security testing with Shield-Right runtime protection. It provides API Audit for static security analysis of OpenAPI definitions, API Conformance Scan for dynamic vulnerability detection, and API Protect for real-time threat prevention. The platform integrates into CI/CD pipelines and IDEs to identify OWASP API Security Top 10 vulnerabilities before and after deployment.
API Audit performs static security analysis of OpenAPI definitions without requiring a running API. It evaluates the specification against 300+ security checks organized into categories:
Security Score Categories:
Running API Audit via VS Code Extension:
Example OpenAPI Definition with Security Controls:
yamlopenapi: 3.0.3 info: title: Secure User API version: 1.0.0 servers: - url: https://api.example.com/v1 description: Production server (HTTPS only) security: - BearerAuth: [] paths: /users/{userId}: get: operationId: getUserById summary: Retrieve user by ID parameters: - name: userId in: path required: true schema: type: string format: uuid pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' maxLength: 36 responses: '200': description: User details content: application/json: schema: $ref: '#/components/schemas/User' '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized '404': description: User not found components: securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: User: type: object required: - id - email properties: id: type: string format: uuid readOnly: true email: type: string format: email maxLength: 254 name: type: string maxLength: 100 pattern: '^[a-zA-Z\s\-]+$' additionalProperties: false Error: type: object required: - code - message properties: code: type: integer format: int32 message: type: string maxLength: 256 additionalProperties: false
The conformance scan dynamically tests a running API against its OpenAPI contract to detect runtime vulnerabilities including OWASP API Security Top 10 issues:
Scan v2 Configuration:
yaml# 42c-conf.yaml version: "2.0" scan: target: url: https://api.example.com/v1 authentication: - type: bearer token: "${API_TOKEN}" in: header name: Authorization settings: maxScanTime: 3600 requestsPerSecond: 10 followRedirects: false tests: owasp: - bola - bfla - injection - ssrf - massAssignment - excessiveDataExposure
Running Conformance Scan via CLI:
bash# Install the 42Crunch CLI npm install -g @42crunch/cicd-cli # Run conformance scan 42crunch-cli scan \ --api-definition ./openapi.yaml \ --target-url https://api.example.com/v1 \ --token $CRUNCH_TOKEN \ --min-score 70 \ --report-format sarif \ --output scan-report.sarif
GitHub Actions Integration:
yamlname: API Security Testing on: push: paths: - 'api/**' - 'openapi/**' jobs: api-security: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: 42Crunch API Audit uses: 42Crunch/api-security-audit-action@v3 with: api-token: ${{ secrets.CRUNCH_API_TOKEN }} collection-name: "my-api-collection" min-score: 75 upload-to-code-scanning: true - name: 42Crunch Conformance Scan if: github.ref == 'refs/heads/main' uses: 42Crunch/api-conformance-scan@v1 with: api-token: ${{ secrets.CRUNCH_API_TOKEN }} target-url: ${{ secrets.STAGING_API_URL }} scan-config: ./42c-conf.yaml
Jenkins Pipeline Integration:
groovypipeline { agent any stages { stage('API Security Audit') { steps { script { def auditResult = sh( script: ''' 42crunch-cli audit \ --api-definition openapi.yaml \ --token ${CRUNCH_TOKEN} \ --min-score 75 \ --report-format json \ --output audit-report.json ''', returnStatus: true ) if (auditResult != 0) { error("API Security Audit failed - score below threshold") } } } } stage('Conformance Scan') { when { branch 'main' } steps { sh ''' 42crunch-cli scan \ --api-definition openapi.yaml \ --target-url ${STAGING_URL} \ --token ${CRUNCH_TOKEN} \ --scan-config 42c-conf.yaml ''' } } } post { always { archiveArtifacts artifacts: '*-report.*' publishHTML([ reportDir: '.', reportFiles: 'audit-report.html', reportName: 'API Security Report' ]) } } }
API Protect deploys as a micro-gateway in front of API endpoints to enforce the OpenAPI contract at runtime:
yaml# api-protect-config.yaml apiVersion: v1 kind: ConfigMap metadata: name: api-protect-config data: protection-config.json: | { "apiDefinition": "/config/openapi.yaml", "enforcement": { "validateRequests": true, "validateResponses": true, "blockOnFailure": true, "logLevel": "warn" }, "rateLimit": { "enabled": true, "requestsPerMinute": 100, "burstSize": 20 }, "allowlist": { "contentTypes": ["application/json"], "methods": ["GET", "POST", "PUT", "DELETE"] } }
When 42Crunch identifies issues, follow this remediation process:
Common Audit Findings and Fixes:
| Finding | Severity | Fix | |---------|----------|-----| | No authentication defined | Critical | Add securitySchemes and security requirements | | Missing input validation | High | Add type, format, pattern, maxLength constraints | | Server URL uses HTTP | High | Change server URLs to HTTPS | | No error responses defined | Medium | Add 4xx and 5xx response definitions | | additionalProperties not restricted | Medium | Set additionalProperties: false on object schemas | | Missing rate limiting | Medium | Add x-rateLimit extension or use API Protect |
42Crunch evaluates APIs against these critical security areas:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +41 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.