Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Cyber Essentials, the five areas

After this lesson: I can check a list of devices against the five Cyber Essentials areas.

60 min lesson6 commandsJupyterLab data science lab: pandas, Matplotlib and scikit-learn in the browser

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

A contract with a condition

A council wants Lantern Print to print its leaflets, with residents' names and addresses. The contract has a condition: the printer must hold Cyber Essentials.

Lantern Print has eight devices. Are they ready?

By the end of this lesson

Note

I can check a list of devices against the five Cyber Essentials areas.

Key words

WordWhat it means
Cyber Essentialsa UK scheme for basic technical security controls
Security updatea fix from a vendor for a weakness
CVSSa 0 to 10 score of how severe a weakness is
Default passwordthe password a device ships with
Administrator accountan account that can change the system

The cells students fill in are left blank in this preview.

Starter

Have a go

Starter

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

A small set of controls, checked

Cyber Essentials is backed by the UK government. The National Cyber Security Centre sets its technical requirements. Its aim is to stop the most common attacks from the internet.

There are two levels. Cyber Essentials is a set of questions answered by the firm and checked by a certification body. Cyber Essentials Plus adds hands-on tests by an assessor. Both are renewed every year.

The five areas

AreaWhat it asks, in short
FirewallsEvery device is behind a firewall that is switched on
Secure configurationDefault passwords changed, unused software removed
Security updatesSupported software only; serious fixes within 14 days
User accessAccounts only for those who need them; admin rights used only for admin work
Malware protectionAnti-malware or only approved apps on each device

The cells students fill in are left blank in this preview.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Serious updates within 14 days

Some updates fix a serious weakness: the vendor rates them high or critical, or the weakness scores 7 or more on CVSS. They must go on within 14 days of release. An update 10 days old is not late yet.

The code below checks four updates against that rule.

Try it: which updates are late?

Code: python
patches = [(9.8, 10, False), (8.1, 20, False), (6.5, 30, False), (7.5, 30, True)]
for cvss, days, installed in patches:
    late = cvss >= 7 and days > 14 and not installed
    print(cvss, days, "days", "LATE" if late else "ok")
# Wait four more days: add 4 to every age and run again.

Make a free account to save your work and track your progress.

Check Lantern Print's devices

devices.py lists eight devices, from office PCs to the router and the till. ce.py checks each device against the five areas.

It prints the areas each one fails and whether the firm is ready to apply.

Write the device list, part 1

Command
docker exec jupyter sh -c "mkdir -p steps && printf '%s\n' 'devices = [' '    {\"name\": \"office-pc-1\", \"supported\": True, \"firewall\": True, \"default_password\": False,' '     \"daily_admin\": False, \"malware\": True, \"patches\": [(8.8, 5, True)]},' '    {\"name\": \"office-pc-2\", \"supported\": True, \"firewall\": True, \"default_password\": False,' '     \"daily_admin\": False, \"malware\": True, \"patches\": [(8.1, 20, False)]},' '    {\"name\": \"design-mac\", \"supported\": True, \"firewall\": True, \"default_password\": False,' '     \"daily_admin\": False, \"malware\": True, \"patches\": [(9.8, 10, False)]},' '    {\"name\": \"old-laptop\", \"supported\": False, \"firewall\": True, \"default_password\": False,' '     \"daily_admin\": False, \"malware\": True, \"patches\": []},' '    {\"name\": \"router\", \"supported\": True, \"firewall\": True, \"default_password\": True,' '     \"daily_admin\": False, \"malware\": True, \"patches\": []},' > steps/devices.py"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Write the device list, part 2

Command
docker exec jupyter sh -c "printf '%s\n' '    {\"name\": \"till-pc\", \"supported\": True, \"firewall\": True, \"default_password\": False,' '     \"daily_admin\": True, \"malware\": False, \"patches\": []},' '    {\"name\": \"print-server\", \"supported\": True, \"firewall\": False, \"default_password\": False,' '     \"daily_admin\": False, \"malware\": True, \"patches\": [(7.5, 30, True)]},' '    {\"name\": \"manager-phone\", \"supported\": True, \"firewall\": True, \"default_password\": False,' '     \"daily_admin\": False, \"malware\": True, \"patches\": [(6.5, 30, False)]},' ']' '' 'fixes = {' '    \"office-pc-2\": {\"patches\": [(8.1, 20, True)]},' '    \"old-laptop\": {\"supported\": True},' '    \"router\": {\"default_password\": False},' '    \"till-pc\": {\"malware\": True},' '    \"print-server\": {\"firewall\": True},' '}' >> steps/devices.py"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Write the five-area check, part 1

Command
docker exec jupyter sh -c "mkdir -p steps && printf '%s\n' 'import sys' 'from devices import devices, fixes' '' '' 'def late(patches):' '    return [p for p in patches if p[0] >= 7 and p[1] > 14 and not p[2]]' '' '' 'def fails(d):' '    found = []' '    if not d[\"firewall\"]:' '        found.append(\"firewalls\")' '    if d[\"default_password\"]:' '        found.append(\"secure configuration\")' '    if not d[\"supported\"] or late(d[\"patches\"]):' '        found.append(\"security updates\")' '    if d[\"daily_admin\"]:' '        found.append(\"user access\")' '    if not d[\"malware\"]:' '        found.append(\"malware protection\")' '    return found' '' '' 'if \"after\" in sys.argv:' '    for d in devices:' '        d.update(fixes.get(d[\"name\"], {}))' 'failing = 0' 'for d in devices:' '    found = fails(d)' '    name = d[\"name\"]' '    failing += 1 if found else 0' '    print(f\"{name:<14}\", \", \".join(found) or \"pass\")' > steps/ce.py"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Write the five-area check, part 2

Command
docker exec jupyter sh -c "printf '%s\n' 'print(\"devices that fail:\", failing, \"of\", len(devices))' 'print(\"ready to apply:\", \"yes\" if failing == 0 else \"no\")' >> steps/ce.py"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check the devices

Command
docker exec jupyter python3 steps/ce.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Fix, then check again

The owner installs the late update and replaces the old laptop. She changes the router password, adds anti-malware to the till and switches on the print server's firewall.

Run the check with after to apply those fixes.

Check after the fixes

Command
docker exec jupyter python3 steps/ce.py after

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

A common mistake

Warning

Many people think Cyber Essentials is about software you buy. The till still fails because the shop manager signs in as an administrator every day. The fix is a separate everyday account, which costs nothing. Most failures are habits and settings.

Assignment: are we ready?

Each device is a dictionary with "firewall", "default_password", "supported", "daily_admin", "malware" and "patches". A patch is (cvss, days since release, installed).

late_patches(patches) returns the late ones. fails(device) returns the failed areas in the order of the lesson's table. ready(devices) is True when nothing fails.

Code: python
def late_patches(patches):
    # Each patch is (cvss, days since release, installed). Return those rated 7 or more,
    # released over 14 days ago and not installed.
    return []


def fails(device):
    # The areas this device fails, in this order: "firewalls", "secure configuration",
    # "security updates", "user access", "malware protection".
    return []


def ready(devices):
    # True when no device fails any area.
    return False

Make a free account to save your work and track your progress.

Exit quiz

Have a go

Exit quiz

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.