InfraKit 39+ Programmatic Tools

Port 389 – LDAP Protocol Specification

Technical analysis, security advisories, vulnerability mitigation, and firewall syntax for TCP/UDP port 389 (LDAP).

Port Number 389
Transport Protocol TCP/UDP
Port Range Type Well-Known (0-1023)
Default Status Restricted / LAN

Service Description & Architectural Context

Lightweight Directory Access Protocol for directory authentication.

IANA / RFC Designation:

Port 389 is assigned to LDAP under the Internet Assigned Numbers Authority (IANA) service name registry. In enterprise infrastructure and homelab setups, services listening on this port must follow the principle of least privilege.

Security Analysis & Attack Surface Assessment
Cleartext protocol. Enforce LDAPS (port 636) or STARTTLS.
Hardening Recommendations:
  • Do not expose port 389 to public WAN interfaces unless authenticated TLS or VPN wrapping is strictly enforced.
  • Enforce rate-limiting using Fail2ban, CrowdSec, or cloud edge DDoS protection.
  • Audit active listening sockets locally: ss -tulpn | grep :389 or netstat -ano | findstr :389.

Firewall Rule Snippets for Port 389

UFW (Ubuntu / Debian Linux)
sudo ufw allow 389/tcp
iptables (Standard Linux Kernel)
sudo iptables -A INPUT -p tcp --dport 389 -j ACCEPT
Windows PowerShell (Defender Advanced Firewall)
New-NetFirewallRule -DisplayName "Allow Port 389" -Direction Inbound -LocalPort 389 -Protocol TCP -Action Allow

Quick Port Jump