Cybersecurity/AWS Cybersecurity papers/AWS Communication hardening guide: Difference between revisions
| Line 34: | Line 34: | ||
===== Why this approach works ===== | ===== Why this approach works ===== | ||
Only the critical ports required for the web servers on the public subnet are open (80 and 443). As NACL's are stateless the empirical ports are included. As it should, SSH access to servers on the public subnet is caught by the "deny all" rule. SSH access to these servers must be performed through [[Computer Notes/AWS/Setting up Session Manager on Ubuntu|SSM]]. | Only the critical ports required for the web servers on the public subnet are open (80 and 443). As NACL's are stateless the empirical ports are included. As it should, SSH access to servers on the public subnet is caught by the "deny all" rule. SSH access to these servers must be performed through [[Computer Notes/AWS/Setting up Session Manager on Ubuntu|SSM]]. | ||
==== Setting Security groups on the web server ==== | |||
Think of this as an additional layer of defense that protects against [[North / South & East West Network Security|east-west propagation]] of traffic, additionally any errors or omissions at the NACL level are unlikely to make it to the web server itself. Overall it is important to consider that only five security groups can be assigned to an instance, therefore these should be simple and direct. Additionally unlike the NACL mentioned above security rules are "stateful" - IE the track the state of a connection and do not require rules for replies. | |||
What to include in the security group: | |||
*Inbound: | |||
** 80 - IPv4 and IPv6 allow | |||
** 443 - IPv4 and IPv6 allow | |||
* Outbound: | |||
** All traffic - IPv4 allow | |||
** All traffic - IPv6 allow | |||
===== Why this approach works ===== | |||
This provides the base HTTPS communication functions for the web server while allowing all outbound traffic for updates / etc. However outbound traffic can also be locked down (given the stateful nature of the security group) if required. Naming this group "WebServers" gives you a template that can be re-used for all web servers. Security groups do not require a deny rule due to their explicit "deny all" therefore an deny is not required. | |||
Revision as of 04:34, 5 November 2026
Core Concepts
This post examines the core principles of communication security within the AWS environment, emphasizing the protection of subnets and hosts through the appropriate configuration of security groups and network access control lists. Notably, this design does not incorporate a Web Application Firewall (WAF); in a production environment, the implementation of a WAF is essential.
High level network design
[Internet]
|
[IGW]
|
+------ Public subnet ---+
| |
[NAT GW] [Webserver]
| | |
+---+- Private Subnet ---+ +---[Gateway]
|
[Private server]
Securing the web server
Securing the public subnet
The key to securing the public subnet is ensuring the concept of least permission is applied to the NACL (Network Access control lists) governing data flow to the public subnet.
What to include:
- Inbound:
- Port 80 / 443 inbound for HTTP / HTTPS requests
- Port 1024 - 65535 - Empirical
- Deny all other inbound ports
- Outbound:
- All traffic - allow
Why this approach works
Only the critical ports required for the web servers on the public subnet are open (80 and 443). As NACL's are stateless the empirical ports are included. As it should, SSH access to servers on the public subnet is caught by the "deny all" rule. SSH access to these servers must be performed through SSM.
Setting Security groups on the web server
Think of this as an additional layer of defense that protects against east-west propagation of traffic, additionally any errors or omissions at the NACL level are unlikely to make it to the web server itself. Overall it is important to consider that only five security groups can be assigned to an instance, therefore these should be simple and direct. Additionally unlike the NACL mentioned above security rules are "stateful" - IE the track the state of a connection and do not require rules for replies.
What to include in the security group:
- Inbound:
- 80 - IPv4 and IPv6 allow
- 443 - IPv4 and IPv6 allow
- Outbound:
- All traffic - IPv4 allow
- All traffic - IPv6 allow
Why this approach works
This provides the base HTTPS communication functions for the web server while allowing all outbound traffic for updates / etc. However outbound traffic can also be locked down (given the stateful nature of the security group) if required. Naming this group "WebServers" gives you a template that can be re-used for all web servers. Security groups do not require a deny rule due to their explicit "deny all" therefore an deny is not required.