Cloud Network Security
# CHAPTER 13
Cloud Network Security
1. Introduction
Historically, network security meant plugging ethernet cables into physical firewalls inside a locked server room. Today, organizations rent their infrastructure from Amazon (AWS), Microsoft (Azure), or Google (GCP). The hardware is gone, replaced by code. A developer can spin up 50 servers and a global network in 3 minutes using an API. This agility is incredible for business, but a nightmare for security if mismanaged. In this chapter, we will explore the Shared Responsibility Model, the transition from physical firewalls to cloud Security Groups, and the critical role of Identity and Access Management (IAM).2. Learning Objectives
By the end of this chapter, you will be able to:- Understand the Shared Responsibility Model in cloud computing.
- Differentiate between a physical firewall and a Cloud Security Group.
- Understand Virtual Private Clouds (VPCs) and cloud segmentation.
- Explain why IAM (Identity) is the new network perimeter.
- Identify common cloud misconfigurations (e.g., Open S3 Buckets).
3. Beginner-Friendly Explanation
Imagine renting an apartment in a massive high-rise building.- The Building Owner (The Cloud Provider): They are responsible for the security of the building itself. They hire the lobby security guard, ensure the elevators don't fall, and keep the power running. If someone breaks the front glass door of the lobby, it's the owner's fault.
- Your Apartment (Your Cloud Account): You rent Apartment 404. You decide who gets a key to your specific door. You decide whether to leave your balcony door wide open. If you leave your door unlocked, and someone walks in and steals your TV, it is your fault, not the building owner's.
This is the Shared Responsibility Model. The Cloud Provider secures the *Cloud* (hardware). You secure what is *in the Cloud* (your data and configurations).
4. Virtual Private Clouds (VPCs) and Security Groups
In the cloud, you do not buy physical switches; you create a VPC. A VPC is your isolated, private slice of the cloud. Just like a physical network, you segment a VPC into subnets (e.g., a Public Subnet for web servers, a Private Subnet for databases).Instead of a massive physical firewall, cloud instances use Security Groups. A Security Group is a virtual firewall attached directly to the virtual machine.
- It operates on the "Default Deny" principle.
-
If you spin up a Linux server in AWS, it has no open ports by default. You must explicitly edit the Security Group to say:
Allow Inbound TCP Port 22 from MyHomeIP.
5. Identity as the New Perimeter (IAM)
In traditional networking, the firewall was the perimeter. If you were inside the firewall, you were trusted. In the cloud, Identity and Access Management (IAM) is the perimeter. Because cloud APIs allow users to create or destroy entire networks with a single command, protecting the API keys and user identities is paramount. If an attacker steals an AWS API key that has theAdministratorAccess policy attached, it doesn't matter how strong your Security Groups are; the attacker will just use the API key to delete your Security Groups and download your databases.
6. The Danger of Misconfiguration
Traditional hackers used SQL injection or malware to break in. Cloud hackers rarely use exploits. They use automated bots to scan the internet for Misconfigurations.- Open Storage: A developer creates an Amazon S3 Bucket to store customer backups, but accidentally sets the permissions to "Public Read." Bots find it in minutes and download everything.
- Leaked Secrets: A developer hardcodes an AWS API key into their application code and uploads it to public GitHub. Bots scrape GitHub, find the key, and use it to spin up 1,000 servers in your cloud account to mine cryptocurrency, leaving you with a $100,000 bill.
7. Mini Project: Secure Demo Cloud Network Concepts
How do we architect a secure VPC? Let's conceptualize a 2-Tier web application in AWS.The Architecture Design:
-
1.
The VPC: Create a custom VPC (
10.0.0.0/16).
-
2.
Public Subnet: Create a subnet connected to the Internet Gateway. Place a Load Balancer here. Its Security Group only allows Inbound Port 443 (HTTPS) from the entire internet (
0.0.0.0/0).
- 3. Private Subnet 1 (Web Servers): Place the web servers here. They have no public IP addresses. Their Security Group only allows Inbound Port 443 *from the Load Balancer's Security Group*.
- 4. Private Subnet 2 (Database): Place the database here. Its Security Group only allows Inbound Port 3306 *from the Web Server's Security Group*.
- 5. The Result: Even if a hacker finds the database's internal IP, they cannot reach it. The routing and the Security Groups mathematically block all access except from the designated web servers.
8. Real-World Scenarios
In 2019, a major financial institution suffered a breach exposing the data of 100 million individuals. The attacker did not execute a sophisticated zero-day attack. They discovered a misconfigured Web Application Firewall hosted on AWS that allowed them to execute commands on the server (an SSRF vulnerability). Because the server was assigned an overly permissive IAM Role (it had permission to read any S3 bucket in the account), the attacker used the server to legally ask AWS for the data, bypassing all network security controls entirely.9. Best Practices
- Cloud Security Posture Management (CSPM): Because humans make mistakes, enterprises use automated CSPM tools. These tools constantly scan the company's AWS/Azure accounts. If a developer accidentally changes an S3 bucket to public, the CSPM tool detects it within seconds, fires an alert, and automatically changes it back to private via the API.
10. Legal and Ethical Notes
You are responsible for securing your cloud instances. If your cloud server is compromised and used to launch a Denial of Service attack against another company, your cloud provider (AWS/Azure) will suspend your account for violating their Acceptable Use Policy.11. Exercises
- 1. Explain the Shared Responsibility Model. If a cloud server is compromised because it had a weak SSH password, is the cloud provider or the customer responsible?
- 2. How does an AWS Security Group differ functionally from a traditional physical perimeter firewall?
12. FAQs
Q: Is the cloud inherently less secure than keeping servers in my own building? A: No, it is actually much more secure. Cloud providers employ thousands of world-class security engineers and spend billions on physical security and hypervisor isolation. The underlying cloud is incredibly robust. The weakness lies entirely in the customer's failure to configure their specific environment correctly.13. Interview Questions
- Q: Describe a secure 3-tier architecture within an AWS Virtual Private Cloud (VPC), explicitly detailing the placement of the Web, App, and Database tiers across public and private subnets, and the associated Security Group ingress rules.
- Q: Explain why Identity and Access Management (IAM) is often referred to as the "new perimeter" in cloud-native architectures, contrasting it with traditional network-centric security models.