middlebrick
CLI for middleBrick API security scanning. Scan APIs from your terminal, get risk scores, and gate CI/CD pipelines.
Install
npm install -g middlebrick
Quick Start
middlebrick configure
middlebrick scan https://api.example.com/v1/users
middlebrick scan https://api.example.com/v1/users --format json
middlebrick scan https://api.example.com/v1/users --threshold 80
Commands
middlebrick scan <url>
Scan an API endpoint and display security results.
--method <METHOD> | HTTP method | GET |
--format <FORMAT> | Output: summary, json, table | summary |
--threshold <score> | Exit code 1 if score below threshold | — |
--no-wait | Return scanId immediately | — |
middlebrick results <scanId>
Fetch results of a previous scan.
middlebrick configure
Interactively set up your API key. Saves to ~/.middlebrick/config.json.
Authentication
| 1 | --api-key flag |
| 2 | MIDDLEBRICK_API_KEY env var |
| 3 | ~/.middlebrick/config.json |
Exit Codes
| 0 | Success |
| 1 | Scan failed or score below threshold |
| 2 | Auth/config error |
CI/CD
- name: API Security Gate
run: npx middlebrick scan ${{ env.API_URL }} --threshold 75 --api-key ${{ secrets.MIDDLEBRICK_API_KEY }}
License
MIT — Zevlat Intelligence