A firewall won’t secure your environment like it should if you don’t properly configure its ports and policies. But which ports should you block? It’s a question that every sysadmin has asked themselves at one time or another.
Depending on the environment, where firewalls are placed in the flow of data, and probably on your staffing and timeline, there are a good foundation of firewall rule best practices that you should complete when securing down new or existing firewall rules. The order of the steps depends on whether you’re replacing hardware or spinning up a new environment from scratch.
In general, you should follow the best practice of least privilege when configuring a firewall, which just means to block literally everything that you aren’t using for a dedicated and approved business function. This reduces your risk, gives you more control over your traffic, and limits your communication between networks.
Granted, there are times when the CEO might want to allow his staff to play WoW on the corporate network. Is that technically tied to the business? Nope, but it’s something that you’ll definitely still need to open if you want to keep your job. However, there are still ways to do these things securely!
Monitor current traffic for which IP addresses and ports are used — and validate that they are needed; not everything requires internet access. If you are replacing a firewall, you can create a span port or look at the old firewall logs to determine this. Compile a list of the source IP, destination IP, and destination port and start to group them into categories for easier firewall rule creation.
Create a deny all, inbound and outbound as the first created and last firewall rule processed. Also known as a ‘Default Deny,’ it ensures that all rules created after these initial denies are purposeful.
If possible, create different groups of IPs and ports that make sense, which allows you to create a set of firewall rules, and primarily use groups where you can add/remove individual components. Ensure your rules specify the destination and source IP addresses — or sometimes ranges — and destination port whenever possible. For example:
For those of you that came looking for a list of ports to block, here is at minimum the SANS Institute recommends blocking outbound traffic that uses the following ports:
Service | Port Type | Port Number |
---|---|---|
MS RPC | TCP, UDP | 135 |
NetBIOS/IP | TCP, UDP | 137-139 |
SMB/IP | TCP | 445 |
Trivial File Transfer Protocol (TFTP) | UDP | 69 |
Syslog | UDP | 514 |
Simple Network Management Protocol (SNMP) | UDP | 161-162 |
Internet Relay Chat (IRC) | TCP | 6660-6669 |
Firewall and firewall rules are an important component of a security stack, but deploying a firewall isn’t enough protection for a business. Threat actors can easily circumvent a firewall using a variety of techniques, such as social engineering and taking advantage of application vulnerabilities.
Blumira integrates with many firewalls, including Cisco Meraki and ASA, F5 Big-IP, Fortinet Fortigate, Sophos XG, and more. Blumira detects suspicious behaviors that can lead to cyberattacks without overwhelming IT teams with alerts. Our platform also provides automated workflows and playbooks to give you guidance on remediation steps. Our team of security experts act as an extension of your team. We are always ready to answer any questions about a finding or how to move forward.
Our Free edition features six cloud integrations. See how easy it is to deploy, and how teams can start seeing immediate security value for their organizations — no credit card required.