AWS Builder Center
Day 5 Of Cloud with AWS: Security groups

Day 5 Of Cloud with AWS: Security groups

#100DaysOfCloud challenge using AWS

In today's task:
Create a security group with name: datacenter-sg.
The description must be: Security group for the App Servers
To Do:
  • Add the inbound rule of type HTTP, with port range of 80.
  • Enter the source CIDR range of 0.0.0.0/0.
  • Add another inbound rule of type SSH, with port range of 22.
  • Enter the source CIDR range of 0.0.0.0/0.
----------------------------------------------------
Steps followed:
1. Search VPC from the AWS portal.
2. Create security group.
3. Fill in: Security group name, Description
Add Inbound Rules: Click Add rule twice and configure:

Rule 1

  • Type: HTTP
  • Protocol: TCP
  • Port Range: 80
  • Source: Anywhere-IPv4 (0.0.0.0/0)

Rule 2

Type: SSH
Protocol: TCP
Port Range: 22
Source: Anywhere-IPv4 (0.0.0.0/0)
Click : Create security group.
---------------------------------------------------------
Why do we need Security Groups?
A Security Group (SG) in AWS acts like a virtual firewall for cloud resources such as:
EC2 instances (virtual machines), Load balancers, Databases (RDS), ECS containers, etc.
It controls:
Who can connect to your server
Which ports are open
What traffic is allowed in or out.
Without Security Groups:
  • servers become publicly exposed
  • hackers can scan open ports
  • databases may leak data.
Why were HTTP and SSH added as inbound rules ?
Because the server needs to accept two types of incoming traffic.

HTTP Rule (Port 80)

Purpose:
  • Allows users to open the website in browser.
Without port 80 open:
  • website won't load
  • browser connection fails

SSH Rule (Port 22)

Purpose:
  • Allows DevOps/admins to log into server remotely.
Without SSH:
  • you cannot manage the server remotely
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article