liveBook · Manning

API security

As explained in Automating API Delivery

API security is the protection of information exchanged through APIs and the reduction of risks arising from API vulnerabilities.

An API exposes business capabilities and information to consumers. API security protects those assets by reducing the risk that weaknesses in the API can be exploited. It is not a single design check: security work continues through design, development, testing, and runtime operation. section 10.2.1 section 8.11.6

Start by identifying what could be harmed. Threat modeling considers possible threats, their likelihood and impact, and the controls that could reduce the risk. A vulnerability is a weakness an attacker can exploit; an attack is an attempt to carry out a threat. Relevant controls include encryption, authentication, authorization, audit logging, and rate-limiting. section 10.2.1

Put checks where they can inform the next decision:

  • At design time, lint API definition files with security-focused rules. Include the check in a pull-request build so designers can address detected issues early. Keep secure-design guidance in the API style guide. section 8.11.6 section 10.0
  • In a deployment pipeline, an API security platform can scan definitions and enforce a quality gate. For example, a 42Crunch GitHub Action scores each definition from 0 to 100; configure a minimum passing score and inspect its linked report. section 8.11.6
  • In nonproduction testing, dynamically test application APIs for vulnerabilities and business-logic attacks. In production, monitor traffic for threats and take corrective action when an attack is identified. section 10.2.14

Review an insecure API proposal

Suppose you are asked to review an OpenAPI proposal for a car-service API before it is built. The intentionally insecure OWASP crAPI definition, `chapter10/crapi.api.yaml`, is a practice artifact: examine its design for security defects rather than treating a successful lint run as proof that the running service is safe. Follow design findings with testing and runtime checks as the API moves through delivery. section 10.2 section 10.2.1 section 10.2.14

Design scans can flag issues in authentication, authorization, transport, and payloads, but they address only the definition. Runtime monitoring addresses a different surface and can also help identify undocumented shadow APIs and deprecated zombie APIs still operating. Choose controls across the life cycle rather than relying on one score or one scan. section 8.11.6 section 10.2.14

How Automating API Delivery covers it

How deep it goes
Defines vulnerabilities and threat-modeling terms, then outlines design scans, dynamic testing, and runtime monitoring without detailing their implementation.
Examples
Uses an intentionally insecure OWASP crAPI OpenAPI definition for design review and a 42Crunch GitHub Action for scored pipeline checks.
What it assumes
Assumes familiarity with API definitions and pull-request workflows while defining basic security and threat-modeling terms.
What you can do after
Apply it via security-focused definition linting and a configurable pipeline gate, while planning separate testing and runtime protection.
How it connects
Connects threat modeling, API linting, authentication, authorization, and CI/CD quality gates to API security.

Also explained in

Compare how 3 books explain API security →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Automating API Delivery. The section links point to the parts of the book it draws on.