You Can't Patch Your Way Out of the CVE Crisis

You Can't Patch Your Way Out of the CVE Crisis

Patching can't stop every CVE. See how Zero Trust and AWS architecture help limit damage when a workload is compromised.

Senior Cloud Engineer
With the current rate at which new CVEs are being published, you might be thinking about expanding your security team.
But let me ask you something.
How many vulnerabilities can your organization remediate per day?
10? 50? 100?
What if tomorrow brings another hundred? Would you hire more engineers? Invest in more scanning tools? Automate every patch?
And even if you could patch every vulnerability reported today, what would you do tomorrow?
Here’s another question:
What if patching more vulnerabilities doesn’t necessarily mean you’re becoming more secure?
We’ve spent years improving our ability to discover vulnerabilities. But are we putting the same effort into designing systems that can withstand them?
The numbers make this question increasingly relevant.
The CVE Program recorded 48,244 published vulnerabilities in 2025 and already 72,812 in the first three quarters of 2026. Meanwhile, Verizon’s 2026 DBIR reports that vulnerability exploitation accounted for 31% of breaches.
Of course, not every CVE affects our infrastructure. But the growing number of reported vulnerabilities raises an important question:
Are we building systems that depend on vulnerabilities being patched, or systems that can limit the damage even when they aren’t?

The Patching Paradox: Who Protects You Before the Patch?



A vulnerability might exist for years before discovery. Once discovered, it can take time for the vendor to develop a fix. Even after a patch becomes available, organizations need time to test and deploy it.
Throughout some or all of this period, attackers may have an opportunity to exploit the vulnerability.
So, if patching is our primary security strategy, who is protecting us while we’re waiting for the patch?

What If We Designed Our Systems to Be Compromised?

Think about it for a moment.
You have a fully patched environment. Your vulnerability scans are clean, your security team is satisfied, and everything looks good.
Then tomorrow, a critical vulnerability is discovered in one of the components you rely on.
Your infrastructure hasn’t changed. Your configuration hasn’t changed. But suddenly, something that appeared secure yesterday is considered vulnerable today.
The vulnerability was already there. We just didn’t know about it.
Now imagine that someone exploits it before a patch becomes available.

What happens next?
Can the attacker move from that compromised server to another? Can they access your databases? Can they reach other environments or accounts? Can they communicate with the internet and potentially exfiltrate sensitive data?
These are not questions that patch management alone can answer.
They are architectural questions.
And this is where I believe we need to change our approach.
Instead of designing infrastructure under the assumption that every component is secure, what if we designed it under the assumption that any component could become compromised at any time?
The objective would no longer be only to prevent the initial compromise, but also to make sure that compromising one component doesn’t automatically compromise everything connected to it.
So, how do we design systems that remain resilient even when vulnerabilities exist?
To answer that, let’s put ourselves in an attacker’s shoes and explore four fundamental questions. Each question will help us examine a different aspect of our architecture, from gaining initial access to limiting the damage after a compromise.

Can They Get In?

Let’s start with the most obvious question: How could an attacker reach and exploit a vulnerable component in our infrastructure?
Every publicly exposed service, management interface, and unnecessary access path potentially creates another opportunity for an attacker.
The goal isn’t to make every system unreachable. It’s to ensure that only the systems that genuinely need to be accessible are exposed, and only through the paths required for them to function.



Let’s Put Our Architecture to the Test

Enough theory. Let’s look at a practical example.
Imagine we’re running an application on Amazon ECS. The application connects to an RDS database, retrieves secrets from AWS Secrets Manager, accesses an S3 bucket, and communicates with another application running in a different VPC.
Nothing unusual, right? This is the kind of architecture we build every day.
Now imagine a critical vulnerability is discovered in one of the application’s dependencies, and an attacker manages to exploit it.
The attacker can now execute code inside our application container.
The vulnerability has already been exploited. Patching won’t undo what just happened.
So let’s forget about the CVE for a moment and focus on our architecture.
What can the attacker reach? What permissions do they have? And how much damage could they potentially cause?
Let’s find out.

1. Do We Really Need to Connect Two VPCs?

