Interview Prep/DevSecOps/Pipeline Security Scanning

How do you add API security testing to a pipeline for a REST service with an OpenAPI spec?

IntermediateScenarioPipeline Security Scanning
Answer

Situation read → The spec lets a scanner know every endpoint, so crawling is not needed.

What I'd do →

  1. Lint the spec for security issues (spectral with an OWASP ruleset).
  2. Deploy to an ephemeral environment.
  3. Run zap-api-scan.py -t https://api.stg.example.com/openapi.json -f openapi -r api.html with an auth header.
  4. Add contract-based fuzzing (schemathesis run) for unexpected inputs.
  5. Test authorization separately: two users, check one cannot read the other's object (BOLA).

Why → Generic scanners are weak at authorization bugs, so you need explicit tests for them.

Interview tip → Say BOLA is the top API risk in the OWASP API Top 10.

All DevSecOps questions Roadmap: Security in the pipeline

More on Pipeline Security Scanning