github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/avd_docs/azure/network/AVD-AZU-0050/Terraform.md (about)

     1  
     2  Block port 22 access from the internet
     3  
     4  ```hcl
     5   resource "azurerm_network_security_rule" "good_example" {
     6        name                        = "good_example_security_rule"
     7        direction                   = "Inbound"
     8        access                      = "Allow"
     9        protocol                    = "TCP"
    10        source_port_range           = "*"
    11        destination_port_range      = "22"
    12        source_address_prefix       = "82.102.23.23"
    13        destination_address_prefix  = "*"
    14   }
    15   
    16  ```
    17  
    18  #### Remediation Links
    19   - https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/network_security_group#security_rule
    20  
    21   - https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule#source_port_ranges
    22