Let’s start with the network.
In our example, we have an Orders API running on Amazon ECS Fargate in Account A. It communicates with an RDS database, accesses an S3 bucket, retrieves secrets from Secrets Manager, and calls a Payments API running in Account B.
To enable communication between the two applications, we’ve established VPC Peering between the VPCs.
Nothing unusual so far.
But remember, our Orders API has been compromised. The attacker can now execute commands inside the container.
What can they reach from there?
With VPC Peering, we establish network connectivity between two VPCs. Depending on our route tables, security groups, and network ACLs, resources in one VPC may be able to communicate with resources in the other.
This doesn’t mean VPC Peering automatically exposes everything. We still control which routes exist and which traffic is allowed.
But consider a common scenario: we’ve added routes for the entire remote VPC CIDR and configured relatively permissive security groups to make communication easier.
Our Orders API only needs to talk to the Payments API, yet the compromised container might now be able to reach other services in the Payments VPC as well.
And that brings us to an architectural question:
If our Orders API only needs to communicate with the Payments API, why are we connecting their networks instead of just their services?
Perhaps we could use AWS PrivateLink or Amazon VPC Lattice to expose only the required service, without providing general network connectivity between the VPCs.
Of course, these services have their own trade-offs, and neither automatically makes an application secure. An attacker could still abuse the legitimate access granted to a compromised workload.
But they allow us to reconsider what we’re making accessible in the first place.
The point isn’t that VPC Peering is insecure or that we should stop using it.
The point is that connectivity should be an architectural decision, not an assumption.
Before connecting two VPCs, perhaps we should ask ourselves whether we actually need network-to-network connectivity or simply access to a particular service.

2. What If Network Isolation Isn't Enough?

So far, we’ve focused on network connectivity. We’ve discussed VPC Peering, VPC Lattice, and how limiting communication between services can reduce the opportunities available to an attacker.
But what if the attacker doesn’t need to reach another VPC in the first place?
Let’s go back to our compromised Orders API running on ECS Fargate.
Remember that our application also communicates with Amazon S3 and AWS Secrets Manager.
To access these services through the AWS APIs, our application uses an ECS task IAM role.
Now imagine that, during development, we assigned the following IAM policy to that role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*",
"secretsmanager:*"
],
"Resource": "*"
}
]
}
At first glance, everything works. Our application can access S3, retrieve its database credentials, and perform its operations without permission errors.
But let’s look at this policy from the attacker’s perspective.
The attacker has exploited a vulnerability and can now execute code inside our Orders API container.
Since the application has access to the task role’s temporary credentials, the attacker may be able to use those same credentials to call AWS APIs.
And look at what we’ve granted.
Access to every S3 resource and every Secrets Manager secret that this policy can authorize in the account.
Our Orders API might only need to read objects from one bucket and retrieve one database secret, but we’ve given it permissions that extend far beyond those requirements.
The attacker doesn’t necessarily need to establish a network connection to another VPC to access those resources. They can use the authorized AWS API operations, provided the required service endpoints are reachable and no other policies prevent the requests.
Suddenly, all the effort we put into network segmentation might not protect the resources exposed through these excessive IAM permissions.
So, what if we changed the policy?
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadOrdersData",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::example-orders-data/orders/*"
},
{
"Sid": "ReadDatabaseSecret",
"Effect": "Allow",
"Action": "secretsmanager:GetSecretValue",
"Resource": "arn:aws:secretsmanager:eu-west-1:111122223333:secret:prod/orders/database-AbCdEf"
}
]
}
Now our Orders API can read only the objects it needs and retrieve only its own database secret.
Assuming no other policy grants additional permissions, the attacker can no longer use this task role to access unrelated S3 objects or secrets.
But here’s something worth thinking about.
Even with this restricted policy, the attacker can still access the resources our application legitimately needs.
If the application can retrieve database credentials, so might the attacker who has compromised it.
If the application can read customer order data, those same permissions might be abused.
Least privilege reduces the blast radius, but it doesn’t make a compromised application harmless.
And this brings us back to Zero Trust.
We shouldn’t automatically trust an application simply because it has an IAM role. We should carefully define what that role can access, under which conditions, and whether those permissions remain necessary.
Before assigning an IAM role to your next ECS task, ask yourself:
  • Does this application really need all these permissions?
  • Are we granting access to specific resources or using wildcards because they’re easier?
  • Could multiple applications be sharing the same IAM role unnecessarily?
  • If the application is compromised tomorrow, what could an attacker do with its permissions?
Network segmentation controls where a workload can communicate. IAM helps control what it is authorized to do. We need to consider both.

3. Can Our Database Trust Its Own Application?

