Lesson 02 · 35 minutes
Map your records to the structure of ISO/IEC 27001
- Describe an information security management system and the parts of ISO/IEC 27001
- Say what a certificate covers and how ISO/IEC 27002 relates to it
- Check a map from the clauses to your own records with a program
The lab folder as it stands after this lesson. Unzip it in ~/krlab.
More
The zip holds every file that the course has printed up to here. To start this lesson with the files of the earlier lessons only, take the zip of the lesson before. Type the code yourself first: you learn more.
Scenario
The school network likes the policy set of Brindle Books and asks the next question: "Are you certified to ISO/IEC 27001, or do you work to it?" Asha has heard the number and nothing more. She asks Carys for a one-page answer: what the standard wants, what the company already has, and what is still to build. You make that page as a file that a program checks, so that it stays true as the work goes on.
Recall
Lesson 1: what is the difference between a standard and a procedure in a policy set?
A standard states an exact requirement that can be tested ("administrator accounts use a second factor"). A procedure gives the steps and who does each one. The procedure serves the standard, and the standard serves the policy.
Lesson 1: which four things does an auditor ask about a rule?
Show me the rule, show me who approved it, show me that it is current, and show me that people follow it. The document register answers the first three. Evidence answers the fourth.
The idea
An information security management system (ISMS) is not a product. It is the way an organisation runs its security as a repeating loop: decide what to protect, assess the risks, choose and run controls, check the results, and correct what failed. The loop needs records, and each record needs an owner and a date.
ISO/IEC 27001 is the international standard that states the requirements for an ISMS. ISO and IEC publish it. The current edition is ISO/IEC 27001:2022, published in October 2022. The standard is sold by ISO and its text is copyrighted, so this course does not quote it. It names the parts and describes them in its own words. The standard itself is the source: read the current edition, and any amendment, before you claim to follow it.
One amendment exists: Amendment 1, "Climate action changes", published in February 2024. It asks you to decide whether climate change is a relevant issue (clause 4.1) and notes that interested parties may have climate-related requirements (clause 4.2). The older ISO/IEC 27001:2013 had 114 controls, and certification bodies announced that certificates to it ended by 31 October 2025, so an old guide may describe the wrong edition. Take the exact words and dates from the standard and from your certification body.
The requirements are in seven clauses, numbered 4 to 10. Clauses 1 to 3 hold the scope of the standard, references and terms.
| Clause | Name | In plain words | Your record in this course |
|---|---|---|---|
| 4 | Context of the organisation | Who you are, who expects what of you, and what the ISMS covers | Scope (lesson 3) |
| 5 | Leadership | Top management commits, sets the policy and gives the roles | Policy (lesson 1) |
| 6 | Planning | Assess the risks, plan the treatment, set objectives | Inventory, risk register, statement of applicability (lessons 3 to 5) |
| 7 | Support | People, skills, awareness, communication, controlled documents | Document register (lesson 1), competence and awareness records (lesson 14) |
| 8 | Operation | Do what you planned, and keep the proof | Evidence, access reviews, changes, suppliers, restore tests (lessons 6 to 10) |
| 9 | Performance evaluation | Measure, audit internally, review with management | Audit findings and metrics (lessons 11 and 13), management review (lesson 15) |
| 10 | Improvement | Correct what failed and get better | Corrective actions (lesson 11) |
ISO spells the name of clause 4 with a z ("organization"). This course writes British English.
The clauses follow the loop plan, do, check, act: clauses 4 to 7 plan, clause 8 does, clause 9 checks, clause 10 acts. ISO/IEC 42001, the standard for AI management systems, draws the same loop.
Clause 7 also asks for competence and awareness: records that show people have the skills that they need and know the policy. Clause 9 also asks for the management review: a record of what top management considered, decided and assigned. Lesson 14 builds the first and lesson 15 the second, and the rows of the map below that say 14 or 15 are their files.
Annex A of the standard is a reference list of 93 information security controls in four themes. The numbers of the controls start with 5, 6, 7 and 8.
| Theme | Numbers | Controls | Examples in plain words |
|---|---|---|---|
| Organisational | 5.1 to 5.37 | 37 | Policies, asset inventory, access rules, suppliers, incidents |
| People | 6.1 to 6.8 | 8 | Screening, awareness training, duties after leaving |
| Physical | 7.1 to 7.14 | 14 | Entry to offices, equipment, secure disposal |
| Technological | 8.1 to 8.34 | 34 | Privileged access, backup, logging, change management |
Guides and audit reports often write the numbers with that A. in front. This course writes 8.13, without it.
Annex A is not a checklist to tick. You choose controls from your risk assessment, compare them with Annex A so that you forget nothing, and record the result in a statement of applicability (lesson 5). ISO/IEC 27002:2022 is the companion standard: it has the same controls with the same numbers and names, and gives guidance on how to implement each one. An organisation is certified against 27001, never against 27002.
Certified means that an independent certification body audited the management system inside a stated scope and issued a certificate. ISO writes the standard and does not certify anybody. A certificate says that the system exists and runs within that scope. It does not say that a product is secure or that no incident can happen, so always read the scope of a certificate that a supplier shows you. Many organisations work to the standard with no certificate, and that is an honest answer to the school network.
Worked example
Work in ~/krlab/security-governance.
1. Save the map of Annex A
The file annex_a.py holds only the four themes and their counts. Lesson 5 uses it to catch a control number that cannot exist. ref.partition(".") cuts 8.13 into 8, the dot and 13. text.isdigit() is true when a text holds only digits.
annex_a.py
"""annex_a.py: the four control themes of Annex A of ISO/IEC 27001:2022 and how many controls each has.
python3 annex_a.py 8.13 6.9
"""
import sys
THEMES = {"5": ("organisational", 37), "6": ("people", 8), "7": ("physical", 14), "8": ("technological", 34)}
def theme_of(ref):
"""Return the theme of a control number such as 8.13, or "" if Annex A has no such number."""
first, _, number = ref.partition(".")
name, count = THEMES.get(first, ("", 0))
return name if number.isdigit() and 1 <= int(number) <= count else ""
if __name__ == "__main__":
for ref in sys.argv[1:]:
print(ref, theme_of(ref) or "is not a control number of Annex A")
print("controls in Annex A:", sum(count for _, count in THEMES.values()))python3 annex_a.py 8.13 5.37 7.158.13 technological
5.37 organisational
7.15 is not a control number of Annex A
controls in Annex A: 932. Write the map from clauses to records
Each row names a record, the file that will hold it, and its owner. Most files do not exist yet: the lesson column says where you build each one. Imani is an accountant from outside the company who does the internal audit.
isms_map.csv
clause,record,file,owner,lesson
4,Scope and context,scope.md,Carys,3
5,Information security policy,policies/information-security.md,Carys,1
6,Asset inventory,assets.csv,Ben,3
6,Risk register and treatment plan,risks.csv,Carys,4
6,Statement of applicability,soa.csv,Carys,5
7,Document register,policies/index.csv,Carys,1
7,Competence needs of each role,competence_needs.csv,Carys,14
7,Competence and awareness records,competence.csv,Carys,14
8,Evidence manifest,evidence/MANIFEST.csv,Ben,6
8,Access review decisions,access_decisions.csv,Carys,7
8,Change records,changes.csv,Ben,8
8,Policy exceptions,exceptions.csv,Carys,8
8,Supplier reviews,suppliers.csv,Efe,9
8,Restore test record,restore_test.json,Ben,10
9,Internal audit findings,findings.csv,Imani,11
9,Metrics report for the management review,report.md,Carys,13
9,Record of the management review,management_review.json,Asha,15
9,Actions of the management review,review_actions.csv,Carys,15
10,Corrective actions,findings.csv,Carys,113. Write the checker
The checker reports a row with an unknown clause or no owner, and a clause with no record at all. It prints, for each clause, how many of its records are on file. With the word strict, a record that is not on file is a problem too. f"{clause:>2}" writes a value right-aligned in 2 characters, and :<29 left-aligned in 29. found += [...] adds every item of a list to found.
isms_check.py
"""isms_check.py: check the map from the clauses of the management system to your records.
python3 isms_check.py isms_map.csv [FOLDER] [strict]
With "strict", a record whose file is not in FOLDER is a problem.
"""
import sys
from pathlib import Path
from grc import finish, load
CLAUSES = {"4": "Context of the organisation", "5": "Leadership", "6": "Planning", "7": "Support",
"8": "Operation", "9": "Performance evaluation", "10": "Improvement"}
def problems(path, folder=".", strict=False, show=False):
rows = load(path)
found = []
for r in rows:
if r["clause"] not in CLAUSES:
found.append(f"{r['record']}: clause {r['clause']} is not one of 4 to 10")
if not r["owner"]:
found.append(f"{r['record']}: no owner")
for clause, title in CLAUSES.items():
mine = [r for r in rows if r["clause"] == clause]
have = [r for r in mine if (Path(folder) / r["file"]).exists()]
if show:
print(f"{clause:>2} {title:<29}{len(have)} of {len(mine)} on file")
if not mine:
found.append(f"clause {clause} ({title}) has no record")
if strict:
found += [f"{r['record']}: not on file: {r['file']}" for r in mine if r not in have]
return found
if __name__ == "__main__":
args = sys.argv[1:]
finish(problems(args[0], args[1] if len(args) > 1 else ".", "strict" in args, show=True))4. Run it
python3 isms_check.py isms_map.csv 4 Context of the organisation 0 of 1 on file
5 Leadership 1 of 1 on file
6 Planning 0 of 3 on file
7 Support 1 of 3 on file
8 Operation 0 of 6 on file
9 Performance evaluation 0 of 4 on file
10 Improvement 0 of 1 on file
problems: 0The map has a record for every clause that the course builds, each with an owner. Two records are on file, both from lesson 1.
5. Ask what is still to build
| (pipe) hands the output of one command to the next, and tail -4 prints the last four lines of what it receives.
python3 isms_check.py isms_map.csv . strict | tail -4
echo "exit code $?"PROBLEM Record of the management review: not on file: management_review.json
PROBLEM Actions of the management review: not on file: review_actions.csv
PROBLEM Corrective actions: not on file: findings.csv
problems: 17
exit code 0The strict run lists 17 records that are not on file. That list is the work plan of this course, and the number falls as you go. The exit code printed here is the one of tail, which is 0: in a pipe the shell reports the last command. Lesson 16 reads the exit code of the checker itself.
Your turn
Nadia of Marlow Physio made her own map. Save it and check it against the folder marlow, where the policy set of lesson 1 is. There are no steps.
marlow/isms_map.csv
clause,record,file,owner,lesson
4,Scope of the three sites,scope.md,Nadia,3
5,Information security policy,policies/security.md,Nadia,1
6,Risk register,risks.csv,,4
7,Document register,policies/index.csv,Nadia,1
8,Lost device log,lost-devices.csv,Omar,8
8,Record access standard,policies/record-access.md,Omar,1
10,Corrective actions,findings.csv,Nadia,11
11,Fire drill record,fire-drill.csv,Priya,8Then write two lines to Nadia: which record would close the gap in her map, and why a clinic that never audits itself cannot know whether its rules are kept.
Check yourself
A supplier says "we are ISO 27001 certified". Which two things do you read on the certificate before you rely on it?
The scope and the dates. The scope says which sites, services and systems the audited management system covers, and the service that you buy may be outside it. The dates say whether the certificate is still valid. Also read who issued it: an independent certification body, not the supplier.
Why is Annex A not a checklist?
The controls of an organisation come from its own risk assessment. Annex A is a reference list to compare against, so that no common control is forgotten. An organisation may leave a control out when it gives a reason, and may add controls that Annex A does not have. The statement of applicability records both (lesson 5).
What is the difference between ISO/IEC 27001 and ISO/IEC 27002?
27001 states the requirements for the management system and lists the controls in Annex A. An organisation can be certified against it. 27002 has the same controls with the same numbers and gives guidance on how to implement each one. It is advice, and nobody is certified against it.
The strict run lists 17 records that are not on file. Is that a failure of Brindle Books?
Not yet. It is an honest picture on day one: the company knows what the system needs and what it lacks. It becomes a failure when the list does not shrink, or when somebody claims "we work to the standard" while it is this long.
Field notes
- The seven clause names are shared by other ISO management system standards, for example ISO/IEC 42001 for AI. A later course, "AI governance for engineers", outlines that standard. An organisation that runs one such system can extend it to the next.
- Take edition, amendments and transition dates from iso.org and from your certification body. They change, and a course page is not the source.
- Certification is a business decision. Customers and tenders often ask for it, and the work behind it has value with or without the certificate.
- Do not buy a pile of document templates and call it an ISMS. An auditor follows one record through the loop: a risk, its control, the evidence, the audit, the correction. Templates with no records behind them fail that walk.
- Keep the map in version control with the records. When a person leaves, search the map for their name: every record they owned needs a new owner.