middlebrick
v0.1.0
Published
middleBrick CLI — API security scanning from your terminal
Readme
middlebrick
CLI for middleBrick API security scanning. Scan APIs from your terminal, get risk scores, and gate CI/CD pipelines.
Install
npm install -g middlebrickQuick Start
# Set up your API key
middlebrick configure
# Scan an API
middlebrick scan https://api.example.com/v1/users
# JSON output for CI
middlebrick scan https://api.example.com/v1/users --format json
# Fail if score < 80
middlebrick scan https://api.example.com/v1/users --threshold 80Commands
middlebrick scan <url>
Scan an API endpoint and display security results.
| Flag | Description | Default |
|------|-------------|---------|
| --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
| Priority | Source |
|----------|--------|
| 1 | --api-key flag |
| 2 | MIDDLEBRICK_API_KEY env var |
| 3 | ~/.middlebrick/config.json |
Exit Codes
| Code | Meaning | |------|---------| | 0 | Success | | 1 | Scan failed or score below threshold | | 2 | Auth/config error |
CI/CD
# GitHub Actions
- name: API Security Gate
run: npx middlebrick scan ${{ env.API_URL }} --threshold 75 --api-key ${{ secrets.MIDDLEBRICK_API_KEY }}License
MIT — Zevlat Intelligence
