The Academy

Loading the search index…

Searches the academy on this device only.

Threat modelling and secure configuration

Learn a simple method for asking what you are protecting, who or what could harm it and what you will do about it, then apply it to a small home or shop setup and tighten its settings.

30 minintermediatePractical task needs a laptop or desktop

Marking a lesson as read does not prove you can do it. Skills count as demonstrated when you pass the quiz (not yet) and complete the practical tasks (not yet).

By the end of this lesson you will be able to

  • List the assets in a small setup and say why each matters.
  • Describe likely threats to each asset and rate the risk in simple words.
  • Choose mitigations that match the biggest risks.
  • Explain defence in depth and secure defaults, and use them to harden a device.
  • Write a one-page threat model for a home or small shop.

Security can feel like an endless list of warnings. Professionals handle it by asking three plain questions: what am I protecting, what could go wrong, and what will I do about it? Answering them in order is called threat modelling, and you can do it on one sheet of paper. It stops you from spending effort on unlikely dangers while the obvious ones stay open. This lesson teaches the method and then the practical habit of changing risky default settings.

Thinking like a defender

Cybersecurity is the work of protecting computers, accounts and data from harm. There is no such thing as perfect security. The aim is to make harm unlikely enough, and small enough, that you can live with what is left. A bank vault and a garden shed need different locks. The sensible question is never how do I make everything impossible to attack, but what matters here and how much protection does it deserve.

Earlier lessons named a Threat as something that could cause harm, a Vulnerability as a weakness it could use, and a Risk as the chance and size of the harm. Threat modelling puts those three words to work in a fixed order.

The four questions of a threat model

A Threat model is a short written answer to four questions. Write it for a small system you know well, such as your home laptop and phone, or Joseph's shop with its till laptop and Wi-Fi.

Diagram

The four questions of a simple threat model.

  1. Step 1: AssetsWhat are we protecting?
  2. Step 2: ThreatsWhat can go wrong?
  3. Step 3: MitigationsWhat will we do?
  4. Step 4: ReviewDid it work?
The four questions of a simple threat model.
Read this figure as text

A flow of four questions: what are we protecting, what can go wrong, what will we do, did it work.

A flow of four steps. 1 What are we protecting? List the assets. 2 What can go wrong? List the threats and rank the risk. 3 What will we do about it? Choose mitigations. 4 Did it work? Check, test and review. After step 4 you return to step 1 when something changes, for example a new device.

Step 1: assets

