{
  "title": "How to Harden Endpoints: Practical Steps to Restrict Programs, Functions, Ports and Protocols for NIST SP 800-171 REV.2 / CMMC 2.0 Level 2 - Control - CM.L2-3.4.7",
  "date": "2026-04-05",
  "author": "Lakeridge Technologies",
  "featured_image": "/assets/images/blog/2026/4/how-to-harden-endpoints-practical-steps-to-restrict-programs-functions-ports-and-protocols-for-nist-sp-800-171-rev2-cmmc-20-level-2-control-cml2-347.jpg",
  "content": {
    "full_html": "<p>Restricting programs, functions, ports, and protocols on endpoints is a high-impact control for meeting NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 (CM.L2-3.4.7) — it reduces attack surface, limits lateral movement, and enforces the \"only what is required\" principle for systems that process Controlled Unclassified Information (CUI).</p>\n\n<h2>Understand the objective and scope</h2>\n<p>The Compliance Framework requirement CM.L2-3.4.7 expects organizations to allow only the programs, services, ports and protocols necessary for mission-essential functions. Start by defining the scope: which endpoints process or access CUI, which user groups and roles need network access, and which services are required for business workflows. If you manage a mixed environment (Windows, macOS, Linux, mobile), list each OS and group endpoints by role (workstation, build server, file server, admin workstation) so rules are meaningful and testable.</p>\n\n<h2>Inventory and create a secure baseline</h2>\n<h3>Practical inventory steps</h3>\n<p>Before you block anything, build an accurate inventory of installed applications, running services, and open ports. Use tools suited to your environment: Microsoft Intune or SCCM for Windows, osquery or Open-AudIT for mixed environments, and nmap or Nessus for network-level port discovery. Record the executable hashes, versions, and publisher metadata so you can create precise allow/deny rules rather than blunt path-only rules.</p>\n\n<h3>Small-business example</h3>\n<p>Example: a 40-person contracting firm has 35 Windows workstations and 5 Linux servers. Use PDQ Inventory on workstations and a simple Ansible playbook on servers to collect installed packages and running sockets (ss -tuln). Produce a baseline spreadsheet showing which hosts run RDP, SSH, SMTP relays, or proprietary vendor software — that becomes the starting whitelist for endpoints.</p>\n\n<h2>Application allowlisting and function restriction</h2>\n<p>Application allowlisting is the most effective way to enforce \"only required programs.\" On Windows, implement AppLocker or Microsoft Defender Application Control (MDAC) with rules by publisher, file hash, or path and start in Audit mode to gather policy exceptions before enforcement. On Linux, use SELinux, AppArmor, or tools like authselect and systemd service unit restrictions to limit process capabilities. For macOS, consider Jamf and built-in signed-app enforcement. Avoid naive path-based allowlists; prefer publisher-signature or hash-based rules for better security.</p>\n\n<h2>Restrict ports and protocols at the host and network level</h2>\n<h3>Windows and host firewall examples</h3>\n<p>On Windows endpoints, use Windows Defender Firewall with Advanced Security: implement inbound rules that are 'Allow' only for required services and create default-deny for unsolicited inbound connections. For outbound control, configure rules to prevent unauthorized remote connections (e.g., block outbound RDP/Telnet). Example command for a quick block: netsh advfirewall firewall add rule name=\"Block RDP Out\" dir=out action=block protocol=TCP localport=3389. Use Group Policy or Intune to push rules centrally.</p>\n\n<h3>Linux and network examples</h3>\n<p>On Linux servers, enforce restrictions with nftables/iptables or ufw where appropriate. Example: to deny telnet use 'sudo ufw deny 23' or use nftables to permit only required ports (22 for hardened SSH, 443 for web) and reject the rest. At the network edge, ensure perimeter firewalls only allow necessary ports and protocols to and from CUI-related systems; implement internal segmentation (VLANs or micro-segmentation) so that even if a host is compromised, access to other sensitive systems is very limited.</p>\n\n<h2>Harden services and disable unused functions</h2>\n<p>Many endpoints run unnecessary services by default. Use service management to stop and disable nonessential services: on systemd systems use 'systemctl disable --now <service>'; on Windows, disable services via GPO or sc config. Specifically remove or disable legacy protocols like SMBv1, Telnet, and older TLS versions. Lock down administrative functions — e.g., limit who can use remote management tools, require Jump Boxes for administrative access, and restrict service accounts to the minimum privileges needed.</p>\n\n<h2>Automate, validate, and monitor</h2>\n<p>Automation and continuous validation make the control sustainable. Bake allowlist and firewall rules into your configuration management (Ansible, Chef, Salt, or Intune policies), and automate periodic validation with vulnerability scans, nmap sweeps, and endpoint audits. Use endpoint logging (Sysmon for Windows, auditd for Linux) with a SIEM or log aggregation (Splunk, Elastic, or a hosted EDR console) to detect deviations, attempted use of blocked protocols, and unauthorized service start attempts. Keep change detection (file integrity monitoring) on critical executables to catch tampering.</p>\n\n<h2>Exceptions, change control and documentation</h2>\n<p>Implement a documented exceptions and change-control process: every exception must include business justification, time box, compensating controls (e.g., only allow access from a management subnet), and approval by the system owner. Track exceptions in your configuration management database (CMDB) and include them in the annual assessment for CM.L2-3.4.7. Maintain a rollback plan and test plan so that if a new rule breaks business-critical functionality, you can quickly remediate without risking data access or availability.</p>\n\n<h2>Risks of not implementing CM.L2-3.4.7</h2>\n<p>Failing to restrict programs, functions, ports, and protocols leaves numerous attack vectors open: exposed services can be exploited for remote code execution, legacy protocols enable credential theft, and unnecessary applications increase the likelihood of vulnerable software. From a compliance perspective, non-implementation can result in failed audits, loss of federal contracts that require NIST/CMMC compliance, and increased liability if CUI is compromised. Operationally, it increases detection noise and response complexity.</p>\n\n<p>Summary: To meet NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 CM.L2-3.4.7, adopt a repeatable lifecycle: inventory and baseline endpoints, apply targeted allowlisting and host firewall rules, disable unused services and legacy protocols, automate policy deployment and validation, and manage exceptions with documented change control. For small businesses, start with a prioritized inventory, test rules in audit mode, and roll changes through your MDM or configuration management tool so that security improvements are enforced consistently without disrupting workflows.</p>",
    "plain_text": "Restricting programs, functions, ports, and protocols on endpoints is a high-impact control for meeting NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 (CM.L2-3.4.7) — it reduces attack surface, limits lateral movement, and enforces the \"only what is required\" principle for systems that process Controlled Unclassified Information (CUI).\n\nUnderstand the objective and scope\nThe Compliance Framework requirement CM.L2-3.4.7 expects organizations to allow only the programs, services, ports and protocols necessary for mission-essential functions. Start by defining the scope: which endpoints process or access CUI, which user groups and roles need network access, and which services are required for business workflows. If you manage a mixed environment (Windows, macOS, Linux, mobile), list each OS and group endpoints by role (workstation, build server, file server, admin workstation) so rules are meaningful and testable.\n\nInventory and create a secure baseline\nPractical inventory steps\nBefore you block anything, build an accurate inventory of installed applications, running services, and open ports. Use tools suited to your environment: Microsoft Intune or SCCM for Windows, osquery or Open-AudIT for mixed environments, and nmap or Nessus for network-level port discovery. Record the executable hashes, versions, and publisher metadata so you can create precise allow/deny rules rather than blunt path-only rules.\n\nSmall-business example\nExample: a 40-person contracting firm has 35 Windows workstations and 5 Linux servers. Use PDQ Inventory on workstations and a simple Ansible playbook on servers to collect installed packages and running sockets (ss -tuln). Produce a baseline spreadsheet showing which hosts run RDP, SSH, SMTP relays, or proprietary vendor software — that becomes the starting whitelist for endpoints.\n\nApplication allowlisting and function restriction\nApplication allowlisting is the most effective way to enforce \"only required programs.\" On Windows, implement AppLocker or Microsoft Defender Application Control (MDAC) with rules by publisher, file hash, or path and start in Audit mode to gather policy exceptions before enforcement. On Linux, use SELinux, AppArmor, or tools like authselect and systemd service unit restrictions to limit process capabilities. For macOS, consider Jamf and built-in signed-app enforcement. Avoid naive path-based allowlists; prefer publisher-signature or hash-based rules for better security.\n\nRestrict ports and protocols at the host and network level\nWindows and host firewall examples\nOn Windows endpoints, use Windows Defender Firewall with Advanced Security: implement inbound rules that are 'Allow' only for required services and create default-deny for unsolicited inbound connections. For outbound control, configure rules to prevent unauthorized remote connections (e.g., block outbound RDP/Telnet). Example command for a quick block: netsh advfirewall firewall add rule name=\"Block RDP Out\" dir=out action=block protocol=TCP localport=3389. Use Group Policy or Intune to push rules centrally.\n\nLinux and network examples\nOn Linux servers, enforce restrictions with nftables/iptables or ufw where appropriate. Example: to deny telnet use 'sudo ufw deny 23' or use nftables to permit only required ports (22 for hardened SSH, 443 for web) and reject the rest. At the network edge, ensure perimeter firewalls only allow necessary ports and protocols to and from CUI-related systems; implement internal segmentation (VLANs or micro-segmentation) so that even if a host is compromised, access to other sensitive systems is very limited.\n\nHarden services and disable unused functions\nMany endpoints run unnecessary services by default. Use service management to stop and disable nonessential services: on systemd systems use 'systemctl disable --now '; on Windows, disable services via GPO or sc config. Specifically remove or disable legacy protocols like SMBv1, Telnet, and older TLS versions. Lock down administrative functions — e.g., limit who can use remote management tools, require Jump Boxes for administrative access, and restrict service accounts to the minimum privileges needed.\n\nAutomate, validate, and monitor\nAutomation and continuous validation make the control sustainable. Bake allowlist and firewall rules into your configuration management (Ansible, Chef, Salt, or Intune policies), and automate periodic validation with vulnerability scans, nmap sweeps, and endpoint audits. Use endpoint logging (Sysmon for Windows, auditd for Linux) with a SIEM or log aggregation (Splunk, Elastic, or a hosted EDR console) to detect deviations, attempted use of blocked protocols, and unauthorized service start attempts. Keep change detection (file integrity monitoring) on critical executables to catch tampering.\n\nExceptions, change control and documentation\nImplement a documented exceptions and change-control process: every exception must include business justification, time box, compensating controls (e.g., only allow access from a management subnet), and approval by the system owner. Track exceptions in your configuration management database (CMDB) and include them in the annual assessment for CM.L2-3.4.7. Maintain a rollback plan and test plan so that if a new rule breaks business-critical functionality, you can quickly remediate without risking data access or availability.\n\nRisks of not implementing CM.L2-3.4.7\nFailing to restrict programs, functions, ports, and protocols leaves numerous attack vectors open: exposed services can be exploited for remote code execution, legacy protocols enable credential theft, and unnecessary applications increase the likelihood of vulnerable software. From a compliance perspective, non-implementation can result in failed audits, loss of federal contracts that require NIST/CMMC compliance, and increased liability if CUI is compromised. Operationally, it increases detection noise and response complexity.\n\nSummary: To meet NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 CM.L2-3.4.7, adopt a repeatable lifecycle: inventory and baseline endpoints, apply targeted allowlisting and host firewall rules, disable unused services and legacy protocols, automate policy deployment and validation, and manage exceptions with documented change control. For small businesses, start with a prioritized inventory, test rules in audit mode, and roll changes through your MDM or configuration management tool so that security improvements are enforced consistently without disrupting workflows."
  },
  "metadata": {
    "description": "Practical, step-by-step guidance to restrict programs, functions, ports and protocols on endpoints to meet NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 (CM.L2-3.4.7) requirements and reduce attack surface.",
    "permalink": "/how-to-harden-endpoints-practical-steps-to-restrict-programs-functions-ports-and-protocols-for-nist-sp-800-171-rev2-cmmc-20-level-2-control-cml2-347.json",
    "categories": [],
    "tags": []
  }
}