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

Sources

Practice in the labs

Restrict an instance's firewall, audit storage and read firewall rules for the ones open to the world.

Also try, in the simulators

Knowledge check

  1. 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.
  2. 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.
  3. 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.

Related