Tools · Field Manual

Active Directory & Enterprise Firewall Architecture: The Operational Matrix Guide

An exhaustive architectural field manual for configuring enterprise firewall boundaries around Active Directory Domain Controllers, PKI tiers, Systems Management, and observability pipelines without breaking authentication or replication.

By K Shankar R Karanth Tools Concept Guide Homelab-tested — Windows Server 2025, DFL 2025
Interactive Companion Tool: This guide directly documents the production logic behind the Active Directory & Infrastructure Firewall Matrix. Launch the live matrix to dynamically calculate port directions, toggle between default high-range RPC and hardened static TCP 50000, and copy ready-to-run PowerShell firewall scripts.
Baseline Identity

DNS (53), Kerberos (88), LDAP/LDAPS (389/636), and SMB (445) form the immovable foundation of all domain authentication.

RPC Mapper (135)

The initial negotiation gateway that directs clients and replication partners to dynamic high-range RPC ports.

Static Hardening

Locking NTDS and Netlogon RPC to TCP 50000 allows network security teams to replace 16,384 open ports with a single locked port.

The AD Perimeter Dilemma

Active Directory was originally engineered in an era where corporate local area networks were presumed flat and inherently trusted. Domain Controllers broadcasted locator pings, negotiated wide-open RPC port pools, and assumed unrestricted lateral reachability across all domain-joined member servers and workstations.

In modern enterprise architectures, this flat-network assumption is unacceptable. Domain Controllers are segregated into dedicated management VLANs, data centers are bifurcated by stateful next-generation firewalls (Palo Alto, Fortinet, Check Point), and branch offices communicate over encrypted site-to-site IPsec tunnels.

Think of Active Directory across a firewall as an airport customs checkpoint: every passenger (protocol) must carry a legitimate visa (service ticket), proceed through an assigned terminal gate (port), and strictly respect one-way exit corridors (traffic flow directions). Opening “Any/Any” to Domain Controllers because an engineer cannot decipher RPC negotiation completely destroys perimeter isolation.

Core Directory Protocols Baseline

Regardless of whether you are configuring an internal firewall between workstations and Domain Controllers, or an inter-data-center boundary between replica DCs, five protocols represent the immutable baseline of Active Directory functionality:

Port Protocol Service Direction Operational Purpose
53 TCP / UDP DNS Bi-directional Essential for locating Domain Controllers via _ldap._tcp.dc._msdcs.<domain> SRV records.
88 TCP / UDP Kerberos v5 Bi-directional Authentication protocol issuing Ticket Granting Tickets (TGT) and service tickets.
123 UDP W32Time (NTP) Outbound to DC Maintains clock synchronization within the required 5-minute Kerberos skew limit.
135 TCP RPC Endpoint Mapper Bi-directional Locates dynamic endpoint UUIDs for Netlogon, DRSUAPI replication, and DCOM.
389 TCP / UDP LDAP / CLDAP Bi-directional Directory searches, schema queries, and rootDSE DC locator datagrams.
445 TCP SMB over IP Bi-directional SYSVOL folder access, Group Policy template downloads, and DFSR replication.
636 TCP LDAPS Bi-directional Encrypted LDAP over TLS for security-sensitive directory operations.
3268 / 3269 TCP Global Catalog (GC) Bi-directional Forest-wide universal group membership caching and multi-domain directory lookups.
Security Warning: Never expose port 445 (SMB) or port 135 (RPC Endpoint Mapper) to external public IP addresses. These protocols must be strictly confined to private enterprise tunnels and protected management segments.

RPC Dynamic Range vs Static Port 50000

The single most contentious friction point between Active Directory administrators and Network Security teams is the **RPC dynamic ephemeral range**.

By default, since Windows Server 2008, Microsoft follows the IANA standard ephemeral port pool spanning TCP 49152 through 65535 (a range of 16,384 ports). When a client contacts a DC over TCP 135 (RPC Endpoint Mapper) to invoke a Netlogon or directory replication interface, the mapper assigns a dynamic high port within this range for the actual payload session.

Opening 16,384 ports across an enterprise firewall frequently triggers security compliance audits. To eliminate this risk, Microsoft supports restricting Active Directory RPC services to a dedicated, fixed static port.

Restricting NTDS RPC to Static Port TCP 50000

You can configure Active Directory directory replication and DRSUAPI calls to strictly utilize TCP 50000 by configuring the registry on all Domain Controllers:

# Configure NTDS to use fixed static port TCP 50000
Set-ItemProperty `
  -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" `
  -Name "TCP/IP Port" `
  -Value 50000 `
  -Type DWord

# Configure Netlogon service to use fixed static port TCP 50001
Set-ItemProperty `
  -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters" `
  -Name "DCTcpipPort" `
  -Value 50001 `
  -Type DWord

Once configured and the Domain Controller is restarted, the RPC Endpoint Mapper (TCP 135) will hand out port 50000 for NTDS and port 50001 for Netlogon. Your firewall rule can then be hardened from 49152:65535 down to single static port numbers.

PKI, Systems Management & Backups

An enterprise Domain Controller does not operate in isolation. It relies on a supporting constellation of public key infrastructure, endpoint management, and disaster recovery repositories:

