Computer >> Hướng Dẫn Máy Tính >  >> Kết Nối Mạng >> An Ninh Mạng

Tạo Inbound Rule cho cổng RADIUS trên Azure Network Security Group (NSG)

Cổng RADIUS chuẩn

  • Authentication/Authorization: UDP 1812 (RADIUS) hoặc TCP 1812 (RadSec/TLS).
  • Accounting: UDP 1813.
  • RADIUS over TLS (RadSec): TCP 2083 (IANA assigned).

Tạo Inbound Security Rule qua Azure Portal

  1. Đăng nhập Azure Portal → Tìm Network security groups → Chọn NSG mục tiêu (hoặc Create mới).
  2. Menu bên trái: Settings → Inbound security rules → + Add.
  3. Điền thông tin:
TrườngGiá trị khuyến nghị
SourceIP Addresses → Nhập CIDR của NPS/ISE/RADIUS server (ví dụ: 10.0.1.10/32) hoặc Service Tag: AzureActiveDirectory nếu dùng Azure MFA NPS Extension.
Source port ranges* (hoặc 1024-65535)
DestinationAny (hoặc CIDR subnet chứa VM/VMSS cần bảo vệ)
ServiceCustom
Destination port ranges1812,1813 (UDP) – Chọn Protocol: UDP. Nếu dùng RadSec: 2083 TCP.
ProtocolUDP (hoặc TCP cho RadSec)
ActionAllow
PrioritySố nhỏ ưu tiên cao (ví dụ 100, 200). Tránh trùng rule mặc định (65000+).
NameAllow-RADIUS-Auth-Acct-Inbound
DescriptionAllow RADIUS UDP 1812/1813 from on-prem NPS/ISE to Azure VM subnet.
  1. Nhấn Add → Rule hiệu lực ngay (không cần reboot VM).

Tạo qua Azure CLI (Automation/IaC)

az network nsg rule create \
  --resource-group rg-network \
  --nsg-name nsg-app-subnet \
  --name Allow-RADIUS-Inbound \
  --priority 100 \
  --source-address-prefixes 10.0.1.10/32 \
  --source-port-ranges '*' \
  --destination-address-prefixes '*' \
  --destination-port-ranges 1812 1813 \
  --protocol Udp \
  --access Allow \
  --direction Inbound \
  --description "Allow RADIUS auth/acct from on-prem NPS"

Tạo qua Terraform (Infrastructure as Code)

resource "azurerm_network_security_rule" "radius_inbound" {
  name                        = "Allow-RADIUS-Inbound"
  priority                    = 100
  direction                   = "Inbound"
  access                      = "Allow"
  protocol                    = "Udp"
  source_port_range           = "*"
  destination_port_range      = "1812-1813"
  source_address_prefix       = "10.0.1.10/32"
  destination_address_prefix  = "*"
  resource_group_name         = azurerm_resource_group.rg.name
  network_security_group_name = azurerm_network_security_group.nsg.name
  description                 = "Allow RADIUS UDP 1812/1813 from on-prem NPS/ISE"
}

Best Practices

  • Narrow Source: Chỉ cho phép IP RADIUS server cụ thể (NPS, ISE, FreeRADIUS, Aruba ClearPass) – không dùng Any.
  • Phân tách Auth & Acct: Tạo 2 rule riêng (1812, 1813) nếu cần log/control khác nhau.
  • NSG Association: Gán NSG vào Subnet (khuyên dùng) hoặc NIC của VM chạy NPS/ISE hoặc VM workload cần auth.
  • Logging: Bật NSG Flow Logs → Log Analytics Workspace → KQL query cho RADIUS traffic.
  • Just-In-Time (JIT) VM Access: Nếu RADIUS server là VM Azure, bật JIT (Microsoft Defender for Cloud) để chỉ mở cổng khi admin request.

Kiểm tra kết nối

# Từ RADIUS server (on-prem) test tới Azure VM IP
radtest testuser testpass  0 testing123  # UDP 1812
radtest -x testuser testpass  0 testing123  # Accounting 1813

# Hoặc dùng Nmap
nmap -sU -p 1812,1813