-
Notifications
You must be signed in to change notification settings - Fork 1
/
qualys-vm-nsg.tf
50 lines (43 loc) · 1.67 KB
/
qualys-vm-nsg.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
############################
## Qualys Appliance - NSG ##
############################
# Create Security Group to access Qualys
resource "azurerm_network_security_group" "qualys-vm-nsg" {
depends_on=[azurerm_resource_group.network-rg]
name = "${var.qualys_vm_name}-nsg"
location = azurerm_resource_group.network-rg.location
resource_group_name = azurerm_resource_group.network-rg.name
security_rule {
name = "AllowHTTPS"
description = "Allow HTTPS"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "443"
source_address_prefix = "Internet"
destination_address_prefix = "*"
}
security_rule {
name = "AllowSSH"
description = "Allow SSH"
priority = 150
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "22"
source_address_prefix = "Internet"
destination_address_prefix = "*"
}
tags = {
environment = var.environment
}
}
# Associate the qualys NSG with the subnet
resource "azurerm_subnet_network_security_group_association" "qualys-vm-nsg-association" {
depends_on=[azurerm_resource_group.network-rg]
subnet_id = azurerm_subnet.network-subnet.id
network_security_group_id = azurerm_network_security_group.qualys-vm-nsg.id
}