Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Foundations / Security governance and compliance

Security governance and compliance cheat sheet

Set up (lesson 0)

TaskCommand or code
Make the lab foldermkdir -p ~/krlab/security-governance
Build the lab from the zip, as it stands after a lessonsh kr-lab.sh <lesson folder> ~/krlab/security-governance
Prove that the lab workspython3 labcheck.py
End a checker with a count and an exit codefinish(problems) from grc.py
The fixed date of every checkTODAY in grc.py (2026-11-21)
Read the exit code of the last commandecho "exit code $?"

Policy set (lesson 1)

TaskCommand or code
Check a policy set and its document registerpython3 policy_check.py policies
What management wants, in a few rulesPolicy
An exact requirement that can be testedStandard
The steps and who does themProcedure
Advice, not mandatoryGuideline
Who runs, who challenges, who auditsThe three lines model: first, second, third line
Copy a folder, change text in a filecp -r a b, sed -i 's/old/new/' file

ISO/IEC 27001 (lesson 2)

TaskCommand or code
Check the map from clauses to recordspython3 isms_check.py isms_map.csv
List the records that are not on filepython3 isms_check.py isms_map.csv . strict
Find the theme of an Annex A control numberpython3 annex_a.py 8.13
The clauses with requirements4 Context, 5 Leadership, 6 Planning, 7 Support, 8 Operation, 9 Performance evaluation, 10 Improvement
Annex A of the 2022 edition93 controls: 37 organisational, 8 people, 14 physical, 34 technological
Guidance for the same controlsISO/IEC 27002 (nobody is certified against it)

Scope and assets (lesson 3)

TaskCommand or code
Check the inventory against the scopepython3 assets_check.py assets.csv scope.md
Sections of a scope statementContext, Interested parties, In scope, Out of scope (with a reason)
Classes of this coursepublic, internal, confidential, restricted
Add a line to a file, drop lines with a wordecho "text" >> file, grep -v word file > copy

Risk register (lesson 4)

TaskCommand or code
Report and check the registerpython3 risks.py risks.csv
Scorelikelihood x impact, each 1 to 5: critical from 15, high from 10, medium from 5
Treatment optionsreduce, avoid, transfer, accept
Risk appetite of this courseA residual score of 15 or more is not acceptable
Change only the lines that start with an idsed -i '/^R3/s/old/new/' file

Statement of applicability (lesson 5)

TaskCommand or code
Check the statement against the registerpython3 soa_check.py soa.csv risks.csv
Walk from a risk to its controlgrep "R1" soa.csv | cut -d, -f1,4,7,9
A decision for each controlapplicable yes or no, a justification, a status, the evidence

Evidence (lesson 6)

TaskCommand or code
Collect the user list and the administrator groups of your machinepython3 evidence.py collect
Seal the files of the evidence plan in the manifestpython3 evidence.py seal
Verify: exists, unchanged, freshpython3 evidence.py verify
Good evidence sayswhat, from which system, who, when, complete, unchanged
Hash one filesha256sum file

Access review (lesson 7)

TaskCommand or code
Find orphan, leaver, excess and dormant accountspython3 access_review.py find .
Check that every finding has a valid decisionpython3 access_review.py check .
Decisionsremove, reduce, keep with a reason, by a person other than the account holder

Changes and exceptions (lesson 8)

TaskCommand or code
Check the change log and the exception registerpython3 change_check.py changes.csv exceptions.csv
Change typesnormal (approved first), standard (pre-approved), emergency (approved within 2 days, reviewed)
An exception hasan owner, another person as approver, an end date, a compensating control

Suppliers (lesson 9)

TaskCommand or code
Check supplier records and the responsibility tablepython3 supplier_check.py check suppliers.csv responsibility.csv
Print the review calendarpython3 supplier_check.py calendar suppliers.csv
Clauses of a high suppliersecurity, breach_notice, audit, subprocessors, data_return, exit

Backup and restore (lesson 10)

TaskCommand or code
Check the business impact analysispython3 continuity.py bia bia.csv
Write checksums of a folder(cd data && sha256sum *) > backup/SHA256SUMS
Pack, list and restore into a fresh foldertar -czf b.tar.gz data, tar -tzf b.tar.gz, tar -xzf b.tar.gz -C restore
Compare the restored filessha256sum -c SHA256SUMS, diff -rq a b
Measure the recovery pointpython3 continuity.py measure FOLDER SHA256SUMS BACKUP_TIME FAILURE_TIME
Check a restore test recordpython3 continuity.py check restore_test.json bia.csv
How long a process may be down, how much data may be lostRTO, RPO
Shape of a backup3-2-1: 3 copies, 2 kinds of storage, 1 off site

Internal audit (lesson 11)

TaskCommand or code
Run the tests of an audit planpython3 audit.py audit_plan.csv audit
Check findings and corrective actionspython3 findings_check.py findings.csv
Grades of this coursemajor (20% or more of the tested records fail), minor, observation
A nonconformity needsa root cause, a corrective action, an owner, a due date, a follow-up

Other frameworks (lesson 12)

TaskCommand or code
Check a mappingpython3 mapping_check.py mapping.csv soa.csv
NIST CSF 2.0 FunctionsGovern, Identify, Protect, Detect, Respond, Recover
SOC 2 categoriessecurity, availability, processing integrity, confidentiality, privacy
Strength of a mapping rowclose, partial, loose (with a note)
Count the values of a columntail -n +2 file | cut -d, -f3 | sort | uniq -c

Metrics (lesson 13)

TaskCommand or code
Compute the four measures and write report.mdpython3 metrics.py .
Sort a CSV file by its third fieldsort -t, -k3 file
A good measurefrom a record, both parts shown, a target set before, the worst item named

Competence and awareness (lesson 14)

TaskCommand or code
Check who is trained for what and who has read the policypython3 competence_check.py competence_needs.csv competence.csv hr.csv policies/index.csv
Clauses of ISO/IEC 27001:20227.2 competence, 7.3 awareness
What a competence row needsa date, evidence, and a second person who checked

Management review (lesson 15)

TaskCommand or code
Check a record of a management review and its actionspython3 review_check.py management_review.json review_actions.csv policies/index.csv
Clause of ISO/IEC 27001:20229.3 management review
Inputs of the review in this courseprevious actions, metrics, audit, incidents, risks

Evidence pack (lesson 16)

TaskCommand or code
After kr-lab.sh, make the files that commands writepython3 evidence.py collect, python3 metrics.py ., python3 evidence.py seal
Check the whole packpython3 check_pack.py [FOLDER]
Show only the parts with problemspython3 check_pack.py | grep -v " ok$"
Make a clean copy, or a copy with planted faultspython3 drill.py copy, python3 drill.py plant

Safety habits

HabitWhy
Collect evidence only from systems that are yours to readA user list is personal data, and another system is not your lab
Hand over the whole population, never a sample of your choiceThe person who chooses the rows controls the result
Never edit evidence, and never seal a changed file again to make a check passFind out who changed it, collect it again, and record what happened
Break a copy, not the packTest a checker on test- files or in drill/
Restore into a fresh folderThe damaged data may hold the only copy of recent work
Nobody approves their own work, access, change or exceptionSeparation of duties
Accept a risk with a name and a dateA risk that nobody accepted is ignored, not accepted
Give every exception an end dateAn exception with no end is a hidden policy
Say what a mapping or a certificate does not cover"Mapped" is not "met", and a certificate has a scope
Give every competence record evidence and a second person who checked itA record that its own subject confirms proves nothing
Take the text of a standard or a law from its sourceThis course describes and does not quote, and it gives no legal advice