{"id":30830,"date":"2024-08-15T06:05:39","date_gmt":"2024-08-15T14:05:39","guid":{"rendered":"https:\/\/alexrusin.com\/?p=30830"},"modified":"2024-08-28T05:54:47","modified_gmt":"2024-08-28T13:54:47","slug":"understanding-aws-security-groups","status":"publish","type":"post","link":"https:\/\/blog.alexrusin.com\/understanding-aws-security-groups\/","title":{"rendered":"Understanding AWS Security Groups"},"content":{"rendered":"\n
Security groups play a vital role in the security architecture of Amazon Web Services (AWS). These attachable virtual firewalls are critical in controlling the inbound and outbound traffic to and from your AWS resources. Whether you are working with EC2 instances, load balancers, or databases, security groups help ensure that only the intended traffic flows through your AWS environment.<\/p>\n\n\n\n
Security groups act as virtual firewalls that can be attached to AWS resources like EC2 instances, load balancers, and databases. They manage the flow of traffic by allowing specific types of traffic while blocking others. Interestingly, security groups in AWS operate with a single rule\u2014an allow rule. This means they only allow specified traffic and do not support a deny rule.<\/p>\n\n\n\n
Security groups manage both inbound and outbound traffic using rules that specify the allowed traffic based on protocols, ports, and sources.<\/p>\n\n\n\n
Security groups primarily control two types of protocols:<\/p>\n\n\n\n
Security groups can control traffic through specific ports or a range of ports. Some standard ports include:<\/p>\n\n\n\n
Security groups can restrict access based on IP address blocks (CIDRs). These blocks range from allowing a wide range of IP addresses (e.g., \/16 for approximately 64,000 IPs) to a single IP address (e.g., \/32).<\/p>\n\n\n\n
Another powerful feature of security groups is their ability to allow traffic from other security groups. For instance, a security group attached to an EC2 can allow traffic to flow from a load balancer by referencing the security group attached to the load balancer.<\/p>\n\n\n\n
\n