We’ve restricted our network connectivity and tightened our IAM permissions. So far, so good.
But let’s revisit our Orders API.
The application needs to communicate with an Amazon RDS PostgreSQL database to retrieve and update customer orders.
We’ve configured the database security group to allow connections on port 5432 only from the Orders API’s ECS task security group.
That sounds secure, right?
But remember, our application has already been compromised.
The attacker doesn’t need to bypass the database security group. They’re already executing code inside a container that is authorized to communicate with the database.
And if our application uses a database account with excessive permissions, the attacker may be able to abuse those same permissions.
Imagine we previously granted our application’s database user access to every table:
GRANT ALL PRIVILEGESON ALL TABLES IN SCHEMA publicTO orders_api;
Our Orders API only needs to manage orders, but the database user might also have access to customer information, payment records, and other sensitive tables.
Now ask yourself:
If the attacker can execute database queries using our application’s credentials, what prevents them from reading or modifying data unrelated to the Orders API?
The security group cannot distinguish a legitimate SQL query from a malicious one sent through an authorized connection.
And IAM permissions won’t necessarily help either. Once the application authenticates to PostgreSQL, its database privileges determine which operations it can perform.
So perhaps we should revisit how we assign database permissions.
Instead of granting broad access, we could create a dedicated database role with only the necessary privileges:

GRANT USAGE ON SCHEMA app TO orders_api;
GRANT SELECT, INSERTON TABLE app.orders TO orders_api;
GRANT UPDATE (status)ON TABLE app.orders TO orders_api;

This is a simplified example. The exact privileges depend on our application’s queries, database schema, and other role memberships.
Now, even if the attacker compromises the Orders API, the database role has a narrower set of operations available to it.
For applications serving multiple customers, we might also consider PostgreSQL Row-Level Security to restrict which records different database roles or contexts can access.
But there is still a limitation.
If our Orders API legitimately needs to read customer orders, an attacker operating through that application may be able to read them too.
And this brings us to another important question:
Should we trust a request simply because it comes from an application that is allowed to access the database?
Perhaps our security boundaries need to exist not just between networks and services, but also within the data itself.
After all, a trusted connection doesn’t guarantee a trustworthy operation.

4. What About the Way Out?

We’ve discussed how attackers might reach other services, access AWS resources, and interact with our database.
But there is another direction we often overlook.
Outbound traffic.
Let’s go back to our compromised ECS container.
Imagine the attacker has successfully retrieved sensitive customer information from our database.
What happens next?
In many architectures, applications running in private subnets access the internet through a NAT Gateway.
And there’s nothing inherently wrong with that. Applications may need to communicate with external APIs, download dependencies, or access third-party services.
But let’s think about the permissions we commonly configure.
How often have you seen an outbound security group rule like this?
Type
Protocol
Port
Destination
HTTPS
TCP
443
0.0.0.0/0
It’s a common configuration, and often a convenient one.

But if our compromised container has a route to the internet through a NAT Gateway, and its outbound rules allow HTTPS to any destination, what’s preventing the attacker from sending stolen information to an external server?
A NAT Gateway provides network address translation. It is not, by itself, a security policy that determines which external services our application should be allowed to access.
So perhaps we need to ask a different question:

Does our application really need unrestricted outbound internet connectivity?

Let’s examine what our Orders API actually needs.
It communicates with RDS, retrieves secrets from Secrets Manager, accesses an S3 bucket, and calls our Payments API.
Do all these operations require general internet access?
Not necessarily.
We could use an S3 Gateway VPC Endpoint to access S3 without using a NAT Gateway.
For Secrets Manager, we could configure an Interface VPC Endpoint powered by AWS PrivateLink.
And for communication with the Payments API, we’ve already discussed service-oriented connectivity options such as VPC Lattice.
With the appropriate endpoints, policies, and supporting infrastructure, some workloads might not need general outbound internet access at all.
Of course, a VPC Endpoint is not automatically a security boundary that prevents data exfiltration. We still need to consider its endpoint policy, IAM permissions, and resource policies.
For applications that genuinely need internet access, we could consider AWS Network Firewall to inspect and restrict outbound traffic.
For example, we might allow communication only with approved external services instead of permitting arbitrary destinations.
These controls have limitations. Domain-based filtering, for instance, requires careful consideration of how traffic is inspected and what information is available in encrypted connections.
And even a perfectly restricted outbound network doesn’t prevent an attacker from abusing an approved destination.
But the architectural question remains:

