CI/CD security gate

What middleBrick covers

  • Black-box API scanning with no agents or code access
  • OpenAPI 3.0/3.1 and Swagger 2.0 parsing with ref resolution
  • Detection of OWASP API Top 10 (2023) issues
  • Authenticated scans with header allowlist controls
  • CI/CD integration via GitHub Action and MCP Server
  • Continuous monitoring with diff detection and alerts

What a CI/CD security gate is and why it matters

A CI/CD security gate inspects API definitions and runtime behavior before changes are promoted to production. Instead of treating API security as a final audit step, the gate evaluates each pull request or merge candidate and enforces a minimum risk threshold. Teams that skip this step often discover API issues late, when changes are already in production and exposure windows are larger.

Common gaps when teams omit automated API checks

Without automated checks, teams rely on manual review or periodic scans, which miss regressions introduced by routine code changes. Common gaps include unintentionally exposed internal fields, permissive CORS rules, over-privileged endpoints, and LLM-specific prompts or jailbreak paths being added without scrutiny. These issues can increase attack surface subtly across many deployments, especially when velocity is prioritized over visibility.

A practical workflow with a security gate

A workable workflow integrates scanning early and often in the pipeline. On each pull request, the CI job runs a read-only scan against a target environment or mock server, produces a score, and compares findings against a defined policy. If the score drops below the threshold or a new high-risk finding appears, the build fails and developers receive structured output describing the issue and remediation guidance. Example CLI usage:

middlebrick scan https://api.example.com/openapi.json --format json

Results can be consumed by GitHub Actions to gate merges, and by the web dashboard to track score trends across branches.

What middleBrick covers out of the box

middleBrick operates as a black-box scanner that requires no code access or agents. It parses OpenAPI 3.0, 3.1, and Swagger 2.0 definitions, cross-references spec security schemes with runtime behavior, and supports authenticated scans using Bearer tokens, API keys, Basic auth, and cookies. Out of the box it detects issues spanning authentication bypass, IDOR, privilege escalation, data exposure, input validation misconfigurations, rate-limiting indicators, and LLM-specific adversarial probes across defined tiers. Findings are mapped to OWASP API Top 10 (2023), and relevant alignment is provided for PCI-DSS 4.0 and SOC 2 Type II.

Policy controls and integration options

You can set organization-wide score thresholds and per-API exceptions, and configure automated actions through the web dashboard, CLI, and GitHub Action. The GitHub Action fails builds when the score degrades beyond your chosen threshold, while the MCP server allows API security checks from AI coding assistants. Continuous monitoring options enable scheduled rescans, diff detection between runs, and HMAC-SHA256 signed webhooks that auto-disable after repeated failures. Note that the tool surfaces findings and remediation guidance; it does not apply fixes, patch code, or block infrastructure.

Limitations and complementary practices

Automated scanning cannot detect business logic flaws that require domain understanding, nor does it perform intrusive tests such as active SQL or command injection. Blind SSRF and certain zero-step authorization issues are also out of scope, and the tool does not replace a human pentester for high-stakes audits. For regulations such as HIPAA, GDPR, ISO 27001, NIST, CCPA, or others, middleBrick helps you prepare for audits and supports audit evidence collection, but it does not certify compliance or guarantee adherence to any standard.

Frequently Asked Questions

How does the GitHub Action enforce a security gate?
The action runs a scan on your API definition or endpoint, evaluates the score against a threshold you set, and fails the workflow if the score is below the threshold or new high-risk findings are detected.
Can authenticated scans be used in CI pipelines?
Yes, authenticated scans are supported with Bearer, API key, Basic auth, and cookies. Domain verification is required so that only the domain owner can submit credentials for scanning.
Does the tool attempt to exploit or modify data during scans?
No. The scanner uses only read-only methods (GET and HEAD) and text-only POST for LLM probes. It does not execute destructive payloads.
What frameworks does scanning coverage align with?
Findings map directly to OWASP API Top 10 (2023), and alignment is provided for PCI-DSS 4.0 and SOC 2 Type II. Other regulations are supported through alignment framing, not compliance guarantees.