DEV Community

Cover image for SECURING NETWORK TRAFFIC USING NETWORK SECURITY GROUP
Emmanuel Oluajo
Emmanuel Oluajo

Posted on

SECURING NETWORK TRAFFIC USING NETWORK SECURITY GROUP

In Azure, Network Security Groups (NSGs) are used to filter and manage network traffic entering and leaving virtual networks.
Configuring NSGs enables you to:

  • Based on source and destination IP addresses, ports, and protocols, permit or prohibit traffic.
  • Secure access to applications and resources on Azure
  • Identify security rules and priorities
  • Prevent malicious traffic and unauthorised access
  • Connect NSGs to Azure resources, NICs, or subnets.

This article will serve as a guide to deploying, setting up and running simple operations on NSGs in Azure.

PREREQUISITE

  • Working computer
  • Internet connection
  • Microsoft Azure account + active subscription

PROCEDURE

DEPLOY A VIRTUAL MACHINE

Using whatever method, deploy a virtual machine and open it.

CREATE A NETWORK SECURITY GROUP

On the side menu, click on “Networking” and then “Network settings”.

Image description

Click on the “Add network security group” button.

Image description

A NSG will be created in a matter or moments.

CREATE INBOUND SECURITY PORT RULE

Click on “Create port rule” and then, “Inbound port rule”.

Image description

On the pop-up menu, select “RDP” in the dropdown list for “Service”.

Image description

Under “Action”, tick “Allow” to allow inbound RDP access to the VM. Click on “Add” button.

Image description

The new inbound port rule can be seen as shown.

CREATE OUTBOUND SECURITY PORT RULE

Click on “Create port rule” and then, “Outbound port rule”.

Image description

On the pop-up menu, select “HTTP” in the dropdown list for “Service”.

Image description

Under “Action”, tick “Deny” to deny outbound internet access to the VM. Click on “Add” button.

Image description

The new outbound port rule can be seen as shown.

Image description

Top comments (0)