The guard at the gate
A big office has a guard at the gate. The guard has a list. Delivery vans may come in. Visitors need a pass. Nobody may carry a box out without a note.
A computer network (linked computers) has a guard like that. It checks everything that comes in and goes out, using a list of rules.
Key words
| Word | What it means | Example |
|---|---|---|
| Network | Computers and devices that are linked together. | a school network |
| Firewall | A guard that allows or blocks network traffic using rules. | a gate with a list |
| Inbound | Traffic coming into your network. | a visitor to your website |
| Outbound | Traffic going out of your network. | a worker opening a web page |
| Port | A numbered door on a computer that network traffic uses. | port 443 for secure web pages |
| IP address | The number that names a device on a network. | 192.168.1.20 |
| Segregation | Keeping parts of a network apart. | a guest network and a staff network |
| Network monitoring | Watching network traffic and logs for problems. | a screen of alerts |
| Port scanning | Checking which ports are open on a computer. | a list of open doors |
The cells students fill in are left blank in this preview.
Quick check: in or out?
Have a go
Quick check: in or out?
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Four kinds of firewall rule
| Kind of rule | It decides by | Example | Why use it |
|---|---|---|---|
| Traffic direction | Whether it is inbound or outbound | Block all inbound traffic unless asked for | Strangers cannot start a chat with your computers |
| Traffic type | The kind of traffic, such as web pages or email | Allow web traffic. Block file sharing | Stops kinds of traffic the business does not need |
| Application | Which program sends it | Block a game, allow the work program | Stops unwanted programs sending data out |
| IP address | Where it comes from or goes to | Block a list of addresses known to attack | Shuts out sources that are known to be bad |
The cells students fill in are left blank in this preview.
A small rule list. The first match wins.
| Rule | Action | Direction | Port | Meaning |
|---|---|---|---|---|
| 1 | Allow | Inbound | 443 | Visitors may reach secure web pages |
| 2 | Deny | Inbound | 23 | Nobody may use door 23 |
| 3 | Allow | Outbound | any | Staff may go out to the internet |
| 4 | Deny | Everything else | any | Default: block what is not listed |
The cells students fill in are left blank in this preview.
Extra: Some real port numbers
| Port | What uses it | Usual rule |
|---|---|---|
| 443 | Secure web pages (HTTPS) | Allow |
| 80 | Web pages that are not secure | Often sent on to 443 |
| 22 | Secure login to a computer from far away | Allow only for staff |
| 23 | Telnet, an old login that sends passwords as plain text | Deny |
| 3389 | Remote desktop (using a computer from far away) | Deny from the internet |
The cells students fill in are left blank in this preview.
Try it: first match wins
rules = [["allow", "in", 443], ["deny", "in", 23], ["allow", "out", "any"]]
def decide(direction, port):
for rule in rules:
if rule[1] == direction and (rule[2] == "any" or rule[2] == port):
return rule[0]
return "deny"
print(decide("in", 443))
print(decide("in", 23))
print(decide("in", 8080))
# Add a new rule at the start to allow port 8080 and run it again.