When looking at an application architecture diagram, it is easy to focus on the boxes.
There is a frontend. An API gateway. A couple of backend services. A database. Object storage. Authentication sits somewhere off to the side.
From a security perspective, however, the most interesting parts of the diagram are often not the boxes.
They are the spaces between them.
Those spaces represent changes in trust.
And once you start looking at architecture in terms of where trust changes, why it changes, and what must happen before trust can continue, architecture review becomes much more systematic.
Consider a relatively straightforward internal application:
Employee
│
▼
Corporate IdP
│
▼
React Frontend
│
▼
Cloud Load Balancer
│
▼
API Gateway
├──────────────┐
▼ ▼
User Service File Service
│ │
▼ ▼
PostgreSQL S3 Bucket
Employees authenticate through a corporate identity provider. The frontend receives an OAuth access token and sends it as a bearer token to the API gateway. The gateway validates the JWT before forwarding authenticated requests to backend services.
The File Service stores uploaded objects in S3, while metadata is stored in PostgreSQL.
Nothing about this architecture looks particularly exotic.
That is exactly why it is useful.
The interesting security questions come from the assumptions connecting these components.
Start by Understanding the Machine
One of the easiest mistakes during a security review is jumping immediately into vulnerability hunting.
SQL injection.
Broken access control.
Token attacks.
S3 misconfiguration.
Those may all eventually matter, but starting there skips an important step.
Before asking how the system can be broken, understand how the system is supposed to work.
For this architecture, that means tracing the request lifecycle:
- An employee authenticates with the corporate identity provider.
- The identity provider issues an OAuth access token.
- The frontend sends that token to the API gateway.
- The gateway validates the JWT.
- An authenticated request continues toward the appropriate backend service.
- Backend services interact with PostgreSQL or S3.
That gives us the data flow.
Now we can start asking the more interesting question:
Where does the system's assumption about trust change?
A Trust Boundary Is Not a Component
A trust boundary is easy to misunderstand as a particular security component.
The API gateway validates tokens, so perhaps the API gateway is the trust boundary.
The IdP performs authentication, so perhaps the IdP is the trust boundary.
Not quite.
The boundary is the transition between environments with different trust assumptions.
A more useful representation of the architecture looks like this:
Employee
│
==== Untrusted user → Corporate identity ===================
│ Authentication required
▼
Corporate IdP
│ OAuth access token issued
▼
React Frontend
│ Bearer token sent
==== Internet → Application edge ===========================
▼
Cloud Load Balancer
▼
API Gateway
│ JWT validated
==== Edge → Internal services ==============================
├──────────────┐
▼ ▼
User Service File Service
│ │
==== Services → Persistent data stores =====================
▼ ▼
PostgreSQL S3 Bucket
The horizontal lines identify where trust assumptions change.
The annotations explain what security-relevant event occurs as data crosses those boundaries.
That distinction matters.
Saying:
The API gateway validates the JWT.
describes a security mechanism.
Asking:
Why must the JWT be validated before this request continues?
describes the trust problem that made the mechanism necessary.
That leads to a much more durable definition:
A trust boundary is a point where assumptions about trust change, requiring one or more security decisions before the request, identity, or data can continue.
Trust Boundaries Explain Why Controls Exist
Once trust boundaries are identified, security controls stop looking like a random checklist.
Take the employee entering the corporate identity environment.
The system does not yet know who that person is.
That creates questions around authentication, MFA, session management, brute-force resistance, rate limiting, and account protection.
Move to the Internet-facing application boundary.
Requests are coming from an untrusted environment into the application.
Now the relevant controls include TLS, token validation, rate limiting, and handling of untrusted input.
Then consider the transition from the gateway into internal services.
Something important has changed.
The user may now be authenticated.
That does not mean the user is authorized.
This distinction is one of the most important security assumptions in the architecture.
The gateway may have established:
This request came from Kendall.
The backend must still determine:
Is Kendall allowed to perform this action on this particular resource?
That is where RBAC, ABAC, object-level authorization, and other authorization decisions become critical.
Finally, backend services cross another boundary when accessing persistent storage.
The question changes again:
What should this service be allowed to access?
Now least privilege, database permissions, IAM policies, encryption, logging, and resource configuration become important.
The control depends on the trust problem being solved.
Authentication Is Not Authorization
The gateway validating a JWT proves something about identity.
It does not automatically prove permission.
Consider a perfectly legitimate employee with a perfectly legitimate access token.
The employee requests:
GET /files/12345
The token is valid.
The gateway correctly authenticates the request.
The File Service then has another decision to make:
Does this employee have permission to access file 12345?
If the application treats successful authentication as sufficient authorization, the system can still be compromised without defeating authentication at all.
An attacker may not need to forge a token.
They may simply abuse a valid one.
This is why the gateway-to-service transition deserves careful attention during an architecture review. Internal does not automatically mean trusted, and authenticated does not automatically mean authorized.
Architecture Review Is Really Assumption Review
Another important lesson appears when the architecture is incomplete.
Suppose the design says:
Gateway validates JWT.
Gateway forwards authenticated requests to backend services.
It is tempting to draw:
API Gateway
│ validated bearer token
▼
Backend Service
But the description does not actually establish that the original bearer token is forwarded.
The gateway might forward:
- The original token
- Selected identity claims
- Trusted headers
- A newly issued internal token
- Some other authenticated request context
The correct security response is not to invent the missing architecture.
It is to identify the assumption.
How is authenticated identity propagated from the API gateway to the backend services?
That question may uncover an important security decision.
The same principle applies throughout an architecture review:
- Where are secrets stored?
- How are authorization decisions enforced?
- Which IAM roles do services use?
- How are uploaded files validated?
- Can backend services be reached without passing through the gateway?
- Does the application ever handle user credentials directly?
- How are sessions expired or invalidated?
- What prevents one user from accessing another user's records or files?
Missing information is not an inconvenience.
It is part of the review.
Find the Crown Jewels
The next step is identifying what an attacker would actually want.
Not every box deserves equal attention.
In this architecture, PostgreSQL and S3 are obvious high-value assets because they contain persistent application data and uploaded files.
The corporate IdP is particularly important because its compromise could affect everything downstream.
Other valuable assets may not even appear on the diagram:
- JWT signing keys
- Service credentials
- Database credentials
- Encryption keys
- API secrets
That absence itself generates useful review questions.
Where do those assets live?
Who can access them?
How are they rotated?
Architecture review is therefore not just about identifying what has been drawn.
It is also about identifying what should exist but has not been shown.
Entry Points and Attack Surfaces Are Different
The frontend is an entry point.
The IdP is an entry point.
The API gateway may be an entry point.
The file upload endpoint is an entry point.
But identifying an entry point does not automatically tell us which part of the architecture creates the greatest security concern.
A useful distinction is:
Entry point: Where someone can begin interacting with the system.
Trust boundary: Where the system's trust assumptions change.
Attack surface: The functionality, interfaces, and transitions an attacker may attempt to abuse.
Trust boundaries are particularly useful for finding attack surfaces because every transition forces us to ask what happens if the security assumption at that transition is wrong.
Model Attacks as Attacker → Path → Impact
Threat modeling does not have to begin with an enormous framework.
A simple model works surprisingly well:
Attacker → Attack Path → Impact
Consider the corporate IdP.
External attacker
↓
Credential attack against employee account
↓
Account compromise
↓
Authenticated access to downstream systems
Now consider authorization:
Malicious or compromised employee
↓
Legitimate access token
↓
Request another user's file
↓
Missing object-level authorization
↓
Unauthorized data disclosure
Or database access:
Attacker
↓
Malicious application input
↓
Unsafe SQL construction
↓
PostgreSQL
↓
Data disclosure, modification, or destruction
Or availability:
External attacker
↓
High-volume requests
↓
Internet-facing service exhaustion
↓
Application unavailable
↓
Business disruption
This framework forces every threat to answer three questions:
Who is attacking?
How do they get there?
What happens if they succeed?
As experience grows, the catalog of possible attack paths grows with it: broken object authorization, file upload abuse, excessive IAM permissions, public object storage, SSRF where applicable, injection, token misuse, and many others.
The reasoning framework does not need to change.
Defense in Depth Becomes Easier to See
Thinking in trust boundaries also makes defense in depth much less abstract.
Consider an attacker with stolen employee credentials.
MFA may stop them.
If MFA fails, short-lived tokens reduce the useful lifetime of stolen authentication material.
If a valid token is compromised, authorization controls should still restrict what that identity can access.
If authorization fails, least-privileged service identities should limit access to backend resources.
If inappropriate data access occurs anyway, logging and monitoring should help detect it.
That creates layers:
Authentication
↓
Token validation
↓
Authorization
↓
Service permissions
↓
Resource permissions
↓
Logging and detection
No single control has to carry the entire security model.
That is the point.
Security architecture should assume individual controls can eventually fail.
Put Controls Where the Trust Changes
A practical architecture review should not end with a giant unordered list of recommendations.
Controls should be connected to the security decisions they support.
At the identity boundary, consider controls such as MFA, sensible session expiration, brute-force protections, rate limiting, and monitoring of suspicious authentication activity.
At the Internet-facing application boundary, token validation, TLS, rate limiting, and handling of untrusted input become important.
At the internal service boundary, authorization becomes central. RBAC and ABAC can help define who is allowed to perform actions, while object-level authorization ensures a legitimate user cannot access another user's data merely by changing an identifier.
At the data boundary, least privilege becomes increasingly important. Services should receive only the database and object-storage permissions they actually require.
S3 public access is a related but distinct concern. Authorization models such as RBAC and ABAC determine who should have access, while IAM policies and S3 resource configuration enforce infrastructure-level restrictions such as preventing unintended public access.
For database injection risks, input validation provides useful defense in depth, but safe query construction, such as parameterized queries, remains important where SQL is actually constructed.
The architecture should not depend on a single component perfectly preventing every attack.
From Penetration Testing to Security Engineering
There is a subtle shift that happens when moving from offensive testing toward application security and security engineering.
The offensive question is often:
How can I break this?
The architecture-review question begins earlier:
How is this supposed to work?
Then:
What does this design assume?
Then:
Where does that assumption change?
Then:
What security decision is required?
And finally:
What happens if that decision is wrong?
That progression looks something like:
Understand
↓
Model
↓
Review
↓
Attack
↓
Engineer
↓
Communicate
The offensive mindset is still there.
It is simply being applied earlier in the engineering lifecycle.
Instead of waiting for a vulnerability to appear in deployed code, the goal is to identify the architectural assumption capable of creating an entire class of vulnerabilities.
The Diagram Is Only the Beginning
A simple architecture diagram can reveal a surprising amount once you stop looking only at its components.
The boxes tell you what exists.
The arrows tell you what moves.
The trust boundaries tell you where assumptions change.
Threat modeling asks how those assumptions can fail.
Security controls determine what must happen before trust continues.
Defense in depth asks what happens when one of those controls fails anyway.
And architecture review asks one question repeatedly:
What are we trusting here, and why are we allowed to trust it?
That question scales.
It works for a React application behind an API gateway.
It works for microservices.
It works for cloud infrastructure.
It works for identity systems.
It works for distributed applications far more complicated than the example above.
Once you learn to see trust rather than just components, an architecture diagram stops being a collection of boxes and arrows.
It becomes a map of security decisions.