Score:0

Is a server firewall (i.e. UFW) necessary if a firewall is setup through the server provider?

cn flag

For example, if I have an Ubuntu server through DigitalOcean, if a firewall is setup through DigitalOCean's UI to control inbound and outbound traffic for said server, is it necessary to also enable and configure UFW? Do they functionally do the same thing? Is one better than the other?

Score:3
cn flag
Bob

A "host based firewall" is the more generic term for the firewall rules that you manage with UFW. They are complimentary with a "network firewall", which is configured independently from the host based firewall. Network firewalls can be for example an actual firewall appliance, ACL's in a router/switch, or security groups in the virtual network etc. IMHO one is not better than the other and you should have both.

But although two is better than one, having both can make troubleshooting connectivity issues more difficult as well.

The underlying security concept to have both a "network firewall" and a "host based firewall" is defense in depth".

The Wikipedia definition provides a good summary:

Defense in depth is a concept used in Information security in which multiple layers of security controls (defense) are placed throughout an information technology (IT) system. Its intent is to provide redundancy in the event a security control fails or a vulnerability is exploited that can cover aspects of personnel, procedural, technical and physical security for the duration of the system's life cycle.


To give a less abstract example: if somebody compromises your server and gets root access, they will also have enough privileges to either completely disable the host based firewall or insert their own custom rules. In that case the network firewall will still enforce your security policy.

fromtheloam avatar
cn flag
This was kind of my assumption, although I hadn't seen an explanation to this clearly stated. Thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.