liveBook · Manning

Contract

As explained in Secure APIs

A defined software interface through which applications or services expose data and functionality to other software.

An API is a defined software interface that lets applications or services expose data and functionality to other software. APIs power web and mobile applications, IoT integrations, automation, and service-to-service communication. Each API opens a controlled door into a system: useful when protected, dangerous when access is poorly designed or implemented. section 1.0

Because APIs provide access to data and operations, attackers can exploit weak authentication, authorization, rate limiting, or monitoring. Consequences include data theft, privacy violations, unwanted operations, service disruption, content scraping, business-model abuse, and regulatory sanctions. Treating API security as a design and operational concern reduces both technical and business risk. section 1.0 section 1.3

Secure API design and operation should make exposure deliberate and observable:

  • Treat internal APIs as public APIs, especially when they handle sensitive data or receive weaker protection. section 9.2
  • Place public APIs behind an API gateway or reverse proxy so access controls, visibility, and other protections apply at the entry point. section 9.2
  • Keep services in private subnets and expose endpoints through explicit gateway declarations; use a hardened bastion server for necessary internal access. section 9.2
  • Review authorization, rate limiting, monitoring, endpoint exposure, and compliance requirements before placing an API in production. section 1.3 section 9.2

Public and private API exposure

A public API can accept internet traffic through a DMZ and reverse proxy, forwarding approved requests to services on an internal network. A private API can remain in a private subnet, reachable externally only through a hardened bastion server. Declaring public endpoints through the gateway keeps the internet-facing attack surface visible while retaining internal endpoints for testing or back-office use. section 9.2

Figure 9.12 Using a combination of API gateway and bastion server, we make sure that our APIs expose only well-documented, tested, secure endpoints to the internet while keeping internal endpoints or endpoints in development accessible only by internal users and developers.
figure

Use the topology figure to compare documented, tested public endpoints with internal or development endpoints restricted to internal users and developers. section 9.2

How Secure APIs covers it

How deep it goes
Defines APIs plainly, explains attack and business consequences, and extends into gateway-based network topology without detailing API implementation code.
Examples
Uses web, mobile, IoT, and service-to-service integrations plus public-versus-private endpoint topologies and a customer-data breach scenario.
What you can do after
Evaluate/understand API exposure, identify likely security and business consequences, and plan gateway, subnet, access-control, and monitoring protections.
How it connects
Connects APIs with API gateways, reverse proxies, bastion servers, private subnets, zero-trust architecture, authorization, rate limiting, and compliance.

Also explained in

Compare how 44 books explain contract →

Related concepts

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