Lesson 14 · 35 minutes
Record who is trained and who has read the policy, and check it
- Say what clauses 7.2 and 7.3 of ISO/IEC 27001 ask for, in your own words
- Record who is trained for what and who has read the policy
- Find the gaps with a program and close control C12 of the statement of applicability
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
Jonas, the auditor of the school network, sends a question for January: "Who at Brindle Books is trained to run the backup, and who has read the security policy?" Carys answers from memory. Asha asks for files instead: one that says who needs what training, and one that says who has done it. You write them, and a checker for both.
Recall
Lesson 1: which dates does the document register hold for a policy, and which one does a reading have to follow?
The date of the last approval and the date of the next review. A person who read the policy before its last approval has read an old version.
Lesson 7: which file lists the staff with a role and a status, and which people does this lesson leave out?
hr.csv. The checker of this lesson reads only the people whose status is active, so a leaver such as Ines is not asked for new training.
The idea
Clauses 7.2 and 7.3 of ISO/IEC 27001:2022 ask for two things. The standard is not free and this course does not quote it. The table gives the plain meaning of each clause. Check each point in the standard before you claim it at work.
| Clause | In plain words | Record of this lesson |
|---|---|---|
| 7.2 Competence | Decide what skills the people need whose work affects information security. Make sure they have them, by education, training or experience. Act on a gap, judge the result, and keep records as evidence. | competence_needs.csv, competence.csv |
| 7.3 Awareness | People who work for the organisation know the policy, how their work helps the system, and what follows if they break its rules. The clause names no record, and auditors still ask who read what. | The reading of the policy, in the same records |
A competence record has two halves. The need says what a role must know and how often. The record says that a person did it, with proof and a second person who checked. Awareness is the need that every role shares: read the policy, and again after each approval.
Worked example
Work in ~/krlab/security-governance. The policy of lesson 1 says that staff read it when they join and every year. The last step reads report.md of lesson 13: if you built the lab with kr-lab.sh, run python3 evidence.py collect, python3 evidence.py seal and python3 metrics.py . first.
1. Write what each role needs
The role column uses the roles of hr.csv (lesson 7), and all means everybody. every_days is how long a record stays valid. document is the id of a document in the register of lesson 1: the person must have read its current version.
competence_needs.csv
role,item,every_days,document
all,Read the policy,365,P1
director,Briefing for top management,365,
it,Backup and restore,365,
operations,Risk register and audits,365,
developer,Safe changes and secrets,365,
finance,Phishing and payment fraud,365,
service,Customer data requests,365,
warehouse,Scanners and parcel data,365,2. Record what was done
One row for each person and item. The evidence says what shows it, and checked_by is somebody else. Ines left, and her rows stay as history.
competence.csv
person,item,done_on,evidence,checked_by
Asha,Read the policy,2026-06-02,signed sheet,Carys
Asha,Briefing for top management,2026-06-15,briefing notes,Carys
Ben,Read the policy,2026-06-03,signed sheet,Carys
Ben,Backup and restore,2026-11-21,restore_test.json,Carys
Carys,Read the policy,2026-06-02,signed sheet,Asha
Carys,Risk register and audits,2026-09-10,course certificate,Asha
Dev,Read the policy,2026-06-04,signed sheet,Carys
Dev,Safe changes and secrets,2026-03-18,course certificate,Carys
Efe,Read the policy,2026-06-04,signed sheet,Carys
Efe,Phishing and payment fraud,2025-12-01,webinar record,Carys
Greta,Read the policy,2026-06-04,signed sheet,Carys
Greta,Customer data requests,2026-08-20,attendance sheet,Carys
Hal,Read the policy,2026-06-05,signed sheet,Carys
Hal,Scanners and parcel data,2026-05-12,attendance sheet,Carys
Ines,Read the policy,2026-06-04,signed sheet,Carys
Ines,Customer data requests,2026-02-10,attendance sheet,Greta3. Write the competence checker
The checker goes through the active staff of hr.csv. It reports a role with no need of its own, a person with no record of a needed item, an overdue record, a record with no evidence or checked by the person alone, and a reading from before the last approval of the document. a - b on two sets keeps the values of a that are not in b. A generator expression such as (n for n in needs if ...) is a loop that gives only the items that fit. timedelta(days=n) is a span of n days (lesson 9).
competence_check.py
"""competence_check.py: check who is trained for what, and who has read the policy.
python3 competence_check.py competence_needs.csv competence.csv hr.csv policies/index.csv
"""
import sys
from datetime import timedelta
from grc import TODAY, day, finish, load
def problems(needs_path, records_path, hr_path, register_path):
needs = load(needs_path)
staff = [s for s in load(hr_path) if s["status"] == "active"]
approved = {r["id"]: day(r["approved"]) for r in load(register_path)}
done = {(r["person"], r["item"]): r for r in load(records_path)}
found = [f"role {role} has no requirement defined" for role in sorted({s["role"] for s in staff} - {n["role"] for n in needs})]
for s in staff:
for n in (n for n in needs if n["role"] in ("all", s["role"])):
who, r = s["person"], done.get((s["person"], n["item"]))
if r is None:
found.append(f"{who}: no record of: {n['item']}")
continue
due = day(r["done_on"]) + timedelta(days=int(n["every_days"]))
if due < TODAY:
found.append(f"{who}: overdue since {due}: {n['item']}")
if not r["evidence"] or not r["checked_by"] or r["checked_by"] == who:
found.append(f"{who}: needs evidence and a check by another person: {n['item']}")
if n["document"] in approved and day(r["done_on"]) < approved[n["document"]]:
found.append(f"{who}: read {n['document']} before its last approval on {approved[n['document']]}")
return found
if __name__ == "__main__":
finish(problems(*sys.argv[1:5]))python3 competence_check.py competence_needs.csv competence.csv hr.csv policies/index.csvproblems: 04. Break copies of the two files
Drop the need of the warehouse role, delete both records of Dev, and make Efe's training older. grep -v prints the lines that do not match, and sed '/^Efe,Phishing/s/2025-12-01/2025-06-01/' changes the date on the one line that starts with Efe,Phishing.
grep -v "^warehouse" competence_needs.csv > test-needs.csv
sed '/^Efe,Phishing/s/2025-12-01/2025-06-01/' competence.csv | grep -v "^Dev," > test-competence.csv
python3 competence_check.py test-needs.csv test-competence.csv hr.csv policies/index.csvPROBLEM role warehouse has no requirement defined
PROBLEM Dev: no record of: Read the policy
PROBLEM Dev: no record of: Safe changes and secrets
PROBLEM Efe: overdue since 2026-06-01: Phishing and payment fraud
problems: 4Remove the copies with rm test-needs.csv test-competence.csv.
5. Close the gap in the statement
Lesson 5 left control C12 as planned, because no record existed. Now the record exists, so C12 becomes implemented, and its evidence joins the evidence plan of lesson 6. sed -i changes the file in place, and the strict run of the map shows what is still not on file. If you built the lab with kr-lab.sh, soa.csv and evidence_plan.csv are already finished: skip the first two commands of this step.
sed -i '/^C12/s/,planned,,,Carys/,implemented,,competence.csv,Carys/' soa.csv
echo "competence.csv,C12,Training and reading records of the staff,Carys" >> evidence_plan.csv
python3 soa_check.py soa.csv risks.csv
python3 isms_check.py isms_map.csv . strict | grep "^PROBLEM"implemented 10
not_applicable 1
planned 1
problems: 0
PROBLEM Record of the management review: not on file: management_review.json
PROBLEM Actions of the management review: not on file: review_actions.csvTwo records of the map are left, both for the management review in lesson 15. If you worked through the lessons, the manifest does not hold competence.csv yet. Lesson 16 seals the plan again.
6. The finished files
The finished file: soa.csv
soa.csv
control,ref,theme,title,applicable,justification,status,risks,evidence,owner
C01,5.1,organisational,Policy set approved by management,yes,Contract with the school network,implemented,,policies/index.csv,Carys
C02,5.9,organisational,Inventory of assets with owners,yes,Base of the risk assessment,implemented,,assets.csv,Ben
C03,5.18,organisational,Quarterly review of access rights,yes,Treats R5,implemented,R5,access_decisions.csv,Carys
C04,6.5,people,Leaver procedure for accounts,yes,Treats R5,implemented,R5,evidence/users.txt,Ben
C05,8.5,technological,Second factor on admin accounts,yes,Treats R1,implemented,R1,evidence/admins.txt,Ben
C06,8.13,technological,Nightly backup and restore test,yes,Treats R2,implemented,R2,evidence/backup.log restore_test.json,Ben
C07,8.8,technological,Security updates within 30 days,yes,Contract with the school network,implemented,,evidence/patch-state.csv,Ben
C08,8.32,technological,Change approval with a rollback plan,yes,Treats R7,implemented,R7,changes.csv,Dev
C09,5.19,organisational,Supplier contracts and reviews,yes,Treats R4,implemented,R4,suppliers.csv,Efe
C10,8.24,technological,Disk encryption on laptops,yes,Treats R3,planned,R3,,Ben
C11,8.30,technological,Rules for outsourced development,no,No development work is given to outside parties,not_applicable,,,Carys
C12,6.3,people,Security awareness training,yes,Staff must know the policy,implemented,,competence.csv,CarysThe finished file: evidence_plan.csv
evidence_plan.csv
file,control,source,collected_by
policies/index.csv,C01,Document register in the policy folder,Carys
assets.csv,C02,Asset inventory,Ben
access_decisions.csv,C03,Access review decisions,Carys
evidence/users.txt,C04,Login accounts read from the machine,Ben
evidence/admins.txt,C05,Administrator groups read from the machine,Ben
evidence/backup.log,C06,Log of the nightly backup job on db-1,Ben
restore_test.json,C06,Restore test record,Ben
evidence/patch-state.csv,C07,Patch report of the device management tool,Ben
changes.csv,C08,Change log,Dev
suppliers.csv,C09,Supplier register,Efe
competence.csv,C12,Training and reading records of the staff,CarysYour turn
Nadia of Marlow Physio kept records too. The check also reads marlow/hr.csv and marlow/policies/index.csv of earlier lessons. Save the two files below in marlow and run the competence checker on them. There are no steps.
marlow/competence_needs.csv
role,item,every_days,document
all,Read the policy,365,P1
manager,Duties of the manager,365,
it,Backup and restore,365,
physio,Patient records away from the clinic,365,
billing,Invoices and payment details,365,marlow/competence.csv
person,item,done_on,evidence,checked_by
Nadia,Read the policy,2026-02-10,signed sheet,Omar
Nadia,Duties of the manager,2026-03-05,course certificate,Omar
Omar,Read the policy,2026-02-10,signed sheet,Nadia
Omar,Backup and restore,2025-04-02,course certificate,Nadia
Priya,Read the policy,2026-01-20,signed sheet,Nadia
Priya,Patient records away from the clinic,2026-05-14,attendance sheet,Nadia
Quentin,Read the policy,2026-02-12,signed sheet,Nadia
Sam,Read the policy,2026-02-12,signed sheet,Nadia
Sam,Patient records away from the clinic,2026-05-14,,Priya
Rosa,Read the policy,2026-02-12,signed sheet,Nadia
Rosa,Invoices and payment details,2026-06-01,course certificate,RosaThen write the sentence that you would say to Nadia about Omar, who runs the backups and whose own training is overdue.
Check yourself
Priya read the policy in January, and the policy was approved again in February. Is she aware of the policy?
Of the old version only. Awareness means the current rules, so the checker reports a reading from before the last approval.
A certificate of attendance is on file for every person. Is the need of the role met?
Not necessarily. A certificate shows that somebody attended. The need is a skill, and a skill is shown by something that the person did, for example the restore test that Ben ran. The checker asks for evidence and a second person, and it cannot judge whether the evidence is good.
Why does the competence checker skip the people who left?
A leaver needs no new training, and a "no record" line for a person who is gone hides the real gaps. Ines keeps her rows as history, because the auditor may ask who was trained on the day.
Field notes
- A certificate shows that somebody attended. For a skill that matters, choose evidence that shows the skill: Ben's evidence for the backup is the restore test that he ran.
- Competence records are personal data about staff. Keep what the control needs, and let few people read them.
- Awareness is more than a signed sheet. Auditors also ask a few staff what the policy says, so a reading that nobody remembers is weak evidence.
- Set the interval of each need yourself and write the reason. A year is common, and a role with fast-changing risks may need less.