Networks and storage: nothing open by accident
Unit 4 of 5 in Cloud fundamentals and shared responsibility.
You will be able to set firewall rules and storage access so nothing is open to the whole internet unless you chose that.
Lesson
A security group is a virtual firewall
AWS describes a security group as a virtual firewall for the resources it is attached to. Only the traffic allowed by its rules reaches the instance; if no rule allows SSH, you cannot connect with SSH. Each rule names a source or destination, port range and protocol. A new VPC comes with a default security group, and you can create more.
AWS also says security groups are stateful: the response to a request an instance sends is allowed back in whatever the inbound rules say, and responses to allowed inbound traffic may leave. The Network Builder exercise on a router access list shows what changes when a filter has no memory and each reply needs its own rule.
The rule to remember: not the whole internet
AWS says that when you add inbound rules for ports 22 (SSH) or 3389 (RDP), you should authorize only specific IP address ranges. Specifying 0.0.0.0/0 for IPv4, or the matching all-addresses range for IPv6, lets anyone on any address use that protocol to reach your instances. AWS also says not to open large port ranges and to restrict each port to what is needed.
Remember who owns this: AWS says the customer configures the security group, which is the same shared responsibility line from the last unit.
Storage that is private unless someone changes it
AWS says new S3 buckets, access points and objects do not allow public access by default, but users can change bucket policies, access point policies or object permissions to allow it. S3 Block Public Access settings override those policies and permissions so public access can be limited; they can be set at the organization level through AWS Organizations, at the account level and at the bucket and access point level.
So there are two layers: a bucket's own settings, which one person can change by mistake, and a block that sits above them and holds whatever the bucket says. The practice labs check both.
Key points
- A security group allows listed traffic only and is stateful.
- Never open admin ports to 0.0.0.0/0 or the IPv6 equivalent; use specific address ranges.
- New S3 buckets are private by default; Block Public Access holds even if a bucket policy is changed.
- Set protective settings at the highest level you can (account or organization).
Sources
- AWS VPC User Guide: Control traffic to your AWS resources using security groups
- Amazon S3 User Guide: Blocking public access to your Amazon S3 storage
- AWS: Shared Responsibility Model
Practice in the labs
Restrict an instance's firewall, audit storage and read firewall rules for the ones open to the world.
- Restrict access with AWS security groups (your own free-tier EC2 instance): You limit SSH to your own address on a free-tier instance, then terminate it.
- Audit and block public S3 bucket access (offline, the way AWS evaluates it): You build an offline auditor that follows S3's public-access rules and measure a before and after, with no account needed.
- Audit an AWS security group export with CIDR math and find the world in disguise: You use address maths to find rules that are open to the world in a disguised form.
Also try, in the simulators
- A router access list, and why replies matter (Network Builder exercise): You write a filter with no memory and see why replies need their own rule, to compare with a stateful security group.
Knowledge check
- What does 0.0.0.0/0 in an inbound SSH rule mean? Answer: Anyone on any IPv4 address can try to reach the instance. AWS says it enables anyone to access your instances from any IP address using that protocol.
- What does 'stateful' mean for a security group? Answer: Responses to allowed traffic are allowed back without a separate rule. AWS says response traffic to a request is allowed regardless of the inbound rules, and the reverse for allowed inbound traffic.
- A bucket owner changes a bucket policy to allow public access, but S3 Block Public Access is on at the account level. What happens? Answer: Block Public Access overrides the policy and limits public access. AWS says Block Public Access settings override policies and permissions that allow public access.
Back to the syllabus or see all classes.