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
What Is Contents Insurance and How Does It Work? - Insurify
5 Rules to Improve Your Financial Health
Where To Go After Howling Pit Code Vein
Www.paystubportal.com/7-11 Login
Noaa Charleston Wv
PRISMA Technik 7-10 Baden-Württemberg
South Carolina defeats Caitlin Clark and Iowa to win national championship and complete perfect season
Notary Ups Hours
Www Thechristhospital Billpay
Craigslistdaytona
Pollen Count Los Altos
Cvs Learnet Modules
Dutchess Cleaners Boardman Ohio
Lax Arrivals Volaris
10-Day Weather Forecast for Santa Cruz, CA - The Weather Channel | weather.com
Equibase | International Results
Missed Connections Dayton Ohio
Walgreens Tanque Verde And Catalina Hwy
Eine Band wie ein Baum
CVS Near Me | Columbus, NE
Aldi Bruce B Downs
St Clair County Mi Mugshots
Garnish For Shrimp Taco Nyt
8005607994
Inbanithi Age
4 Methods to Fix “Vortex Mods Cannot Be Deployed” Issue - MiniTool Partition Wizard
Bra Size Calculator & Conversion Chart: Measure Bust & Convert Sizes
208000 Yen To Usd
John Philip Sousa Foundation
Ncal Kaiser Online Pay
Otis Inmate Locator
Mark Ronchetti Daughters
Fandango Pocatello
One Credit Songs On Touchtunes 2022
67-72 Chevy Truck Parts Craigslist
CARLY Thank You Notes
Indiana Wesleyan Transcripts
Junior / medior handhaver openbare ruimte (BOA) - Gemeente Leiden
Reborn Rich Ep 12 Eng Sub
Midsouthshooters Supply
Craigslist Jobs Brownsville Tx
Koninklijk Theater Tuschinski
What Is The Optavia Diet—And How Does It Work?
FedEx Authorized ShipCenter - Edouard Pack And Ship at Cape Coral, FL - 2301 Del Prado Blvd Ste 690 33990
Samsung 9C8
Rocket League Tracker: A useful tool for every player
Jackerman Mothers Warmth Part 3
Evil Dead Rise - Everything You Need To Know
Diesel Technician/Mechanic III - Entry Level - transportation - job employment - craigslist
Charlotte North Carolina Craigslist Pets
Ff14 Palebloom Kudzu Cloth
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.