Level 9 / Project 09 - Security Baseline Auditor¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | — |
Focus¶
- Rule-based auditing against security baselines (CIS, NIST, SOC2)
- Strategy pattern for different security check types
- Compliance scoring with pass/fail/warning/not-applicable states
- Gap analysis identifying missing or weak configurations
- Structured audit reporting with remediation guidance
Why this project exists¶
Security baselines like CIS Benchmarks and NIST frameworks define hundreds of required configuration settings: TLS versions, password policies, logging requirements, encryption standards. Manually checking them is slow, error-prone, and quickly outdated. This project builds a configurable security auditor that checks system configurations against baselines, scores compliance, and generates actionable gap analysis reports, the same automation that compliance teams run before every SOC2 or ISO 27001 audit.
Run (copy/paste)¶
Expected terminal output¶
{
"baseline": "CIS-v1",
"compliance_pct": 75.0,
"controls_passed": 6,
"controls_failed": 2,
"findings": [...]
}
7 passed
Expected artifacts¶
- Console JSON output with audit results and compliance score
- Passing tests
- Updated
notes.md
Alter it (required)¶
- Add a
check_ip_allowlistcontrol that validates IP ranges against an allowed list. - Add severity-weighted compliance scoring (critical failures reduce score more than medium ones).
- Add a
--configflag that loads the system configuration from a JSON file.
Break it (required)¶
- Pass an empty config dictionary: how many controls fail and what compliance_pct results?
- Set
min_tls_versionto a non-numeric string (e.g. "abc"): does the comparison work? - Add a custom check function that raises an exception: does the auditor handle it?
Fix it (required)¶
- Add a fallback value for missing config keys so checks degrade gracefully.
- Validate TLS version format before comparison.
- Wrap check function calls in try/except to isolate individual control failures.
Explain it (teach-back)¶
- What is a security baseline and how do standards like CIS Benchmarks define them?
- How does the Strategy pattern let you plug in new security checks without modifying the auditor?
- Why does compliance percentage exclude NOT_APPLICABLE controls?
- How do real organizations automate baseline auditing in their CI/CD pipelines?
Mastery check¶
You can move on when you can: - explain CIS Benchmarks, NIST, and SOC2 at a high level, - add a new security control (check function + SecurityControl registration), - describe how compliance scoring works with pass/fail/warning/n-a states, - design a baseline audit for a real web application with appropriate controls.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|