Skip to Content
All Articles Our blog

Firewall

Understanding Firewalls: The First Line of Defense in Server Security

In today’s digital world, cybersecurity is no longer optional. Whether you are running a small business website or a large ERP system, protecting your infrastructure is critical.

One of the most fundamental and powerful security components in any network architecture is the firewall.

But what exactly is a firewall, and why is it so important?

What Is a Firewall?

A firewall is a security system that monitors and controls incoming and outgoing network traffic based on predefined security rules.

Think of it as a security guard standing at the entrance of your server or network.

It decides:

  • Who is allowed to enter

  • Which ports can be accessed

  • What type of traffic is permitted

  • Which requests should be blocked

Without a firewall, your server is exposed directly to the internet — which means anyone can attempt to connect.

Why Firewalls Are Critical for Servers

When you deploy a server (for example, an ERP system like Odoo), it typically listens on certain ports:

  • 22 (SSH)

  • 80 (HTTP)

  • 443 (HTTPS)

  • 8069 (Odoo default)

If all ports are open to the public internet, your server becomes vulnerable to:

  • Brute-force attacks

  • Port scanning

  • Exploit attempts

  • DDoS attacks

  • Unauthorized access

A properly configured firewall ensures that only necessary ports are accessible — and only from trusted IP addresses when possible.

Types of Firewalls

There are several types of firewalls used in modern infrastructure:

1️⃣ Network Firewall

This protects the entire network at the infrastructure level.

Cloud providers like AWS, Azure, and DigitalOcean offer network-level firewalls.

They control traffic before it even reaches your server.

2️⃣ Host-Based Firewall

This is installed directly on the server.

Examples:

  • UFW (Ubuntu)

  • iptables (Linux)

  • firewalld

  • Windows Defender Firewall

It filters traffic at the operating system level.

3️⃣ Web Application Firewall (WAF)

This type of firewall protects web applications specifically.

It can:

  • Block SQL injection

  • Prevent cross-site scripting (XSS)

  • Stop malicious bots

Common examples include Cloudflare WAF and ModSecurity.

Best Practices for Firewall Configuration

A firewall is only effective if configured properly.

Here are essential best practices:

1. Default Deny Policy

Start with everything blocked.

Then allow only what is necessary.

This is known as the “deny all, allow specific” approach.

2. Restrict SSH Access

Instead of allowing SSH (port 22) from the entire internet:

  • Allow access only from specific IP addresses.

  • Use key-based authentication.

  • Disable root login.

  • Consider using a bastion (jump) server.

3. Allow Only Required Ports

For example:

  • 80 and 443 for web traffic

  • 22 only for trusted IPs

  • Block database ports (5432, 3306) from public access

Your database should never be publicly exposed.

4. Monitor and Log Traffic

Enable logging to:

  • Detect unusual traffic

  • Identify attack attempts

  • Analyze access patterns

Logs help you respond quickly to security incidents.

Firewall in ERP Environments

In ERP deployments, firewall configuration becomes even more critical.

For example:

If you are running Odoo for:

  • Sales

  • Finance

  • Inventory

  • HR

You must ensure:

  • Database ports are not public

  • Admin endpoints are restricted

  • API access is limited

  • External integrations use secure tokens

  • Only approved IP ranges can access backend services

When combined with:

  • Role-based access control

  • Strong authentication

  • Bastion server architecture

The firewall becomes part of a layered security strategy.

Firewall + Bastion Server Architecture

In high-security environments, direct server access is avoided.

Instead:

  1. Public internet connects to a bastion server.

  2. The bastion server connects to the private ERP server.

  3. The ERP server is not publicly accessible.

This drastically reduces the attack surface.

Common Firewall Mistakes

Many businesses make these errors:

  • Opening all ports “temporarily”

  • Allowing SSH from anywhere

  • Exposing databases publicly

  • Forgetting to remove old rules

  • Not updating firewall policies after infrastructure changes

Security must be proactive, not reactive.

Next Article ZERO UI/UX
Kashif Aziz
Kashif Aziz
AlhadiTech Engineer

Technical expert at AlhadiTech passionate about building enterprise-grade Odoo solutions and sharing knowledge with the community.

More posts by this author