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

Free lesson

ISO 27001 and the management system

After this lesson: I can check a Statement of Applicability for the gaps an auditor would find.

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 customer asks for proof

Lantern Print is a print firm with 30 staff. A large customer will only send artwork to suppliers who can show how they manage security.

Saying "we are careful" is not proof. The customer asks whether Lantern Print follows ISO 27001.

By the end of this lesson

Note

I can check a Statement of Applicability for the gaps an auditor would find.

Key words

WordWhat it means
Governancehow leaders direct and check security
ISMSan information security management system: the way a firm runs security
Controla measure that lowers a risk
Statement of Applicabilitythe list of controls, whether each applies and why
Certificationan outside body checking a firm against a standard

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

ISO 27001 describes a management system

ISO/IEC 27001 is an international standard. It does not list products to buy. It says how a firm should run security as a cycle: plan, do, check, act.

Leaders set the scope and the policy. The firm assesses its risks and chooses controls. It measures, audits itself, and improves. The current edition is from 2022.

Try it: group controls by theme

Code: python
controls = {
    "Backups tested": "technological",
    "Staff training": "people",
    "Locked cupboard": "physical",
    "Supplier checks": "organisational",
    "Two-step sign-in": "technological",
}
themes = {}
for name, theme in controls.items():
    themes[theme] = themes.get(theme, 0) + 1
print(themes)
# Add "Visitor badges" as a physical control, then press Run again.

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

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

Controls come from risks, not a checklist

The standard has an annex of 93 controls in four themes: organisational, people, physical and technological. A firm does not simply tick them all.

It picks the controls its risks need. The Statement of Applicability records each control, whether it applies, the reason, and whether it is in place. Auditors read it closely.

Lantern Print's first draft

controls.py holds twelve controls in our own words, six risks, and a decision for each control. soa.py prints the statement and lists any problem an auditor would raise.

Write both files, then run the check.

Write the controls and risks, part 1

Command
docker exec jupyter sh -c "mkdir -p steps && printf '%s\n' 'controls = [' '    (\"L01\", \"organisational\", \"Security policy approved by the directors\"),' '    (\"L02\", \"organisational\", \"Asset list kept up to date\"),' '    (\"L03\", \"organisational\", \"Suppliers checked before a contract\"),' '    (\"L04\", \"organisational\", \"Incident plan written and tested\"),' '    (\"L05\", \"people\", \"Security training for all staff\"),' '    (\"L06\", \"people\", \"Checks before somebody is hired\"),' '    (\"L07\", \"physical\", \"Server cupboard kept locked\"),' '    (\"L08\", \"physical\", \"Clear desks, sticks locked away\"),' '    (\"L09\", \"technological\", \"Two-step sign-in for email\"),' '    (\"L10\", \"technological\", \"Backups kept offline and tested\"),' '    (\"L11\", \"technological\", \"Security updates within 14 days\"),' '    (\"L12\", \"technological\", \"Secure software development\"),' ']' '' 'risks = {' > steps/controls.py"

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

Write the controls and risks, part 2

Command
docker exec jupyter sh -c "printf '%s\n' '    \"R1\": \"Phishing steals a mailbox\",' '    \"R2\": \"An old laptop is attacked\",' '    \"R3\": \"Ransomware stops the presses\",' '    \"R4\": \"A supplier leaks customer files\",' '    \"R5\": \"The server is stolen\",' '    \"R6\": \"A USB stick of artwork is lost\",' '}' '' 'decisions = {' '    \"L01\": (True, \"\", [\"R1\", \"R2\", \"R3\"]),' '    \"L02\": (True, \"\", [\"R2\"]),' '    \"L03\": (True, \"\", [\"R4\"]),' '    \"L04\": (True, \"\", []),' '    \"L05\": (True, \"\", [\"R1\"]),' '    \"L06\": (False, \"new staff work beside a supervisor\", []),' '    \"L07\": (True, \"\", [\"R5\"]),' '    \"L08\": (False, \"\", []),' '    \"L09\": (True, \"\", [\"R1\"]),' '    \"L10\": (True, \"\", [\"R3\"]),' '    \"L11\": (True, \"\", [\"R2\"]),' '    \"L12\": (False, \"Lantern Print writes no software\", []),' '}' '' 'fixes = {' '    \"L04\": (True, \"\", [\"R3\"]),' '    \"L08\": (True, \"\", [\"R6\"]),' '}' >> steps/controls.py"

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

Write the statement check, part 1

Command
docker exec jupyter sh -c "mkdir -p steps && printf '%s\n' 'import sys' 'from controls import controls, decisions, fixes, risks' '' 'if \"fixed\" in sys.argv:' '    decisions.update(fixes)' '' 'print(\"Statement of Applicability, Lantern Print\")' 'themes = {}' 'problems = []' 'treated = set()' 'for cid, theme, name in controls:' '    applies, reason, linked = decisions[cid]' '    themes[theme] = themes.get(theme, 0) + 1' '    treated.update(linked)' '    if applies:' '        print(f\"{cid}  {theme:<15} applies   {name}  (risks {len(linked)})\")' '        if not linked:' '            problems.append(f\"{cid} applies but treats no risk\")' '    else:' '        why = reason or \"NO REASON GIVEN\"' '        print(f\"{cid}  {theme:<15} excluded  {name}  ({why})\")' '        if not reason:' '            problems.append(f\"{cid} is excluded with no reason\")' 'for rid in sorted(risks):' '    if rid not in treated:' > steps/soa.py"

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

Write the statement check, part 2

Command
docker exec jupyter sh -c "printf '%s\n' '        problems.append(f\"{rid} has no control: {risks[rid]}\")' 'print(\"controls by theme:\", \", \".join(f\"{t} {n}\" for t, n in themes.items()))' 'print(\"applies:\", sum(1 for c in decisions.values() if c[0]), \"of\", len(controls))' 'print(\"problems to fix before the audit:\", len(problems))' 'for line in problems:' '    print(\"  \" + line)' >> steps/soa.py"

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

Print the Statement of Applicability

Command
docker exec jupyter python3 steps/soa.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 the gaps, then check again

The fixes are small but real. The incident plan now treats the ransomware risk. The clear desk control now covers the lost USB stick, so it applies.

Run the check with fixed to apply both changes.

Check the fixed statement

Command
docker exec jupyter python3 steps/soa.py fixed

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

A common mistake

Warning

Many people think ISO 27001 means applying every control in the annex. A control applies only when a risk needs it. Leaving one out is fine if the reason is written down, as L12 shows: a firm that writes no software needs no secure development control.

What certification is, and is not

A firm can be certified by an accredited body after an outside audit. A certificate covers a stated scope, such as one office. It is checked every year.

A certificate shows a working system, not that nothing can go wrong. This module explains the frameworks so you can use them. It is not a course towards any certificate.

Assignment: review a statement

Review a Statement of Applicability in code. Each row is a dictionary with "id", "theme", "applies", "reason" and "risks".

by_theme(soa) counts the rows in each theme. missing_reasons(soa) returns the ids left out with no reason, sorted. untreated(soa, risks) returns the risks no applied row lists, sorted.

Code: python
def by_theme(soa):
    # A dictionary of each theme and how many rows have it.
    return {}


def missing_reasons(soa):
    # The ids of rows that do not apply and give no reason (blank counts as none), sorted.
    return []


def untreated(soa, risks):
    # The risk ids that no applied row lists, sorted.
    return []

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.