An Asset is anything of value that you want to protect. It may be data (customer orders, family photos), an account (email, bank), a device (the till laptop) or a service (the shop's Wi-Fi). Also note the property that matters most: confidentiality (only the right people can see it), integrity (it has not been altered) or availability (it is there when you need it). Photos need availability and confidentiality. A price list needs integrity.

Step 2: threats and risk

For each asset, list what could harm it. Include non-criminal causes: a dropped laptop, a flat battery and a spilt drink are all more common than a hacker. Then give each threat a rough rating for how likely it is and how bad the harm would be: low, medium or high. Multiply them in your head. A likely threat with a bad outcome is a high risk and goes to the top of the list.

Part of a threat model for Joseph's shop (fictional)
AssetThreatLikelihoodHarmRisk
Order spreadsheetLaptop fails or is lost, with no backupMediumHighHigh
Shop email accountPhishing message steals the passwordHighHighHigh
Shop Wi-FiNeighbour guesses the router's default passwordMediumMediumMedium
Till laptopVisitor plugs in an unknown USB driveLowHighMedium

Step 3: mitigations

A mitigation is an action that lowers a risk. Start with the high risks. For the order spreadsheet the mitigation is a tested backup. For the email account it is a strong unique password in a Password manager plus Multifactor authentication (MFA). For Wi-Fi it is changing the router's default password. Choose cheap, boring fixes first. They remove most of the risk for very little effort.

Diagram

Likely and harmful threats are dealt with first.

High riskLikely and harmful
  • Phishing steals email password
  • No backup of orders

Act now

Medium riskOne of the two
  • Default Wi-Fi password
  • Unknown USB drive

Act this month

Low riskUnlikely and mild
  • Rare, small annoyance

Accept or review later

Likely and harmful threats are dealt with first.
Read this figure as text

Three columns for high, medium and low risk, with an action for each.

Three columns ordered by priority. High risk: likely and harmful, for example a phishing email that steals the shop's email password; act now with multifactor authentication and training. Medium risk: either likely or harmful but not both, for example the default Wi-Fi password; act this month. Low risk: unlikely and mild; accept it or review later. The point is to spend effort in the order of risk, not in the order of fear.

Defence in depth: more than one lock

No single protection is perfect, so good security uses several, one behind another. This is Defence in depth. A house has a fence, a locked door and a safe. If a thief gets past the fence, the door is still there. For an email account the layers are a strong password, multifactor authentication, a phishing-aware owner, recovery codes kept safe and a way to notice strange activity. Each layer catches what the one before it missed.

Diagram

Layers of protection around the thing that matters.

Outside

PeopleSpot scams, ask first
AccountsUnique passwords and MFA
DevicesUpdated, locked
NetworkRouter password, firewall
DataEncrypted, backed up
Layers of protection around the thing that matters.
Read this figure as text

A stack of five protective layers from the person down to the data, each backed up by the next.

A stack of layers from outside to inside. People: trained to spot scams. Accounts: strong unique passwords and multifactor authentication. Devices: updated, with a screen lock. Network: router with a changed password and a firewall on. Data: encrypted where possible and backed up. If one layer fails, the next still protects the data.

Secure configuration and default settings

Many break-ins need no clever trick, only a setting that was left as it came. A Secure default is a setting that is safe from the start. Devices do not always ship that way. Routers may use a well-known administrator password printed on the label, programs may start with sharing turned on, and old accounts may still exist. Changing risky settings to safe ones is called hardening, and it reduces the Attack surface: the number of places where something could go wrong. Fewer open doors means fewer doors to guard.

A short hardening checklist
SettingWhyWhere to find it
Change the router's administrator password and Wi-Fi passwordDefault passwords are widely known, and the label can be read by anyone who enters the roomThe router's settings page, reached through the address in its manual
Turn on automatic updatesKnown weaknesses are fixed quicklySoftware Updater on Ubuntu; Windows Update on Windows
Turn on the firewallIt blocks unwanted incoming connectionsWindows Security on Windows; on Ubuntu the firewall called ufw is installed but off by default
Set a screen lock with a short timeoutA walk-away laptop is an open doorSettings: Privacy and Security (Ubuntu: Screen Lock; Windows: Accounts, Sign-in options)
Remove software and accounts you no longer useUnused things still need updates and can be attackedApp Center or Installed apps; the account audit from the last module
Turn off sharing you do not needShared folders and remote access widen the attack surfaceSettings: Sharing (Ubuntu); Settings: Network and internet, Advanced sharing settings (Windows)

Check a few secure settings on your computer

These steps only look. Change a setting only if you understand it.

In Ubuntu 24.04 open Settings, then Privacy and Security, then Screen Lock to set a lock delay. The command ss -tuln lists the network ports on which your computer is listening for incoming connections. Each listening port is part of the attack surface. A typical desktop has few.

Terminal (Linux) · you can run this on your own computer
ss -tuln
Text
Netid State  Recv-Q Send-Q Local Address:Port Peer Address:Port
udp   UNCONN 0      0      127.0.0.53%lo:53    0.0.0.0:*
tcp   LISTEN 0      4096   127.0.0.53%lo:53    0.0.0.0:*
Example output (yours will differ)

Addresses starting with 127. are the computer talking to itself, so they are not open to the network. An address of 0.0.0.0 or * means the port accepts connections from outside, which is worth understanding before you leave it open.

Simulated interface: not a real screenshot

A simulated settings page with three secure choices to check.

Security checklist

Firewall: on

Automatic updates: on

Screen lock after 5 minutes

Review later
  1. Marker 1: Blocks unwanted incoming connections
  2. Marker 2: Fixes known weaknesses
  3. Marker 3: Protects an unattended laptop
A simulated settings page with three secure choices to check.
Read this figure as text

A simulated settings window with firewall, automatic updates and screen lock choices marked by numbers.

A simulated settings window titled Security checklist. The body lists three rows: Firewall is on, Automatic updates are on, Screen lock after 5 minutes. Marker 1 is on the firewall row: blocks unwanted incoming connections. Marker 2 is on the updates row: fixes known weaknesses. Marker 3 is on the screen lock row: protects a laptop left unattended. A button reads Review later. This is a generic mock-up, not a real screenshot.

Common mistakes

  • ✖ Instead of: Trying to protect everything equally.

    ✔ Do this: List your assets, rank the risks and fix the high ones first. Effort spent on a low risk leaves a high risk open.

  • ✖ Instead of: Only thinking about hackers.

    ✔ Do this: Include accidents, loss, theft and failure. They are more common and often cause worse harm than an attack.

  • ✖ Instead of: Leaving default settings and passwords as they came.

    ✔ Do this: Check what the device ships with and change risky defaults, then write down what you changed.

  • ✖ Instead of: Turning off the firewall or antivirus to make a program work.

    ✔ Do this: Find out why it is blocked and allow only what you trust. Switching protection off removes a whole layer.

If something goes wrong

I cannot think of any threats.
Ask what happens if the device is lost, broken, stolen, or if someone gets the password. Then ask what happens if the account is locked, the internet is down or the file is changed by mistake.
ss -tuln shows many lines and I do not know what they mean.
Focus on the Local Address column. Addresses beginning with 127 are internal only. Search for the port number together with the word port before you worry or change anything.
Get-NetTCPConnection is not recognised.
Use Windows PowerShell or PowerShell on Windows 11, not Command Prompt. In Command Prompt, netstat -an shows a similar list.
A setting I changed stopped something working.
Return the setting to the value you wrote down, restart, and then look up the setting before trying again.

Key terms

Threat model
A short written analysis of what you protect, what could go wrong and what you will do about it.
Asset
Anything you want to protect because it has value, such as data, a device or an account.
Attack surface
All the places where someone could try to get into a system, such as open services, accounts and ports.
Secure default
A setting that starts in the safe position, so no one has to remember to make it safe.
Defence in depth
Using several layers of protection so that if one fails, the others still help.
Threat
Something or someone that could cause harm to you or your data.

Practise it for real

Reading is not the same as being able to do it. Complete these on your own computer, then tick only what you have actually done. These ticks are your own honest record: nothing checks them for you.

Guided exercise

Write a threat model for your own setup

On paper or in a document, make a table with columns Asset, Threat, Likelihood, Harm and Risk. List at least four assets that you really have, such as your email account, your photos, your laptop and your Wi-Fi. For each, write one threat, rate likelihood and harm as low, medium or high, and give the risk. Then choose one mitigation for each of the two highest risks and put a date next to each to do it.

You have succeeded when:
Guided exerciseNeeds a laptop or desktop

Check three secure settings

On your real computer, check three settings from the hardening table: that updates are automatic, that the firewall is on (Windows Security on Windows, or note that ufw is off by default on Ubuntu) and that your screen locks after a short idle time. Run the listening-ports command and note how many ports are listening and which are open to the network. Record the result of each check as yes or no. Change only a setting that you understand.

You have succeeded when:
Independent challenge

Challenge: model a new situation

Wanjiru is setting up a small tutoring business from her bedroom. She has a laptop, a phone, a shared email address, a router from her internet provider and a folder of pupils' contact details. Without looking at the lesson, answer the four questions for her: list the assets and the property that matters most for each, three threats with a risk rating, a mitigation for each high risk and how and when she will review the plan.

You have succeeded when:

Knowledge check

6 questions. You need 80% to pass. Mistakes here are part of learning, and you can retry as often as you like.

  1. Question 1.Put the four questions of a threat model in order.
    1. Did it work?
    2. What can go wrong?
    3. What will we do about it?
    4. What are we protecting?
  2. Question 2.Which threat should go to the top of the list?
  3. Question 3.Joseph's order spreadsheet is on one laptop with no copy anywhere else. The laptop is old and sometimes will not start.Which mitigation addresses the biggest risk best?
  4. Question 4.Match each term to its meaning.
  5. Question 5.If you use multifactor authentication on an account, it is safe to use the same weak password everywhere else.
  6. Question 6.Why should you change the administrator password on a new router?

Summary

  • A threat model asks four questions: what am I protecting, what can go wrong, what will I do and did it work.
  • Risk is likelihood together with harm. Fix the highest risks first.
  • Defence in depth uses several layers so one failure does not expose everything.
  • Secure defaults and hardening reduce the attack surface.
  • Write down every change so that it can be reviewed and undone.

Checklist: can you do these?

Marking a lesson as read does not prove you can do it. Skills count as demonstrated when you pass the quiz (not yet) and complete the practical tasks (not yet).

Related lessons

References and further reading

Official sources for details that can change between versions.

On this page