Syllabus Module 12 · Network protection
NSW 3011 / 32
Software Engineering with Language Models

Module 12 · Network protection

Class time
60 minutes
Slides
32, each with teacher’s notes
Goes with
Laboratory 7; Assignment 6 (Part IV)
Module 122 / 32

Where this module sits

  • In Module 11 you audited one device by capturing its traffic on a controlled network.
  • Module 12 is about the whole network.
  • The aim is to limit what a compromised device or account can reach.
  • You verify the design by observation.
  • Module 13 is about the application and the agent deployment.
Module 123 / 32

Objectives

  • Derive a threat model from three facts about devices, exposure and credentials.
  • Segment a network and prove from inside the segment that the segmentation holds.
  • Deploy a filtering resolver, close the bypass and read its log.
  • Describe a server that accepts no inbound connections, and say what that design leaves undone.
  • Authenticate every request and authorise each identity for what it needs.
  • State which channels an isolation claim considered.
Module 124 / 32

Agenda

  • 4 min: where this sits, objectives
  • 10 min: threat model and the economics (12.1)
  • 11 min: segmentation (12.2)
  • 14 min: name-resolution filtering and outbound monitoring (12.3, 12.4)
  • 13 min: no open ports, identity, residual channels (12.5 to 12.7)
  • 8 min: mistakes, hand-ins, recap
Module 125 / 32

Three facts for the threat model

  • Consumer devices are computers with sensors.
  • Consumer devices are rarely patched, and they report to their makers.
  • Scanners find anything that listens on a public address within minutes.
  • Search engines index exposed cameras, storage boxes and printers, and many of these devices still have default passwords.
  • A stolen or phished credential grants whatever that identity is allowed to do.
Module 126 / 32

The economics behind the first fact

  • Between 2000 and 2022 the price of a television fell by about 97 per cent.
  • One maker reported a quarterly loss of $6.7 million on devices.
  • In the same quarter, advertising and data earned it $115.8 million in profit.
  • The device is the collection point.
  • A device can use the sensors of whatever is attached to it.
Module 127 / 32

Worked example: reading the maker's accounts

  1. A set priced at 1,000 units in 2000 would cost about 30 units in 2022.
  2. The maker lost $6.7 million on devices in one quarter.
  3. It made a profit of $115.8 million on advertising and data in that quarter.
  4. The profit is about 17 times the loss.
  5. The net of the two lines is $109.1 million.
  6. The module's reading is that the device is the collection point.
Module 128 / 32

Four boundaries that limit reach

BoundaryWhat it limitsSection
Network segmentWhich machines a device can contact12.2
Name resolutionWhich names a device can look up12.3
Exposed portsWhat answers on a public address12.5
IdentityWhat one account can see and do12.6
Module 129 / 32

The segmentation design

  • Televisions, cameras, speakers and appliances go on a separate network.
  • The separate network can be the guest or IoT network of a router, or a VLAN.
  • The separate network cannot initiate connections to laptops, phones and storage.
  • The reasoning is containment.
  • A compromised device sees only its neighbours.
Module 1210 / 32

Two segments and the rule between them

            router
           /      \
  trusted          untrusted
  laptop           television
  phone            camera
  storage          speaker

  untrusted --X--> trusted
  (may not initiate)
Module 1211 / 32

Worked example: proving the segment holds

  1. Before any change, scan the trusted devices from the television's position. Save the output.
  2. Move the untrusted devices to their own segment.
  3. Add the rule that the untrusted segment may not initiate connections to the trusted segment.
  4. Repeat the same scan from inside the untrusted segment.
  5. The expected result is that no trusted host answers.
  6. Hand in both outputs.
Module 1212 / 32

In-class exercise: a segment for each device

  • The devices are a laptop, a phone, a storage box, a television, a camera, a speaker and a printer.
  • Assign each device to the trusted or the untrusted segment.
  • State which segment may initiate connections to the other.
  • Write the test that proves the design.
  • Name the device that is hardest to place, and say why.
Module 1213 / 32

The reason to filter at name resolution

  • Most device telemetry begins with a DNS lookup.
  • One filtering resolver that serves the whole network blocks the telemetry at the lookup.
  • The resolver covers devices on which nothing can be installed.
  • The resolver can be hosted or self-hosted.
Module 1214 / 32

Five steps for filtering at name resolution

  1. Choose a filtering resolver, hosted or self-hosted.
  2. Enable a maintained blocklist, plus vendor tracking lists for the makers you own.
  3. Point the router at it over an encrypted transport where supported.
  4. Block outbound port 53 to everything except the router.
  5. Read the query log.
Module 1215 / 32

The bypass and the rule that closes it

normal path
 device -> router -> filtering
                     resolver

bypass
 device --port 53--> own resolver
            X
 blocked: outbound 53 is allowed
 only to the router
Module 1216 / 32

Worked example: reading the query log

blocked name    device      count
ads-name-1      television  4,120
stats-name-2    television  1,870
track-name-3    speaker       310
update-name-4   camera         12

48 hours of log, toy figures
Module 1217 / 32

Ask the room: lookups missing from the query log

  • A filtering resolver has run for a week.
  • One television's lookups never appear in the resolver's query log.
  • The television still plays streamed programmes.
  • Give the likeliest explanation.
  • Name the rule that closes the gap, and say how to confirm it.
Module 1218 / 32

