Process Advisors

*Subject to Terms and Condition
What are AWS Security Groups?
Updated on 23rd May, 23 225 Views

According to a recent survey, nearly three-fourths of businesses have at least one critical AWS security flaw. That is why it is critical to understand the various tools made available by AWS to users and how to best use them to keep your data secure. This blog intended to give you complete knowledge on AWS Security groups but before getting started with the topic let’s quickly understand what AWS is.

What is AWS?

AWS (Amazon Web Services) is an extensive, ever-changing cloud computing platform offered by Amazon that includes infrastructure as a service (IaaS), platform as a service (PaaS), and packaged software as a service (SaaS) offerings. AWS services can provide a company with tools like compute clusters, database storage, and content delivery services.

If you’re interested in AWS, here’s a Course for you:

Here’s an overview of how AWS Security Groups work, its types, and best practices for maximizing their effectiveness.

Table of Contents:

Definition of AWS Security Groups

An AWS security group helps to control incoming and outgoing traffic for your aws ec2  security group instances by acting as a virtual firewall. The flow of traffic to and from your instance is controlled by internal and external rules, respectively.

Every Security Group functions similarly to a firewall in that it contains a set of rules that filter traffic entering and exiting the EC2 instances. As previously stated, security groups are associated with EC2 instances and provide protection at the port and protocol access levels. Normally, the firewall has a ‘Deny rule,’ but the SG has a “Deny All” that allows data packets from the source IP to be dropped if no rule is assigned to them.

When you create a security group, you will assign it to a specific virtual private cloud VPC. It’s also a good idea to give each group a name and description so that they can be found easily in the account menus. It’s also worth noting that when creating a security group, make sure it’s assigned to the VPC it’s supposed to protect to avoid errors.

Check out Intellipaat’s AWS Training Course to get ahead in your career!

Types of AWS Security Groups

These are currently divided into two types:

  •   EC2-Classic
  •    EC2-VPC
AWS Security Types

If you’re familiar with Amazon EC2, you’ve probably heard of a security group. However, you cannot use a security group created for EC2-Classic in EC2-VPC or vice versa. Even if you have a similar security rule for your EC2, you must create one for your VPC.

There are some similarities and differences between these two types of security groups:

You can only create inbound rules with EC2-Classic, but you can create both inbound and outbound rules with EC2-VPC.

Get 100% Hike!

Master Most in Demand Skills Now !

You cannot change the security group of an instance that has already been launched. However, with an EC2-VPC, you cannot change the security group of an instance that has already been launched. With an EC2-VPC, however, you can change the assigned group.

You can also no longer add rules to EC2-Classic security groups.

Wanna crack the AWS interview, here’s an opportunity for you to answer AWS Interview Questions!

Working of AWS Security Groups

It helps you secure your cloud environment by allowing you to control what traffic is allowed into your EC2 machines. You can use Security Groups to ensure that all traffic at the instance level flows only through your defined ports and protocols.

When you launch an instance on Amazon EC2, you must assign it to a specific security group. You can add rules to each security group that allows traffic to or from specific services and instances.

Working of AWS Security Groups

Security group rules, like whitelists, are always permissive. It is not possible to make rules that restrict access. For example, traffic may be directed from an Elastic Load Balancer (ELB) to a subnet containing web servers. You can specify that ELB is the only permitted source in your AWS Security Group.

Because security groups are stateful, if an inbound request is successful, the outbound request will also be successful.

Default AWS Security Groups

Every virtual private cloud has a default security group, and each instance you launch will be associated with it. This means that unless you take action, such as associating a different security group, all of your instances will be associated with the default security group.

All protocols and ports ranging from instances in the same security group will be allowed by default. Additionally, all traffic to and::/0 will be authorized.

You are free to alter these rules as you see fit. However, you cannot delete a default security group from your VPC.

Career Transition

Manage security groups with Firewall Manager

Firewall Manager is a security management service that allows you to centrally configure and manage firewall rules across your AWS Organizations accounts and applications. Firewall Manager makes it easier to bring new applications into compliance by enforcing a common set of baseline security rules and ensuring that overly permissive rules generate compliance findings or are automatically removed. With Firewall Manager, you have a single service to build firewall rules, create security policies, and enforce rules and policies across your entire infrastructure in a consistent, hierarchical manner.

The firewall Manager’s security group capabilities are divided into three broad categories:

  • Create and apply AWS account and resource baseline security groups.
  • Examine and eliminate unused or redundant security groups.
  • Audit and control security group rules to identify overly permissive and high-risk rules.

Want to learn more about AWS? Check out our AWS Tutorial now!

Best Practices of AWS Security Groups

You can use the following best practices and tips to make the most of AWS Security Groups and improve your overall system security:

  • Your VPC should have flow logging enabled. These logs provide complete visibility into the traffic that passes through the VPC. Flow logging can assist you in detecting problematic traffic and providing valuable insights. It can also assist you in resolving access and security issues. For example, the flow log can show you whether there are any security groups that are overly permissive
  • Large port ranges should be avoided in EC2 security groups. In this case, vulnerabilities are easily exposed and exploited
  • Allow only limited access to RDS cases. RDS will log failed login attempts but will not prevent them from occurring again. If a case is left open to the internet, it is vulnerable to brute-force login attacks. You should also limit access to Amazon Redshift clusters
  • Use discrete security groups less often to avoid misconfigurations that could lead to account compromise
  • Limit outbound port access to specific ports or destinations only. Allowing unrestricted inbound access to uncommon ports is also not recommended
  • Authorize no access to ports such as 445, which is commonly used for CIFS (Common Internet File System). Allow FTP transfers only through ports 20 or 21, and only after they have been restricted to required entities

Maintaining these best practices manually can be difficult in large-scale AWS environments, or in situations where developers and application owners are frequently deploying new applications. Organizations can address this issue by implementing centralized guardrails. At AWS, we see security as an enabler of development velocity, allowing developers to move applications into production quickly while automatically putting the necessary safeguards in place.


AWS Security Groups are extremely adaptable. You can use the default security group while still customizing it (though this is not recommended because groups should be named according to their purpose). You can also create a security group for your specific applications. To accomplish this, you can either write the necessary code or use the Amazon EC2 console.

If you have any doubts or queries related to AWS, do post them on our AWS Community!

Course Schedule

Name Date Details
AWS Certification 03 Jun 2023(Sat-Sun) Weekend Batch
View Details
AWS Certification 10 Jun 2023(Sat-Sun) Weekend Batch
View Details
AWS Certification 17 Jun 2023(Sat-Sun) Weekend Batch
View Details

Speak to our course Advisor Now !

Related Articles

Subscribe to our newsletter

Signup for our weekly newsletter to get the latest news, updates and amazing offers delivered directly in your inbox.