DEV Community

Cover image for Practical Approach to Network Security Group Setup
Ajayi Daniel
Ajayi Daniel

Posted on

Practical Approach to Network Security Group Setup

WHAT IS NETWEORK SECURITY GROUP
A Network Security Group (NSG) is a security feature in cloud computing that acts like a virtual firewall. It controls inbound (incoming) and outbound (outgoing) traffic to and from cloud resources (like Virtual Machines, Subnets, or Databases)
This works by using rules that either allow or deny specific types of traffic based on factors like:
Source IP address Destination IP address Port number Protocol (TCP, UDP, etc.)
STEP BY STEP OF CREATING NETWORK SECURITY
STEP 1 CREATE A VIRTUAL MACHINE TOGETHER WITH NETWORK BY MAKING THE SUBNET TO BE FRONTEND AND THE AP-VNET AS A VIRTUAL NETWORK

Image
ISJA

ImagDS

NETWORKING IMAGE
ImageGHDS
ImageSSS
VIRTUAL MACHINE 1 CREATED
Vm1

CREATE ANOTHER VIRTUAL MACHINE TOGETHER WITH NETWORK BY MAKING THE SUBNET TO BE BACKEND AND THE AP-VNET AS A VIRTUAL NETWORK, CALLING IT VM2
VM2

ImagHSNSHJ
NETWORKING SETTING FOR VM2

VNM2
VIRTUAL MACHINE 2 CREATED
JDMS.A

STEP 2 Create Application Security Group
WHAT IS APPLICATION SECURITY GROUP: An Application Security Group (ASG) is a cloud networking feature that helps simplify the management of network security rules by grouping virtual machines (VMs) or resources with similar functions, instead of applying rules to each resource individually

GO TO APPLICATION SECURITY GROUP ON AZURE PORTAL AND PRESS CREATE
SECURITY
ImagAKJDYK

NEXT STEP Associate the application security group to the network interface of the VM
In the Azure portal, search for and select VM1.
In the Networking blade, select Application security groups and then select Add application security groups.
Select the app-frontend-asg and then select Add.
WATER

STEP 3 Create and Associate the Network Security Group
IT IS NECESSARY TO CREATE NETWORK SECURITY GROUP BECAUSE IT HELP TO GIVE RULES TO APPLICATION SECURITY GROUP

NSDG

NEXT MOVE Associate the NSG with the app-vnet backend subnet.

NSGs can be associated with subnets and/or individual network interfaces attached to Azure virtual machines.
Select Go to resource or navigate to the app-vnet-nsg resource.
In the Settings blade select Subnets.
Select + Associate
Select app-vnet (RG1) and then the Backend subnet. Select OK.

SUBNET

STEP 4 Create Network Security Group rules
An NSG use security rules to filter inbound and outbound network traffic.
In the search box at the top of the portal, enter Network security groups. Select Network security groups in the search results.
Select app-vnet-nsg from the list of network security groups.
In the Settings blade, select Inbound security rules.
Select + Add and configure an inbound security rule.

RULES
Source
Any
Source port ranges
*
Destination
Application security group
Destination application security groups
app-frontend-asg
No application security groups found
Service
SSH
Destination port ranges
22
Protocol
Any
TCP
UDP
ICMPv4
ICMPv6
Action
Allow
Deny
Priority
100
Name
AllowSSH

ALLOW

Top comments (0)