🚨 CMMC Phase One started November 10! Here's everything you need to know →

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

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.

•
April 05, 2026
•
5 min read

Share:

Schedule Your Free Compliance Consultation

Feeling overwhelmed by compliance requirements? Not sure where to start? Get expert guidance tailored to your specific needs in just 15 minutes.

Personalized Compliance Roadmap
Expert Answers to Your Questions
No Obligation, 100% Free

Limited spots available!

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).

Understand the objective and scope

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.

Inventory and create a secure baseline

Practical inventory steps

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.

Small-business example

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.

Application allowlisting and function restriction

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.

Restrict ports and protocols at the host and network level

Windows and host firewall examples

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.

Linux and network examples

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.

Harden services and disable unused functions

Many 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.</p>

Automate, validate, and monitor

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.

Exceptions, change control and documentation

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.

Risks of not implementing CM.L2-3.4.7

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.

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.

 

Quick & Simple

Discover Our Cybersecurity Compliance Solutions:

Whether you need to meet and maintain your compliance requirements, help your clients meet them, or verify supplier compliance we have the expertise and solution for you

 CMMC Level 1 Compliance App

CMMC Level 1 Compliance

Become compliant, provide compliance services, or verify partner compliance with CMMC Level 1 Basic Safeguarding of Covered Contractor Information Systems requirements.
 NIST SP 800-171 & CMMC Level 2 Compliance App

NIST SP 800-171 & CMMC Level 2 Compliance

Become compliant, provide compliance services, or verify partner compliance with NIST SP 800-171 and CMMC Level 2 requirements.
 HIPAA Compliance App

HIPAA Compliance

Become compliant, provide compliance services, or verify partner compliance with HIPAA security rule requirements.
 ISO 27001 Compliance App

ISO 27001 Compliance

Become compliant, provide compliance services, or verify partner compliance with ISO 27001 requirements.
 FAR 52.204-21 Compliance App

FAR 52.204-21 Compliance

Become compliant, provide compliance services, or verify partner compliance with FAR 52.204-21 Basic Safeguarding of Covered Contractor Information Systems requirements.
 
Hello! How can we help today? 😃

Chat with Lakeridge

We typically reply within minutes