Firewall rule: allow or deny by port

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Firewall rule: allow or deny by port

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which firewall rule lets secure web traffic (HTTPS) come into a school web server?
A allow inbound TCP 443
B deny inbound TCP 443
2. A firewall rule has three parts. Which list names them correctly?
A Action, direction, port
B Username, password, port
3. Which rule blocks Telnet (port 23) traffic coming in from the internet?
A allow inbound TCP 23
B deny inbound TCP 23
4. What does 'inbound' mean in a firewall rule?
A Traffic coming into the network from outside
B Traffic leaving the network to the internet
5. Which rule lets students on the school network visit websites over HTTPS?
A deny outbound TCP 443
B allow outbound TCP 443

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1allow inbound TCP 443 ALet incoming HTTPS web traffic through the firewall on port 443
2deny inbound TCP 23 Ballow outbound TCP 443
3A rule that lets your computer send web requests out to the internet over HTTPS Cdeny inbound TCP 21
4Closing an unused port by blocking incoming traffic to it, such as port 21 for FTP that nobody uses DThe rule has no port number, so it does not say which port to close. It should be something like deny inbound TCP 23.
5allow TCP 443 EBlock incoming Telnet connections on port 23
6deny inbound TCP FThe rule has no direction. A firewall rule must say inbound or outbound so it is clear which way the traffic travels. It should be allow inbound TCP 443.

Definitions

allow inbound TCP 443

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
_____ inbound TCP 443
2.
allow _______ TCP 443
3.
____ inbound TCP 23
4.
allow outbound TCP ___
5.
deny inbound TCP __

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A # Web server firewall rules
B allow inbound TCP 80
C deny inbound TCP 443
D deny inbound TCP 23
Question 2
A # Block Telnet from outside
B allow inbound TCP 23
C allow inbound TCP 443
Question 3
A default allow inbound
B allow inbound TCP 443
C allow inbound TCP 80
Question 4
A # Staff PC: browse the web
B allow outbound TCP 443
C allow outbound TCP 80
D deny outbound 23 TCP
Question 5
A web: allow inbound TCP 23
B telnet: deny inbound TCP 23
C ftp: deny inbound TCP 21

Answer Key

Firewall rule: allow or deny by port
Section A: Quick Questions
Q1
A — allow inbound TCP 443
Q2
A — Action, direction, port
Q3
B — deny inbound TCP 23
Q4
A — Traffic coming into the network from outside
Q5
B — allow outbound TCP 443
Section B: Match the Pairs
Q1
allow inbound TCP 443 → Let incoming HTTPS web traffic through the firewall on port 443
Q2
deny inbound TCP 23 → Block incoming Telnet connections on port 23
Q3
A rule that lets your computer send web requests out to the internet over HTTPS → allow outbound TCP 443
Q4
Closing an unused port by blocking incoming traffic to it, such as port 21 for FTP that nobody uses → deny inbound TCP 21
Q5
allow TCP 443 → The rule has no direction. A firewall rule must say inbound or outbound so it is clear which way the traffic travels. It should be allow inbound TCP 443.
Q6
deny inbound TCP → The rule has no port number, so it does not say which port to close. It should be something like deny inbound TCP 23.
Section C: Definitions
Q1
allow inbound TCP 443 — A firewall rule with an action (allow), a direction (inbound) and a port (TCP 443). It lets incoming web traffic through. A deny rule on a port, such as 23, blocks it.
Section D: Fill in the Blanks
Q1
allow inbound TCP 443
Q2
allow inbound TCP 443
Q3
deny inbound TCP 23
Q4
allow outbound TCP 443
Q5
deny inbound TCP 23
Section E: Spot the Error
Q1
C — A web server must accept HTTPS traffic. Port 443 should be allowed, so the line should be allow inbound TCP 443. Denying it would block every secure visitor.
Q2
B — The comment says Telnet (port 23) must be blocked. The action should be deny, so the line should be deny inbound TCP 23. Allowing it leaves an insecure port open.
Q3
A — A default of allow would leave every unused port open. The first line should be default deny inbound, so only the ports with allow rules can be used.
Q4
D — A rule is written in the order action, direction, protocol, then port number. The line should be deny outbound TCP 23, with the protocol before the port.
Q5
A — Web traffic over HTTPS uses port 443, not 23 (which is Telnet). The line should be web: allow inbound TCP 443.