Playing with EC2 Security Groups | Scribe

Playing with EC2 Security Groups

  • Hafeez Baig |
  • 33 steps |
  • 3 minutes
  • Amazon Web ServicesAmazon Web Services
information ordinal icon
Refer to the following guide to learn how to use IAM in the cloud\ <https://scribehow.com/shared/Creating_an_IAM_User_and_User_Group_in_AWS_Management_Console__hWNiiXlcRJKFqYZZEJD-cg> Refer to this guide to learn how to create an EC2 instance\ <https://scribehow.com/shared/AWS__Creating_your_first_EC2_Instance__Xcu7ZVCdRfWx56YVktKgbQ> Refer to this guide to learn how to connect to an EC2 instance<https://scribehow.com/shared/How_to_Connect_to_an_AWS_EC2_Instance__czXjLrH1R1yAIXika6fGbA>
1
Sign in to **AWS Management Console** as an **IAM User** **Pre-requisite** - Ensure you have selected the AWS region closest to your location\ For this guide, we will be using us-east-2 (Ohio) as a preferred choice
2
Type **EC2** in the search bar and click on **EC2** to view the EC2 Dashboard
3
On the EC2 dashboard click on **Instances** from the left bar to view the EC2 instances
4
Select the instance named - **First EC2 Instance**
5
Scroll to the overview section and click on the **Security** tab to view the security related details such as IAM role, security groups, etc
6
Click on the link **launch-wizard-1** next to the security group name to open the security group wizard
7
Scroll to the overview section and click on **Outbound rules** tab
8
Return to the **Linux EC2 Console** and Enter the following commands one by one: Execute: [[sudo su]] Then, type: [[curl google.com]] You're receiving responses because outbound traffic is permitted
9
Return to the **AWS Console** and click on the **Edit outbound rules** button
10
Click on the **Delete** button to remove the outbound rule which is allowing **All traffic** from all the port range and protocol, click on the **Save rules** button to modify the outbound rules
11
The Outbound security group rules are now successfully modified
12
Return to the **Linux EC2 Console**, then click on Page **Reload** to refresh the page
13
Enter the following commands one by one: Execute: [[sudo su]] Then, type: [[curl google.com]] You will notice the curl request will timeout because there is no **All traffic** outbound rule specified in the Security Group assigned to the EC2 instance
14
Return to the **AWS Console** and click on the **Edit outbound rules** button to add a new rule
15
Click on **Add rule** button, then search and select **All traffic** as the Type
16
Select "**Anywhere-IPv4**" for the Destination dropdown to allow outbound traffic to any IPv4 address
17
Click on **Save rules** button to modify the outbound rules
18
The Outbound rules in the Security Group will be updated successfully
19
Return to the **Linux EC2 Console**, then click on Page **Reload** to refresh the page