Mastering Linux Security and Hardening
上QQ阅读APP看书,第一时间看更新

Securing Your Server with a Firewall - Part 1

Security is one of those things that's best done in layers. Security-in-depth, we call it. So, on any given corporate network, you will find a firewall appliance separating the internet from the demilitarized zone (DMZ), where your internet-facing servers are kept. You will also find a firewall appliance between the DMZ and the internal LAN, and firewall software installed on each individual server and client. We want to make it as tough as possible for intruders to reach their final destinations within our networks.

Interestingly, though, of all the major Linux distros, only the SUSE distros and the Red Hat type distros come with firewalld already set up and enabled. When you look at your Ubuntu virtual machine, you'll see that it's wide open, as if it were extending a hearty welcome to any would-be intruder.

Since the focus of this book is on hardening our Linux servers, we'll focus this chapter on that last level of defense: the firewalls on our servers and clients. We'll cover all of the major command-line firewall interfaces, ranging from iptables to the new kid on the block, nftables.

In this chapter, we'll cover the following topics:

  • An overview of firewalld
  • An overview of iptables
  • Uncomplicated firewall for Ubuntu systems

In the next chapter, we'll cover nftables and firewalld.