What is a firewall?

DEFINITION

A firewall is a security control that monitors network traffic and allows or blocks it based on a set of rules, separating trusted systems from untrusted ones.

A firewall sits between a network or device and the outside world and decides which connections are allowed. Each rule typically looks at where traffic comes from, where it is going, which port and protocol it uses, and sometimes the application or content involved. Traffic that matches an allow rule passes; everything else can be dropped.

Firewalls exist at different levels. A hardware firewall or router protects an office network. A software firewall runs on a single laptop or server. Cloud providers offer virtual firewalls, often called security groups or network firewall rules, that control traffic to cloud servers. Next-generation firewalls add features such as application awareness and intrusion prevention.

Why firewalls matter

Every open port on a server is a potential entry point. Automated bots constantly scan the internet for exposed services like remote desktop, database ports or forgotten admin tools. A well-configured firewall reduces your attack surface by making sure only the services you intend to offer are reachable, and only by the people who should reach them.

Firewalls also help contain damage. If one device is compromised, internal rules can limit what else it can talk to.

How to configure a firewall well

The core principle is default deny: block everything, then open only what is needed. For example, a cloud server hosting a website might allow inbound ports 80 and 443 from anywhere for web traffic, allow SSH on port 22 only from the office IP address or a VPN, and block direct access to the database port entirely so only the application server can reach it. Review rules regularly, remove temporary exceptions once they are no longer needed, and document why each rule exists so future changes are made safely.

Best practices

  • Start from a default-deny policy and open only the ports and sources you actually need.
  • Restrict admin access such as SSH or remote desktop to known IP addresses or a VPN.
  • Never expose database ports directly to the public internet.
  • Label each rule with its purpose and owner, and review the rule set at least quarterly.

Common mistakes

  • Adding a broad allow-all rule to fix a connection problem and forgetting to remove it.
  • Relying on a network firewall alone to protect a web application from attacks like SQL injection.
  • Leaving default admin credentials on a firewall or router.

Frequently asked questions

What is the difference between a firewall and a web application firewall?

A traditional firewall filters traffic mainly by addresses, ports and protocols, deciding who can connect. A web application firewall (WAF) inspects the content of web requests, such as form inputs and URLs, to block attacks aimed at the application itself, like SQL injection or cross-site scripting. Most websites benefit from both.

Do I need a firewall if my website is in the cloud?

Yes. Cloud providers secure their underlying infrastructure, but you are responsible for controlling access to your own servers and services. Use the provider's security groups or firewall rules to limit open ports, and consider a WAF in front of public web applications. Misconfigured cloud access rules are a common cause of exposure.

Does a firewall stop viruses and phishing?

Only partly. Some advanced firewalls can block known malicious sites or files, but a firewall cannot stop an employee from entering a password on a convincing fake login page or opening a malicious attachment delivered through allowed email. You still need email filtering, endpoint protection, 2FA and staff awareness.

Need help with this?

サイバーセキュリティ by VYZEON — ビジネス、データ、そしてお客様を守る。

Fixed packages from $199. Written scope, no surprises.

See サイバーセキュリティ

Related terms

More Security & cloud terms