This is the next step in my series on system security hardening and network security. Please check out the previous article on 3 quick ways to reduce your attack surface on Linux

Flat networks

Flat Networks

There was a time when all networks were flat. A flat network is similar to your standard home network today. All of your hosts are neighbors to each other. All are in the same IP scope, with no firewalls or routers between them: Your laptop can see your TV, your TV can see your phone with no barriers.

Flat networks have benefits. Theyโ€™re simple, and all of your hosts can reach each other without you having to think too hard about how to enable access. If youโ€™ve got an enterprise network instead of a home network, you might have your web server, database server, and enterprise resource planning (ERP) all running on this network. When your web application has to integrate with the ERP or get data from the database, itโ€™s just a matter of writing code or plugging in a configuration with no pesky firewalls in the way. The process is just simpler and everything can talk to everything else, which is what a network is for, right?

Well yes, but in todayโ€™s world of cybercrime, and espionage, a flat network means your network is vulnerable. Those networks usually have a firewall at the edge, which is like putting a wall around your castle. The only way in is through the gate, and the gate has guards that donโ€™t let anyone in, so youโ€™re safe inside your castle, right? Sure you are until someone gets past your guards. Maybe they found the servantโ€™s entrance, maybe they fought their way past your guards, or maybe they snuck in with a wagon of supplies. The point is, once theyโ€™re inside your castle walls, if you donโ€™t have any other protection, intruders have a good chance of getting from that supply truck over to your food supply, treasury, or armory, all because youโ€™re focused on the wall around the castle.

Flat Networks + Perimeter

This castle analogy is very much like a perimeter firewall. Sure, having one makes it hard for attackers to get into your network. But once theyโ€™re in, youโ€™ve got no other defenses to stop them from hopping from system to system until they find whatever it is theyโ€™re looking for. Maybe they compromise your web server through a bug in your web application that lets them execute a remote shell. That shell tunnels out to their system, and now theyโ€™ve got a terminal on a server in your network. From there, they do some scanning. Because your network is wide open inside of the firewall, they can see everything in there. They notice the database server and the ERP and start attacking those systems from inside your web server.

There are a few ways to solve this problem. You could keep your flat network and implement host-based firewalls on all of your hosts. This action would be like arming all of your citizens inside your castle and posting more guards at the entrance of the treasury and the armory. An attacker might still sneak in on your supply wagon, but when he climbs out and heads for the treasury, heโ€™s got to deal with a guard at the door before he can walk in and steal your gold. This solution isnโ€™t perfect and it can be hard to manage, but itโ€™s certainly a decent option, and itโ€™s better than having a wide-open network.

Network segmentation

To take this approach even further, you can split up your network and put internal firewalls between those smaller networks. We call this tactic network segmentation. The idea is simple: You group systems together based on their security levels or based on their purposes.

Consider your web server, which runs a web application that many users access all day long. Thatโ€™s a pretty low-trust system, therefore, you trust this server the least. Behind the web server, thereโ€™s probably a database server. Put that in its own isolated network, since no one should be reaching it directly: All requests to the database server are first handled by your web application.

Now, maybe all of your database servers sit right next to each other, or maybe they donโ€™t. You might have highly sensitive data on one database server (for that ERP), and not-so-sensitive data on another. If this is the case, put the ERP database in another, even more secure network. What you end up with is walls between your systems. If your webserver gets popped, the bad guys might have a foothold there, but they canโ€™t just waltz into your database server since thereโ€™s a firewall between this web server and your database server, and they may have no access at all to your ERP database. To go even further, you could also limit access to systems on the hosts themselves. Take our example with the web server, the database server, and the ERP database server. Say that your database server has its host-based firewall set up so that only the webserver can reach it on the database port, and the ERP database server has a similar rule so that only the ERP application can reach it. Then, say theyโ€™re in the same network segment. Now, if someone pops your web server and jumps from there to your database server, even though theyโ€™re in the same network as your ERP database, they still canโ€™t access your ERP database, because the host-based firewall on the ERP database doesnโ€™t allow it.