Active Directory Certificate Services (AD CS)

Certificate autoenrollment relies on DCOM over TCP 135 and dynamic RPC. Revocation checking requires HTTP port 80 to access CRL Distribution Points (CDP) and OCSP responders.

MECM / SCCM & WSUS

Clients scan software update catalogs via WSUS over HTTPS (port 8531). SCCM Client Notification operates on fast push channel TCP 10123. Network PXE boot imaging requires UDP 67/68, TFTP 69, and proxy DHCP 4011.

Observability & Backups

Prometheus scrapes metrics via windows_exporter on TCP 9182. Veeam Backup Agent transfers deduplicated system state blocks over TCP 2500–3300 and port 6162.

Automated PowerShell Provisioning

Manually creating dozens of firewall rules using the Windows Defender Firewall GUI (wf.msc) is slow, prone to clerical errors, and unrepeatable.

The Interactive Firewall Matrix automatically generates group-managed PowerShell commands utilizing New-NetFirewallRule. Here is an example of an automated rule group for Domain Controller replication:

# ===========================================================================
# Automated Domain Controller Replication Firewall Provisioning
# Rule Group: Karanth.ovh - DC to DC Full Replication
# ===========================================================================

$RuleGroup = "Karanth.ovh - Active Directory Replication"

# DNS Resolution
New-NetFirewallRule -DisplayName "AD - DNS (TCP 53)" `
  -Group $RuleGroup -Direction Inbound -Action Allow `
  -Protocol TCP -LocalPort 53 -Profile Domain, Private -ErrorAction SilentlyContinue | Out-Null

New-NetFirewallRule -DisplayName "AD - DNS (UDP 53)" `
  -Group $RuleGroup -Direction Inbound -Action Allow `
  -Protocol UDP -LocalPort 53 -Profile Domain, Private -ErrorAction SilentlyContinue | Out-Null

# Kerberos v5 Authentication
New-NetFirewallRule -DisplayName "AD - Kerberos (TCP 88)" `
  -Group $RuleGroup -Direction Inbound -Action Allow `
  -Protocol TCP -LocalPort 88 -Profile Domain, Private -ErrorAction SilentlyContinue | Out-Null

# RPC Endpoint Mapper
New-NetFirewallRule -DisplayName "AD - RPC Mapper (TCP 135)" `
  -Group $RuleGroup -Direction Inbound -Action Allow `
  -Protocol TCP -LocalPort 135 -Profile Domain, Private -ErrorAction SilentlyContinue | Out-Null

# SMB / SYSVOL Replication
New-NetFirewallRule -DisplayName "AD - SMB SYSVOL (TCP 445)" `
  -Group $RuleGroup -Direction Inbound -Action Allow `
  -Protocol TCP -LocalPort 445 -Profile Domain, Private -ErrorAction SilentlyContinue | Out-Null

# Hardened Static RPC Port
New-NetFirewallRule -DisplayName "AD - NTDS Static RPC (TCP 50000)" `
  -Group $RuleGroup -Direction Inbound -Action Allow `
  -Protocol TCP -LocalPort 50000 -Profile Domain, Private -ErrorAction SilentlyContinue | Out-Null

Write-Host "[OK] Complete firewall rule policy configured for Domain Controller replication." -ForegroundColor Green

Formatting Enterprise Change Tickets

Network engineering teams manage perimeter firewalls through enterprise IT service management (ITSM) platforms like ServiceNow and Jira Service Management. Submitting a request that simply says “please open AD ports” will inevitably be rejected with a request for detailed traffic matrix specifications.

The Firewall Matrix produces compliance-grade change ticket specifications formatted specifically for security audit approval:

CHANGE TICKET / NETWORK SECURITY REQUEST SPECIFICATION
==================================================
PROJECT / CONTEXT : Enterprise Active Directory Hardening
SCENARIO          : DC to DC Full Replication
SOURCE HOST(S)    : 10.100.10.10 (DC01.corp.internal)
DESTINATION(S)    : 10.200.10.10 (DC02.corp.internal)
RPC POLICY        : Hardened Static Port (TCP 50000)
ACTION REQUIRED   : Permit stateful firewall traversal
--------------------------------------------------
TCP PORTS TO PERMIT:
53, 88, 135, 389, 445, 636, 3268, 3269, 50000

UDP PORTS TO PERMIT:
53, 88, 123, 389

JUSTIFICATION     : Required for inter-data-center Active Directory directory replication,
                    DFSR SYSVOL synchronization, and Kerberos cross-realm referrals.
--------------------------------------------------

Final Thoughts & Operational Next Steps

Hardening an Active Directory perimeter is an exercise in precision. When network ports are properly calculated and documented, Domain Controllers operate reliably across complex multi-cloud and hybrid perimeters without triggering authentication lockouts or breaking cross-forest trusts.

To put this architecture into practice, launch the interactive Active Directory & Infrastructure Firewall Matrix to generate custom rule sets tailored to your environment. If you are investigating anomalous authentication attempts or tracking account lockouts, consult our companion Active Directory Security Event Forensics Playbook or test your log filters in the Security Event Query Builder.


Discover more from Karanth.ovh

Subscribe to get the latest posts sent to your email.