Why should a compromised application have more ways to communicate with the outside world than its business function actually requires?

We’ve spent years protecting the paths into our infrastructure.
Perhaps we should pay just as much attention to the paths leading out.

5. How Much Damage Can One Container Cause?

Let’s return to our original scenario.
A vulnerability was discovered in the Orders API, and an attacker successfully exploited it.
The vulnerability itself hasn’t changed.
But imagine two different architectures.
In the first, our application has broad connectivity to other VPCs, excessive IAM permissions, extensive database privileges, and unrestricted outbound internet access.
In the second, we’ve deliberately limited network communication, scoped IAM permissions to specific resources, restricted database privileges, and controlled outbound connectivity.
The same vulnerability exists in both environments.

But would the consequences of exploiting it be the same?
Probably not.
In the first architecture, the attacker may have multiple opportunities to move laterally, access sensitive resources, and extract information.
In the second, some of those opportunities may no longer exist.
That doesn’t mean the second architecture is immune to attack. The attacker can still abuse whatever permissions, connections, and data access the compromised application legitimately possesses.
But we’ve reduced the number of opportunities available to them.
And that’s exactly the point.
Now let’s take it one step further.

What happens when we discover that our Orders API has been compromised?
Can we isolate the affected workload quickly?
With ECS Fargate, each task receives its own network interface when using the required  awsvpc  networking mode, allowing us to apply task-level security group controls.
We could design an incident response process that restricts communication, stops affected tasks, and replaces them with workloads deployed from verified, remediated images.
We might also use Amazon GuardDuty Runtime Monitoring to help identify suspicious runtime behavior, such as unexpected process execution or network activity.
But there are important considerations.
Stopping an ECS task doesn’t automatically solve the problem. If the ECS service launches another task using the same vulnerable image, we’ve simply recreated the vulnerable environment.
And if the attacker has already obtained credentials or accessed sensitive information, replacing the container doesn’t reverse those actions.
We still need to investigate the incident, preserve relevant evidence, address exposed credentials, and verify that the vulnerability has been remediated.
This raises some architectural questions worth considering before an incident happens:
  • Can we isolate one compromised workload without affecting the entire application?
  • Do we know which services and resources depend on it?
  • Can we replace affected workloads quickly using trusted images?
  • Can we identify what the compromised workload accessed before containment?
  • Have we designed our system so that one compromised component has limited consequences for the rest of the environment?
These questions aren’t really about CVEs anymore.
They’re about the decisions we make when designing our infrastructure.
And perhaps that’s the most important lesson from this entire discussion.
We cannot guarantee that the next vulnerability won’t affect our systems. But we can design our architecture so that compromising one component doesn’t automatically mean compromising everything around it.

Final Thoughts: Design for the Vulnerabilities You Don’t Know About Yet

Let’s go back to the question we started with.
How many vulnerabilities can your organization remediate per day?
10? 50? 100?
Patching remains essential, but no matter how quickly we apply updates, there will always be vulnerabilities we haven’t discovered yet or patches we haven’t deployed.
That’s why our security strategy shouldn’t depend entirely on how quickly we can patch.
Throughout this article, we explored how a single compromised ECS container could potentially affect other parts of our infrastructure. We also saw how architectural decisions can limit what an attacker can reach, access, or take.
So, where should you start?

Pick one of your critical applications and assume it’s already compromised.
Then ask yourself:
  1. Network: Which other workloads, VPCs, and services can it reach? Does it really need that connectivity?
  1. IAM: What can its IAM role do? Are those permissions limited to the resources it actually needs?
  1. Data: What information can it read, modify, or delete? Are database privileges restricted appropriately?
  1. Egress: Where can it send data? Does it really need unrestricted internet access?
  1. Containment: If you discovered a compromise right now, could you isolate and replace the workload without disrupting everything else?

Don’t just answer these questions based on architecture diagrams or documentation. Verify the answers. Review your policies, inspect your network paths, and test your assumptions in a controlled environment.

You don’t need to redesign your entire infrastructure overnight. Start with one application, identify unnecessary trust relationships, remove them, and repeat the process.
And remember, Zero Trust isn’t a product you purchase or an AWS service you enable. It’s an architectural approach reflected in the decisions you make every day.
The next critical CVE might be discovered tomorrow. You don’t have to wait until then to find out how resilient your architecture really is.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article