No single security control stops every attack. A firewall that blocks the wrong ports can still be flooded. A DDoS filter that absorbs a flood cannot tell a stolen password from a real one. Defense in depth means stacking layers so that what slips past one gets caught by the next.
For most cloud environments, four layers do the heavy lifting: DDoS filtering at the edge, a firewall at the network boundary, security groups around each server, and a web application firewall (WAF) in front of your application. This article explains what each one catches, what it misses and how they fit together. For who is responsible for which layer on different hosting types, see which parts of security are yours and which are your host's.
Why one layer is never enough
Each layer looks at traffic differently.
- DDoS filtering looks at volume and known attack patterns.
- Firewalls look at where traffic comes from and which port it targets.
- Security groups do the same, but per server or per role.
- A WAF looks inside web requests at what they are actually asking for.
An attack that looks normal to one layer often looks wrong to another. A credential stuffing run uses ordinary web requests on port 443, so firewalls let it through by design, while a WAF or rate limit can catch it. A network flood never reaches the WAF, because DDoS filtering drops it first.

Read across each row to see where a different kind of traffic is checked. Legitimate customers continue to the application.
Layer #1: DDoS filtering
What it does. DDoS filtering, short for distributed denial of service filtering, sits at the edge of the provider's network and drops traffic floods before they reach your environment. It looks for unusual volume and known attack signatures.
What it catches. Volumetric floods that would fill your connection, and protocol attacks that exhaust connection tables.
What slips past. Low-volume attacks and anything that looks like ordinary web traffic, such as application-layer floods aimed at your search page, credential stuffing and checkout bots.
Who runs it. Your hosting provider or CDN. You cannot run this layer yourself, because by the time a flood reaches your servers, it is too late.
Layer #2: Firewall
What it does. A firewall decides which traffic can cross the boundary into your network, based on source address, destination and port.
What it catches. Port scans, attempts to reach services that should never be public, such as databases and admin panels, and traffic from ranges you have chosen to block.
What slips past. Anything on a port you have deliberately opened. Your web ports have to be open to everyone, so attacks that arrive over them pass straight through.
Who runs it. Depending on the setup, the provider at the network edge, you inside each server's operating system, or both.
If you would rather engineers handled firewall and security group configuration with you, it is part of the managed services included on every InMotion Cloud plan.
Layer #3: Security groups
What it does. Security groups are rule sets applied to individual servers, usually by role. A "web" group might allow ports 80 and 443 from anywhere; a "database" group might allow port 3306 only from servers in the web group.
What it catches. Lateral movement. If an attacker compromises one server, security groups limit what else it can reach. Combined with network isolation, they keep a breach in one place from spreading.
What slips past. Like firewalls, security groups allow or block connections. They do not read the contents of requests on ports they allow.
Who runs it. You define the groups. The platform enforces them, outside the server, so a compromised server cannot switch them off. Our guide to firewall rules and security groups shows how to write them.

The web tier can call the app tier on port 8080, but only the app tier can reach the database on port 3306. Compromising a web server does not grant a direct database connection.
Layer #4: Web application firewall (WAF)
What it does. A WAF inspects the contents of web requests, such as the URL, headers and form fields, and blocks ones that match attack patterns or break rules you set.
What it catches. SQL injection, cross-site scripting attempts, known exploits against popular software, and abusive request rates on specific pages such as login and checkout.
What slips past. Attacks that look exactly like normal use, and anything that never reaches it, such as a database exposed on a public port.
Who runs it. A CDN or security provider in front of your site, a module on your load balancer or web server, or a managed service from your host. Our article on whether you still need a CDN like Cloudflare covers the CDN route.

Use the grid to find gaps in your rules. A firewall can deny connections to closed ports; a WAF with rate limits helps address repeated attempts on an open login page.
How the layers work together
The point is not to pick the best layer. It is to make sure every attack you care about meets at least one layer that can see it. A useful exercise is to list the attacks you worry about most and write, for each one, which layer stops it. Any attack with no layer next to it is your gap.
Keep the rules simple at each layer, deny by default and review them on a schedule. Layers that nobody understands tend to be configured too loosely, or switched off.
What InMotion Cloud provides, and what stays with you
Layer #1: DDoS filtering is included on every InMotion Cloud plan.
Layer #2 and #3: you get security groups and isolated private networks for your environment, and our engineers can help you design and tighten the rules.
Layer #4: Most customers who need one run it through a CDN in front of their site or as a module on their own load balancer.
What stays with you: your application's own security, the accounts and passwords your users choose, and the decision about which ports and services you expose.
Summary
Defense in depth stacks layers that each look at traffic differently. DDoS filtering stops floods, firewalls and security groups decide who can connect to what, and a WAF reads the requests that get through. List the attacks you care about, check each one meets at least one layer, and fix the gaps.
Not sure which layer would stop the attack you worry about most?
InMotion Cloud engineers will walk through your setup layer by layer and show you where the gaps are.
Frequently asked questions
What is defense in depth? A security approach that stacks several independent layers of protection, so an attack that gets past one layer is stopped by another.
What is the difference between a firewall and a security group? Both allow or block connections by source and port. A firewall usually guards the network boundary; security groups apply rules to individual servers or roles and are enforced by the cloud platform.
Do I need a WAF if I have a firewall? If you run a public website or application, usually yes. Firewalls must leave web ports open, and a WAF is what inspects the requests that arrive on them.
Does DDoS protection stop all attacks? No. It stops floods and known attack patterns. Attacks that look like normal traffic, such as credential stuffing, need other layers.
