Introduction to Firewalls
Introduction to Firewalls
The problem is is firewall's are one of those terms that gets mixed up all over the
place.
Or you're talking about your individual computer and you've got windows firewall so
we talk about firewalls all the time.
But what I want to do is talk about what firewalls are and the best place to start
is understanding where firewalls live.
So what I want to begin with is my little network here so it's a home network and
I've got some computers here that are hooked to a switch and this is a router.
Now we usually think about filtering in terms of filtering by IP address and ports
but it can do more than that.
I don't want to concentrate so much on what it's filtering right now I just want to
go OK my good filters.
So here in this little network what I want to do is prevent naughties from coming
into my network or naughties from going out of the network.
So one of the traditional places we're going to put a firewall is on the edge of my
network and these types of firewalls tend to be actual little boxes.
So it's very common to have routers with built in firewall features but that were
not limited to that if I wanted to and there are people who would be glad to sell
it to you.
I can do something like this where I've got a firewall and a separate router so it
don't get the idea that all routers are firewalls.
And it's a convenient place to put it but in no way is that exactly always true.
So this may or may not be a router for this description but what it is for right
now is that it's a firewall.
This is protecting the entire network so we call this a network firewall since it's
usually a dedicated box.
We tend to call this also a hardware firewall.
So this little box which is designed to protect the entire network is a network
firewall and because it's a close to being a dedicated box we also call it a
hardware firewall.
If we go over to our individual computers each one of these computers can also have
a firewall feature.
Now since it's if we could if we wanted to People would sell to you we could put
little boxes in front of all of our individual homes but that could be ridiculously
expensive.
And since our hosts usually only have one network connection it's trivial for us to
install software onto these hoes that can act as a firewall at this point.
So since we're just installing software we would call that a software firewall and
because it's only protecting this one computer we call this a host firewall because
his job is only to protect this host from naughties that are coming in and out of
that device.
So if you take a look at this set up this is fairly common for most networks where
you have some box on the edge that is providing firewall features and because it's
on the edge we tend to do a lot with these individual boxes.
Not that long ago in fact you probably still could buy a dedicated box that is just
a firewall.
And people like Barracuda for example would sell you one.
But what we start to see more and more today is that we have one box that can do a
lot.
We have this box that's a firewall but it could also be a VPN in point.
It could be a proxy it can do all kinds of things in this one little box.
So a UTM box can be a firewall but it's going to be a firewall and much much more.
Make sure you know the difference between network and host based and software and
hardware based firewalls.
Firewalls
Now that we know we're firewall's are located.
All right now what I want to do is use this diagram here and I want to talk about
our firewall in this case that's going to be it external hardware firewall.
This is the bad evil world out here that I'm going to just unplug this so we can
just look at this part now when we take a look at a firewall it's going to do one
of two big things.
Or stateful firewalls.
Let's talk about both of these stateless firewalling is like the original type of
firewall thing this goes way back with a stateless firewall.
All this firewall is looking at is data that's coming in or going out of the
network and is filtering that traffic based on primarily IP address and port number
so I can go in to this firewall right here and I could create an Access Control
List and in that Access Control list I can say allow outgoing port 80 and
everything going out so people can get to google.com whatever they want to do.
The problem that we have is that when we look at all of the things that can go in
and out of this particular firewall the job can get messy.
So what I want you to do is let's take a moment and take a look at an access
control list.
When you start up a router and you configure it the first thing you're going to
have to do is create an Access Control List.
I love it though because it's simplistic interface really makes it easy to explain
stuff.
Now those of you who are familiar with links as routers will recognize that this is
not the standard interface and what's happened here is this is a popular third
party firmware called DD- w r t and i love it.
And I do this all the time with my routers.
OK.
And what we're going to do here is we're going to create an access control lists so
right now I have no access controls at all so this guy calls these each individual
control is a policy so a stack of policies is collectively an access control list.
So really all I want to do is I want to stop the guys from playing Battlefield 1942
on my computers.
That's 43.
I can edit a list of PCs and I know that those guys are using these IP addresses so
let me just go ahead and type these in so you can see I've set up a range of IP
addresses I could have done this by MAC address or by individual IPs just as
easily.
OK.
What I can do is if I wanted to I could deny and I could say when do I want to deny
him and what times I want to deny them.
If I hit deny that doesn't do anything I certainly want them to do their work.
I just wanted to play Battlefield 1942 so we scroll down here and see there it is.
So like most good routers they'll have presets for different port numbers and
things like that.
But if I wanted to I could go ahead and easily type in my own but I'm just going to
use this because it's handy and convenient.
Now you'll see it's zeros here but it actually has a lot of information in here
that says exactly what they're blocking so that they can't pay play Battlefield
1942 I don't even remember the port numbers off the top of my head.
I could also block by your address I could box by keyword anything like that.
But I'm just going to save settings and what I've done is I have created one
policy.
So I now have an access control list that consists of exactly one policy and I can
make on this particular router I can make nine more as you can see right there.
The bottom line is that all different devices have all different ways to manifest
that access control list.
The Access Control List in a stateless firewall really is nothing more than a bunch
of rules that allows a dumb packet filter like our stateless firewall to do what it
does.
The stateless firewalls really just going to be looking at the IP address and the
port numbers and filtering traffic based on that.
Most modern firewall today has a stateless firewall feature built into it.
So here's my firewall This is out in the Internet and this is my internal network.
Based on my Access Control list in order to stop unsolicited incoming port 80 80s
I'm going to have to make a rule in my Access Control List.
OK well you could do that but now the problem is what if this bad guy once it goes
it does 80 81 immediately and then 88 to get the idea.
It becomes a problem.
We need something that's actually inspecting the connection that's going on between
two devices we need something that looks at the State of the connection that's
going on.
Keep in mind if you remember a few episodes back when we were talking about TZP IP
we would say we had a client on one side and the server on the other and then the
client would initiate the conversation.
And then the server would respond and they would acknowledge each other and they
would then have a communication going on between the two.
I can make a firewall that is aware of communications he's aware of the state of
the conversation going on through it at all times and we call that a stateful
firewall.
A stateful firewall.
Let's say we have an internal with a little box in here and he wants to get on
google so he'll go out.
This stateful firewall creates what's known as a state table and in that state
table it writes down OK so this computer here is going out on port 80 to this
particular IP address.
He writes all this down into the state table and is now ready and expecting an
incoming packet from that server.
I'm going to go ahead and allow that through that is the most simplistic version of
a stateful firewall.
Now stateful firewalls are great and you don't have to have a stateless or stateful
for in fact most good firewalls are both stateless and stateful at the same time.
So these two guys do a great job of doing a lot of firewalling but there's still
not enough.
There are certain applications out there and these applications can actually change
their report number on the fly a bit torrent.
There's some chat programs that do this there's a lot of programs out there that
can actually change their port number so tinny on the inside here.
And it's smart enough to go hey in that database that I don't care what the port
number is.
This has this feature has been known as deep packet inspection but for the exam
just concentrate on the word application or context to where running at Layer 7 of
the OS II.
So when it comes to firewalling we have two big groups we have state lists which
are the ones that just kind of look at individual packets.
We have stateful which looks at the actual state of the conversation between any
two computers.
And then as an extension to that we have firewalls that are capable of looking
inside the data payload