liveBook · Manning

Network segmentation

As explained in Secure APIs

Network segmentation is the practice of dividing a network into isolated subnets to limit communication between components with different risk profiles.

Network segmentation divides a network into isolated subnets so components with different risk profiles cannot communicate freely. Each subnet can receive security rules suited to the APIs and resources it contains. section 1.1 section 9.5

Segmentation limits the damage from a compromised service, but it does not replace authentication, authorization, input validation, or continuous monitoring. A private network is not proof that an API is safe. section 1.8 section 3.4

Blocking an SSRF path to an admin service

A user service accepts a URL at POST /user/avatar and downloads the referenced avatar. If the user service can reach an admin service, an attacker can exploit SSRF to send an internal request and access sensitive data. Separating the services into restricted subnets removes that communication path, while input sanitization and access controls address the remaining weaknesses. section 1.1 section 3.4

Apply segmentation through a small set of architectural and operational choices:

  • Route internet traffic through a hardened DMZ containing components such as an API gateway, reverse proxy, load balancer, or WAF. section 9.2
  • Keep services in private subnets without internet access, and expose only documented, tested, secure endpoints through the API gateway. section 9.5
  • In AWS, separate resource groups with VPCs or public and private subnets, then restrict traffic with ACLs and security groups. section 9.2
  • Use bastion servers for controlled access to internal APIs and databases, allowing traffic only from approved origins. section 9.2
Figure 9.10 The DMZ is a region of our network that is exposed to the internet. It’s good practice to channel inbound traffic through the DMZ and keep all our services in private subnets. The DMZ can include elements such as an API gateway and bastion server.
figure

Use the topology figure to see how a DMZ channels inbound traffic while services remain in private subnets. section 9.2

Check every service-to-service path, especially paths from user-facing APIs to administrative or sensitive systems. Confirm that unnecessary ports and inbound routes are closed, and test that accidental deployment to an internet-accessible network cannot expose an unprotected internal API. section 9.5 section 3.4

How Secure APIs covers it

How deep it goes
Explains the definition, SSRF consequence, DMZ pattern, AWS implementation options, and traffic restrictions without detailing subnet design procedures.
Examples
Uses a user-avatar SSRF path to an admin service, plus DMZ, AWS VPC, subnet, ACL, security-group, and bastion-server topologies.
What it assumes
Assumes basic API and network concepts while introducing DMZs, VPCs, subnets, ACLs, security groups, and bastion servers.
What you can do after
Operate/configure API infrastructure by separating services, routing through a DMZ, restricting traffic, and checking unintended exposure paths.
How it connects
Connects network segmentation with API gateways, DMZs, private subnets, access control, SSRF, bastion servers, firewalls, and internal APIs.

Also explained in

Compare how 3 books explain network segmentation →

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.