Segmented Network Diagram

And all of this, my dear sysadmin, is what we call defense in depth (DiD). Because like ogres (and parfait), well-architected services have layers. When an attacker gets past one layer, they have another line of defense to deal with, and another, and another. Itโ€™s impossible to have an unhackable service, so your goal is to make your services more difficult so an attacker gives up, and goes off to find an easier target.

Wrapping up

I hope youโ€™ve learned a bit about defense in depth! Next time weโ€™ll be talking about validating all of this complexity and breaking out the port scanner.

[Need more on networking? Download the Linux networking cheat sheet.]


์ €์ž ์†Œ๊ฐœ

Nate is a Technical Account Manager with Red Hat and an experienced sysadmin with 20 years in the industry.  He first encountered Linux (Red Hat 5.0) as a teenager, after deciding that software licensing was too expensive for a kid with no income, in the late 90โ€™s.  Since then heโ€™s run everything from BBSโ€™s (remember those?) to derby hatโ€™s containing raspberry piโ€™s, to Linux systems in his basement, or in enterprise-class data-centers. 

He runs his own blog at undrground.org, hosts the Iron Sysadmin Podcast, and when heโ€™s not at a command line, heโ€™s probably in the garage tinkering on his Jeep, or out on the trails.  

UI_Icon-Red_Hat-Close-A-Black-RGB

์ฑ„๋„๋ณ„ ๊ฒ€์ƒ‰

automation icon

์˜คํ† ๋ฉ”์ด์…˜

๊ธฐ์ˆ , ํŒ€, ์ธํ”„๋ผ๋ฅผ ์œ„ํ•œ IT ์ž๋™ํ™” ์ตœ์‹  ๋™ํ–ฅ

AI icon

์ธ๊ณต์ง€๋Šฅ

๊ณ ๊ฐ์ด ์–ด๋””์„œ๋‚˜ AI ์›Œํฌ๋กœ๋“œ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•˜๋Š” ํ”Œ๋žซํผ ์—…๋ฐ์ดํŠธ

open hybrid cloud icon

์˜คํ”ˆ ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ํด๋ผ์šฐ๋“œ

ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ํด๋ผ์šฐ๋“œ๋กœ ๋”์šฑ ์œ ์—ฐํ•œ ๋ฏธ๋ž˜๋ฅผ ๊ตฌ์ถ•ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณด์„ธ์š”

security icon

๋ณด์•ˆ

ํ™˜๊ฒฝ๊ณผ ๊ธฐ์ˆ  ์ „๋ฐ˜์— ๊ฑธ์ณ ๋ฆฌ์Šคํฌ๋ฅผ ๊ฐ์†Œํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ตœ์‹  ์ •๋ณด

edge icon

์—ฃ์ง€ ์ปดํ“จํŒ…

์—ฃ์ง€์—์„œ์˜ ์šด์˜์„ ๋‹จ์ˆœํ™”ํ•˜๋Š” ํ”Œ๋žซํผ ์—…๋ฐ์ดํŠธ

Infrastructure icon

์ธํ”„๋ผ

์„ธ๊ณ„์ ์œผ๋กœ ์ธ์ •๋ฐ›์€ ๊ธฐ์—…์šฉ Linux ํ”Œ๋žซํผ์— ๋Œ€ํ•œ ์ตœ์‹  ์ •๋ณด

application development icon

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

๋ณต์žกํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ๋Œ€ํ•œ ์†”๋ฃจ์…˜ ๋” ๋ณด๊ธฐ

Virtualization icon

๊ฐ€์ƒํ™”

์˜จํ”„๋ ˆ๋ฏธ์Šค์™€ ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์—์„œ ์›Œํฌ๋กœ๋“œ๋ฅผ ์œ ์—ฐํ•˜๊ฒŒ ์šด์˜ํ•˜๊ธฐ ์œ„ํ•œ ์—”ํ„ฐํ”„๋ผ์ด์ฆˆ ๊ฐ€์ƒํ™”์˜ ๋ฏธ๋ž˜