𓂀
𓋹

SECURITY AUDIT TOOL

Lesson 5 of 5 — Capstone
~8 hrs
WARMUP: Comprehensive Review

You've learned Python basics, password cracking, log analysis, and automation. Now it's time to combine everything into a single powerful tool: a Security Audit Tool.

Think about it: What features would a complete security audit tool need? List 5 key features before proceeding.

CORE CONCEPTS

A security audit checks a system's defenses, identifies vulnerabilities, and recommends fixes. Planning is key — know what you're testing and why.

# Audit phases: # 1. Discovery — identify systems and services # 2. Scanning — check for open ports, weak passwords # 3. Analysis — review logs for suspicious activity # 4. Reporting — document findings

Our Security Audit Tool will combine password checking, log analysis, file monitoring, and report generation into one Python-based system.

# Proposed tool structure class SecurityAuditTool: def check_password_strength(self, pwd): ... def analyze_logs(self, log_file): ... def monitor_files(self, path): ... def generate_report(self): ...

A good report is clear, prioritized, and actionable. Every finding should include: severity, description, and recommendation.

# Sample report format Report: Security Audit - June 2026 HIGH - Weak admin password found HIGH - 15 failed login attempts from 10.0.0.99 MED - backup.sql exposed in web root MED - No file monitoring active LOW - Missing security headers
MINI CHALLENGE: Comprehensive Review Challenge

Using everything you've learned so far, solve this multi-part challenge:

1. Write a Python one-liner that checks if a password has at least one uppercase letter

2. Read this log line and identify the IP: "192.168.1.5 - - [12/Jun/2026] 'GET /admin' 403"

3. What command would you use to schedule a Python script to run every hour?

MAIN PROJECT: Build the Security Audit Tool

This is your capstone project. Write a complete Python specification — and code where possible — for a Security Audit Tool that combines all four previous modules.

1

Password strength checker module (from Lesson 2)

2

Log analysis module that flags suspicious IPs (Lesson 3)

3

File integrity monitoring (Lesson 4)

4

Report generator that outputs findings with severity

5

Main menu loop tying everything together

QUIZ: Comprehensive Review

Final test — 5 questions covering all Level 2 content.

1. What is the correct way to check if a variable x equals 5 in Python?

x = 5
x == 5
x != 5

2. A dictionary attack uses what kind of list?

Random character combinations
Common passwords and words
All possible PINs

3. Which HTTP status code indicates "Access Forbidden"?

200
404
403

4. What does time.sleep(5) do?

Sleeps for 5 milliseconds
Pauses execution for 5 seconds
Ends the program after 5 seconds

5. Why is a Security Audit Tool important for an organization?

It makes the website faster
It proactively finds vulnerabilities before attackers do
It replaces the need for a firewall