Best Practices for Firewall Rules Configuration (2024)

When you change a firewall configuration, it's important to consider potential security risks to avoid future issues. Security is a complex topic and can vary from case to case, but this article describes best practices for configuring perimeter firewall rules.

Block by default

Block all traffic by default and explicitly enable only specific traffic to known services. This strategy provides good control over the traffic and reduces the possibility of a breach because of service misconfiguration.

You achieve this behavior by configuring the last rule in an access control list to deny all traffic. You can do this explicitly or implicitly, depending on the platform.

Allow specific traffic

The rules that you use to define network access should be as specific as possible. This strategy is the principle of least privilege, and it forces control over network traffic. Specify as many parameters as possible in the rules.

A layer 4 firewall uses the following parameters for an access rule:

  • Source IP address (or range of IP addresses)
  • Destination IP address (or range of IP addresses)
  • Destination port (or range of ports)
  • Protocol of the traffic (TCP, ICMP, or UDP)

Specify as many parameters as possible in the rule used to define network access. There are limited scenarios where any is used in any of these fields.

Specify source IP addresses

If the service should be accessible to everyone on the Internet, then any source IP address is the correct option. In all other cases, you should specify the source address.

It's acceptable to enable all source addresses to access your HTTP server. It's not acceptable to enable all source addresses to access your server management ports or database ports. The following is a list of common server management ports and database ports:

Server management ports:

  • Linux®SSH : Port 22
  • Windows® RDP: Port 3389

Database ports:

  • SQL® Server : Port 1433
  • Oracle® : Port 1521
  • MySQL® : Port 2206

Be specific about who can reach these ports. When it is impractical to define source IP addresses for network management, you might consider another solution like a remote access VPN as a compensating control to allow the access required and protect your network.

Specify the destination IP address

The destination IP address is the IP address of the server that runs the service to which you want to enable access. Always specify which server or servers are accessible. Configuring a destination value of any could lead to a security breach or server compromise of an unused protocol that might be accessible by default. However, destination IPs with a destination value of any can be used if there is only one IP assigned to the firewall. The value any can also be used if you want both public and servicenet access to your configuration.

Specify the destination port

The destination port corresponds to the accessible service. This value of this field should never be any. The service that runs on the server and needs to be accessed is defined, and only this port needs to be allowed. Allowing all ports affects the security of the server by allowing dictionary attacks as well as exploits of any port and protocol that is configured on the server.

Avoid using too wide a range of ports. If dynamic ports are used, firewalls sometimes offer inspection policies to securely allow them through.

Examples of dangerous configurations

This section describes dangerous examples of firewall rules, but also shows some alternative good rules to follow when configuring firewall rules.

permit ip any any - Allows all traffic from any source on any port to any destination. This is the worst type of access control rule. It contradicts both of the security concepts of denying traffic by default and the principal of least privilege. The destination port should be always specified, and the destination IP address should be specified when practical. The source IP address should be specified unless the app is built to receive clients from the Internet, such as a web server. A good rule would be permit tcp any WEB-SERVER1 http.

permit ip any any WEB-SERVER1 - Allows all traffic from any source to a web server. Only specific ports should be allowed; in the case of a web server, ports 80 (HTTP) and 443 (HTTPS). Otherwise, the management of the server is vulnerable. A good rule would be permit ip any WEB-SERVER1 http.

permit tcp any WEB-SERVER1 3389 - Allows RDP access from any source to the web server. It is a dangerous practice to allow everyone access to your management ports. Be specific about who can access the server management. A good rule would be permit tcp 12.34.56.78 3389 WEB-SERVER1 (where 12.34.56.78 is the IP address of the administrator's computer on the Internet).

permit tcp any DB-SERVER1 3306 - Allows MySQL access from any source to the database. Database servers should never be exposed to the whole Internet. If you need database queries to run across the public Internet, specify the exact source IP address. A good rule would be permit tcp 23.45.67.89 DB-SERVER1 3306 (where 23.45.67.89 is the IP address of the host on the Internet that needs access to the database). A best practice would be to allow database traffic over a VPN and not in clear text across the public Internet.

If you need help implementing these best practices, contact your Rackspace support team.

Best Practices for Firewall Rules Configuration (2024)
Top Articles
Here’s How Deposit Insurance Keeps Bank Accounts Safe—Even If Its Funding Runs Dry
Career Forecast: Top 10 Emerging Jobs by 2028​
Uhauldealer.com Login Page
Brady Hughes Justified
Metallica - Blackened Lyrics Meaning
Mohawkind Docagent
Mustangps.instructure
How to Type German letters ä, ö, ü and the ß on your Keyboard
Toonily The Carry
Cincinnati Bearcats roll to 66-13 win over Eastern Kentucky in season-opener
Job Shop Hearthside Schedule
Nebraska Furniture Tables
Grace Caroline Deepfake
What is Cyber Big Game Hunting? - CrowdStrike
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis - NFL
Walmart End Table Lamps
Crossword Nexus Solver
Baywatch 2017 123Movies
Unlv Mid Semester Classes
Water Days For Modesto Ca
Craigslist Free Stuff Merced Ca
E22 Ultipro Desktop Version
Divina Rapsing
Officialmilarosee
Jbf Wichita Falls
Indiana Wesleyan Transcripts
Best Transmission Service Margate
Sandals Travel Agent Login
Accuweather Minneapolis Radar
Pawn Shop Moline Il
Klsports Complex Belmont Photos
Effingham Daily News Police Report
Enduring Word John 15
Sam's Club Near Wisconsin Dells
Ghid depunere declarație unică
Lil Durk's Brother DThang Killed in Harvey, Illinois, ME Confirms
Garrison Blacksmith's Bench
Robot or human?
Tgh Imaging Powered By Tower Wesley Chapel Photos
Devin Mansen Obituary
Powerspec G512
Culver's of Whitewater, WI - W Main St
Sabrina Scharf Net Worth
2023 Fantasy Football Draft Guide: Rankings, cheat sheets and analysis
Rhode Island High School Sports News & Headlines| Providence Journal
Stitch And Angel Tattoo Black And White
The Blackening Showtimes Near Ncg Cinema - Grand Blanc Trillium
Myra's Floral Princeton Wv
300+ Unique Hair Salon Names 2024
Jesus Calling Oct 6
Pauline Frommer's Paris 2007 (Pauline Frommer Guides) - SILO.PUB
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6452

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.