Turning collection off at the source

  • The setting has a different name on each brand of television.
  • The names in use are viewing information services, live plus, viewing data and use info from TV inputs.
  • The published audit confirms that opting out stops the traffic.
  • Opt out of interest-based advertising and reset the advertising identifier.
  • Disable voice recognition.
  • Remove unused applications.
Module 1219 / 32

Traffic monitoring

  • On a workstation, a per-application outbound monitor shows which programs connect out.
  • The monitor also shows how often each program connects and how much it sends.
  • Unexpected chatter is a reason to uninstall.
  • On a server, every inbound connection attempt is logged.
  • An attempt from outside the expected set raises an alert.
  • You can audit any device behind a network you control, as in Module 11.
Module 1220 / 32

A server with no open ports

  • Administrative access runs only over a private mesh network.
  • SSH listens on the mesh address and nowhere else.
  • Public traffic enters through an outbound tunnel that ends at a content network's reverse proxy.
  • The server accepts no inbound connections.
  • The firewall closes every inbound port on the public address.
Module 1221 / 32

Diagram of a server with no open ports

scanner --X--> public address
               (all ports closed)

server == outbound tunnel ==> proxy
visitor ------------------> proxy

admin -- mesh --> SSH on the
                  mesh address
Module 1222 / 32

Worked example: closing the ports in order

  1. At the start, SSH and a web port answer on the public address.
  2. Join the server to the mesh and confirm that SSH works over the mesh address.
  3. Set the SSH daemon to listen on the mesh address alone.
  4. Route public traffic through the outbound tunnel and confirm that the site loads.
  5. Close every inbound port on the public address at the firewall.
  6. Scan the public address from outside and confirm that nothing answers.
Module 1223 / 32

The remaining needs of a closed server

  • Closing the ports removes scanning exposure.
  • Closing the ports also removes brute-force exposure.
  • The server still needs patching.
  • The application still needs securing.
  • The server still needs backups that have been restored at least once.
Module 1224 / 32

Segmentation by identity

  • Network location is a weak basis for trust.
  • Every request is authenticated.
  • Each identity is authorised only for the pages, functions and endpoints it needs.
  • An intruder with a valid account sees only that one account's slice.
  • When abuse is detected, that account is suspended automatically.
  • The damage is limited to one identity.
Module 1225 / 32

Address allowlists and their replacement

  • Functions are usually exposed to another organisation through an IP allowlist.
  • The module calls the method brittle.
  • An allowlist breaks with remote work.
  • An allowlist breaks with shared egress addresses.
  • The durable alternative is identity-based access.
  • Identity-based access uses credentials that are short-lived and bound to a device or key.
Module 1226 / 32

Ask the room: one phished account

  • An attacker holds one phished account for an internal service.
  • Design A trusts any request from inside the network in full.
  • Design B authenticates every request and authorises it per identity.
  • State what the attacker can reach under each design.
  • State what ends the intrusion under design B.
Module 1227 / 32

Residual channels

  • Removing shared files and network links leaves other paths between isolated processes.
  • A timing side channel carries a signal in how long a shared resource takes to respond.
  • A cache is one such shared resource.
  • One second-hand, unverified report describes agents exchanging information this way.
  • The mechanism is well established.
  • An isolation claim for a multi-agent system names the channels it considered.
Module 1228 / 32

Common mistakes

  • Writing a rule and not testing it. Fix: scan from inside the untrusted segment.
  • Filtering DNS and leaving outbound port 53 open. Fix: allow that port only to the router.
  • Never reading the query log. Fix: review the log, and allow the names that break updates.
  • Treating no open ports as secure. Fix: patch the server, secure the application and restore a backup.
  • Trusting by network location or address allowlist. Fix: authenticate and authorise each identity.
  • Repeating unverified reports as fact. Fix: label them, and test them where possible.
Module 1229 / 32

Laboratory 7: what is due

  • (a) An inventory of every device, with its maker and its purpose.
  • (b) Untrusted devices moved to a separate segment, with proof that the trusted segment is unreachable.
  • (c) A filtering resolver deployed, and outbound port 53 blocked.
  • After 48 hours, report the ten most frequent blocked names and the device that asked for each.
  • (d) A scan of your public address from outside, accounting for every open port.
  • Hand in the before and the after for a network you administer.
Module 1230 / 32

Assignment 6 · A search engine served securely: what is due

  • A search engine for a few hundred text files that are yours to use.
  • Step 3 belongs to this module and puts the engine behind a small web server.
  • The server is bound to the local machine only.
  • From outside, the server is reached by tunnel or private network, and no inbound port is opened.
  • Query length and request rate are limited.
  • A query is data and never enters a shell command, file path or prompt.
Module 1231 / 32

Recap

  • The threat model is unpatched devices that report home, constant scanning and stolen credentials.
  • Protection means limiting reach by segment, name resolution, exposed ports and identity.
  • A rule counts once it has been tested from the side it is meant to stop.
  • Filter DNS for the whole network, block outbound port 53 and read the log.
  • Closing every port removes scanning and brute-force exposure and nothing else.
  • An isolation claim names the channels it considered.
Module 1232 / 32

Before next class

  • Start Laboratory 7 part (c) at once, because the report needs 48 hours of log.
  • Take the "before" scans from inside the device network and from outside.
  • Do step 3 of Assignment 6.
  • Read Module 13 on cyber security for builders and their agents.
  • For Laboratory 8, choose an application you built and create a second account on it.