How a proxy server keeps data safe

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

How a proxy server keeps data safe

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A school proxy server blocks a website known to host malware. What does this protect users from?
A Visiting an unsafe site and downloading harmful files
B Having their passwords guessed by a brute-force attack
2. Which statement about a proxy server and the user's IP address is correct?
A The website sees the proxy's IP address, not the user's
B The website always sees the user's real IP address
3. Where does a proxy server sit?
A Inside the website's database
B Between the user's device and the internet
4. A proxy server checks a response from a website and finds malware in it. What does it do?
A Passes it on, because responses are never checked
B Blocks the response so it never reaches the user
5. A proxy server keeps a copy of a popular web page. What is this called and why is it useful?
A Caching, because the page loads faster next time
B Encrypting, because the page is turned into ciphertext

Match the Pairs

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

Left columnRight column
1proxy server AA server between the user and the internet that filters requests and responses to keep the user safe
2proxy.cache(page) Brequest.source_ip = proxy.ip
3A proxy server hides the user's IP address by sending the request using its own address CStores a copy of a web page so it loads faster next time it is requested
4A proxy server blocks unsafe websites by checking each request against a list of banned sites DThe proxy passes on the user's real IP address, so it does not hide the user. It should send its own IP address.
5proxy.forward(user.ip, request) # shows real IP Eif site in blocklist: deny(request)
6if response has malware: allow(response) FThe proxy allows a response containing malware. It should block or discard that response before it reaches the user.

Definitions

proxy server

Fill in the Blanks

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

1.
IF site IN blocklist THEN _____(site)
2.
// Hide the user's IP address request.ip ← _______
3.
result ← ____(response) IF result = "infected" THEN DISCARD
4.
IF page __ cache THEN RETURN cache[page] ENDIF
5.
IF site IN safelist THEN _______(request) ENDIF

Spot the Error

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

Question 1
A INPUT url
B IF url IN blocklist THEN
C FORWARD request
D ELSE
E FORWARD request
F ENDIF
Question 2
A RECEIVE request FROM user
B request.ip ← proxy.ip
C SEND request TO proxy.ip
Question 3
A RECEIVE url FROM user
B IF url IN cache THEN
C BLOCK url
D ELSE
E FETCH url
F ENDIF
Question 4
A IF url NOT IN cache THEN
B page ← cache[url]
C ELSE
D page ← FETCH(url)
E cache[url] ← page
F ENDIF
Question 5
A RECEIVE request FROM user
B safe ← CHECK(request)
C IF safe = TRUE THEN
D BLOCK request
E ENDIF

Answer Key

How a proxy server keeps data safe
Section A: Quick Questions
Q1
A — Visiting an unsafe site and downloading harmful files
Q2
A — The website sees the proxy's IP address, not the user's
Q3
B — Between the user's device and the internet
Q4
B — Blocks the response so it never reaches the user
Q5
A — Caching, because the page loads faster next time
Section B: Match the Pairs
Q1
proxy server → A server between the user and the internet that filters requests and responses to keep the user safe
Q2
proxy.cache(page) → Stores a copy of a web page so it loads faster next time it is requested
Q3
A proxy server hides the user's IP address by sending the request using its own address → request.source_ip = proxy.ip
Q4
A proxy server blocks unsafe websites by checking each request against a list of banned sites → if site in blocklist: deny(request)
Q5
proxy.forward(user.ip, request) # shows real IP → The proxy passes on the user's real IP address, so it does not hide the user. It should send its own IP address.
Q6
if response has malware: allow(response) → The proxy allows a response containing malware. It should block or discard that response before it reaches the user.
Section C: Definitions
Q1
proxy server — A server between a user and the internet that filters requests, blocks unsafe sites, hides the user's IP address, checks responses for malware and caches pages for speed.
Section D: Fill in the Blanks
Q1
IF site IN blocklist THEN BLOCK(site)
Q2
// Hide the user's IP address request.ip ← proxyIP
Q3
result ← SCAN(response) IF result = "infected" THEN DISCARD
Q4
IF page IN cache THEN RETURN cache[page] ENDIF
Q5
IF site IN safelist THEN FORWARD(request) ENDIF
Section E: Spot the Error
Q1
C — A proxy server must block a request for a site on the blocklist. Line 3 forwards it, so the unsafe site is reached. It should be BLOCK request.
Q2
C — The proxy swaps in its own IP address, then must send the request on to the website. Sending it to proxy.ip sends it back to itself. It should be SEND request TO website.
Q3
B — To block unsafe sites the proxy must check the URL against the blocklist, not the cache. Line 2 should be IF url IN blocklist THEN.
Q4
A — The proxy should use the cached copy only when the page IS already in the cache. NOT makes the logic backwards. It should be IF url IN cache THEN.
Q5
D — When the request passes the check (safe = TRUE) the proxy should forward it to the website. Blocking it stops safe requests. It should be FORWARD request.