Programming Labs
The Programming Labs move you from:
LEARNING PROGRAMMING βWRITING SECURITY SCRIPTS βBUILDING SECURITY TOOLS βAUTOMATING SECURITY WORKFLOWSThese labs are designed around the programming skills covered in:
PYTHON
BASH
POWERSHELL
JAVASCRIPT
SQL
SECURITY AUTOMATIONThe emphasis is not simply:
WRITE CODEThe emphasis is:
UNDERSTAND A SECURITY PROBLEM βDESIGN A WORKFLOW βBUILD THE TOOL βTEST IT βGENERATE SECURITY RESULTSAll labs should be completed using:
YOUR OWN LAB SYSTEMS
SYNTHETIC SECURITY DATA
TRAINING ENVIRONMENTS
EXPLICITLY AUTHORIZED SYSTEMSProgramming Lab Roadmap
Section titled βProgramming Lab RoadmapβLAB 01SECURITY LOG ANALYZER βLAB 02IOC PROCESSING & ENRICHMENT βLAB 03LINUX SECURITY AUTOMATION βLAB 04WINDOWS SECURITY AUTOMATION βLAB 05SQL SECURITY ANALYTICS βLAB 06VULNERABILITY DATA ANALYSIS βLAB 07SECURITY API INTEGRATION βLAB 08CLOUD SECURITY CONFIGURATION AUDITOR βLAB 09SOC ALERT TRIAGE AUTOMATION βLAB 10ENTERPRISE SECURITY AUTOMATION CAPSTONELab 01 β Build a Security Log Analyzer
Section titled βLab 01 β Build a Security Log AnalyzerβMission
Section titled βMissionβBuild a Python-based security log analyzer capable of processing authentication events and producing an investigation summary.
Skills Used
Section titled βSkills UsedβPYTHON
FILES
REGEX
CSV
JSON
DICTIONARIES
COUNTERS
ERROR HANDLINGLab Workflow
Section titled βLab WorkflowβAUTHENTICATION LOG βREAD FILE βPARSE EVENTS βVALIDATE FIELDS βNORMALIZE βCOUNT FAILED LOGINS βGROUP BY USER βGROUP BY SOURCE IP βGENERATE REPORTStudents Will Build
Section titled βStudents Will BuildβA tool capable of answering questions such as:
How many failed logins occurred?
Which users had the most failures?
Which source IPs generated the most failures?
Were any successful logins observed after failures?
Which events require analyst review?Expected Outputs
Section titled βExpected Outputsβfailed-users.csv
source-ip-summary.csv
security-summary.json
investigation-report.txtKey Security Lesson
Section titled βKey Security LessonβLogs become useful only when they are:
PARSED
NORMALIZED
CORRELATED
INTERPRETEDLab 02 β IOC Processing and Enrichment Pipeline
Section titled βLab 02 β IOC Processing and Enrichment PipelineβMission
Section titled βMissionβBuild a defensive Indicator of Compromise processing pipeline.
Students will work with synthetic indicators such as:
IP ADDRESSES
DOMAIN NAMES
FILE HASHESSkills Used
Section titled βSkills UsedβPYTHON
REGEX
IPADDRESS
JSON
CSV
SETS
APIs
ERROR HANDLINGWorkflow
Section titled βWorkflowβRAW IOC LIST βVALIDATE βNORMALIZE βDEDUPLICATE βCLASSIFY βOPTIONAL AUTHORIZED ENRICHMENT βREPORTStudents Will Learn
Section titled βStudents Will LearnβHow to:
Validate IP addresses
Normalize domains
Validate hash formats
Remove duplicates
Separate valid and invalid indicators
Add contextual information
Create analyst-ready outputExpected Outputs
Section titled βExpected Outputsβvalid-iocs.csv
invalid-iocs.csv
enriched-iocs.json
ioc-summary.txtKey Security Lesson
Section titled βKey Security LessonβAn IOC match provides:
CONTEXTnot automatic proof of malicious activity.
Lab 03 β Linux Security Automation with Bash
Section titled βLab 03 β Linux Security Automation with BashβMission
Section titled βMissionβBuild a Bash-based Linux security assessment script for a controlled Linux lab system.
Skills Used
Section titled βSkills UsedβBASH
FILESYSTEM
PERMISSIONS
PROCESSES
SERVICES
NETWORKING
grep
awk
sort
uniqWorkflow
Section titled βWorkflowβLINUX HOST βSYSTEM INFORMATION βUSER CONTEXT βPERMISSION REVIEW βPROCESS REVIEW βSERVICE REVIEW βLISTENING PORTS βLOG REVIEW βSECURITY REPORTStudents Will Collect
Section titled βStudents Will CollectβHostname
Operating System
Current User
Disk Usage
Running Processes
Running Services
Listening Ports
Selected File Permissions
Recent Authentication EventsExpected Outputs
Section titled βExpected Outputsβsystem-inventory.txt
service-inventory.txt
network-listeners.txt
permission-review.txt
linux-security-report.txtKey Security Lesson
Section titled βKey Security LessonβBash is especially effective when:
MULTIPLE SMALL LINUX COMMANDSneed to become:
ONE REPEATABLE WORKFLOWLab 04 β Windows Security Automation with PowerShell
Section titled βLab 04 β Windows Security Automation with PowerShellβMission
Section titled βMissionβBuild a PowerShell-based Windows security inventory and audit script.
Skills Used
Section titled βSkills UsedβPOWERSHELL
OBJECT PIPELINE
LOCAL USERS
GROUPS
PROCESSES
SERVICES
EVENT LOGS
NETWORKING
DEFENDER
FIREWALLWorkflow
Section titled βWorkflowβWINDOWS HOST βSYSTEM INFORMATION βLOCAL USERS βLOCAL ADMINISTRATORS βPROCESSES βSERVICES βLISTENING PORTS βWINDOWS SECURITY EVENTS βDEFENDER / FIREWALL βREPORTStudents Will Review
Section titled βStudents Will ReviewβCurrent Identity
Operating System
Local Accounts
Administrators Group
Running Services
Listening Connections
Failed Authentication Events
Firewall Profiles
Defender StatusExpected Outputs
Section titled βExpected Outputsβwindows-inventory.csv
local-admins.csv
services.csv
failed-logins.csv
windows-security-report.htmlKey Security Lesson
Section titled βKey Security LessonβPowerShell allows defenders to query:
WINDOWS OBJECTSdirectly rather than relying only on text parsing.
Lab 05 β SQL Security Analytics Lab
Section titled βLab 05 β SQL Security Analytics LabβMission
Section titled βMissionβUse SQL to investigate a synthetic enterprise security database.
Dataset
Section titled βDatasetβThe lab database should contain tables such as:
USERS
ASSETS
LOGIN_EVENTS
VULNERABILITIES
INCIDENTSSkills Used
Section titled βSkills UsedβSELECT
WHERE
ORDER BY
GROUP BY
COUNT
HAVING
JOIN
LEFT JOIN
CASE
SUBQUERIESInvestigation Questions
Section titled βInvestigation QuestionsβStudents should determine:
Which users generated the most failed logins?
Which source IP contacted the most accounts?
Which administrators do not have MFA?
Which critical assets have open critical vulnerabilities?
Which assets have no documented owner?
Which incidents remain unassigned?Workflow
Section titled βWorkflowβSECURITY QUESTION βSELECT TABLE βFILTER βJOIN CONTEXT βAGGREGATE βINTERPRET βREPORTExpected Outputs
Section titled βExpected Outputsβauthentication-analysis.sql
mfa-review.sql
vulnerability-priority.sql
asset-hygiene.sql
security-analysis-report.mdLab 06 β Vulnerability Data Analysis and Prioritization
Section titled βLab 06 β Vulnerability Data Analysis and PrioritizationβMission
Section titled βMissionβBuild a Python workflow that processes vulnerability scan exports and converts them into a prioritized remediation report.
Skills Used
Section titled βSkills UsedβPYTHON
CSV
JSON
DATA NORMALIZATION
DEDUPLICATION
RISK SCORING
REPORTINGInput Fields
Section titled βInput FieldsβUse synthetic data containing:
Asset
IP
Finding ID
Finding Name
Severity
CVSS
Status
Asset Criticality
OwnerWorkflow
Section titled βWorkflowβSCANNER EXPORT βVALIDATE βNORMALIZE βDEDUPLICATE βADD ASSET CONTEXT βPRIORITIZE βGROUP BY OWNER βGENERATE REPORTStudents Will Identify
Section titled βStudents Will IdentifyβCritical open findings
High-risk assets
Assets with multiple findings
Findings without owners
Duplicate findings
Overdue remediation itemsExpected Outputs
Section titled βExpected Outputsβnormalized-findings.csv
critical-findings.csv
owner-summary.csv
vulnerability-priority.json
remediation-report.mdKey Security Lesson
Section titled βKey Security LessonβSecurity prioritization should consider more than:
CVSS SCOREA stronger model includes:
TECHNICAL SEVERITY +ASSET CRITICALITY +EXPOSURE +BUSINESS CONTEXTLab 07 β Security API Integration
Section titled βLab 07 β Security API IntegrationβMission
Section titled βMissionβBuild a Python application that retrieves security information from an approved training API and converts the response into a useful report.
Skills Used
Section titled βSkills UsedβPYTHON
HTTP
REST APIs
JSON
AUTHENTICATION
TIMEOUTS
ERROR HANDLING
RETRIESWorkflow
Section titled βWorkflowβAUTOMATION βAPI REQUEST βAUTHENTICATION βJSON RESPONSE βVALIDATE βNORMALIZE βANALYZE βREPORTStudents Will Implement
Section titled βStudents Will ImplementβGET requests
Headers
Environment variables
Timeouts
HTTP status handling
JSON parsing
Pagination concept
Rate-limit handling
Controlled retry logicSecurity Requirements
Section titled βSecurity RequirementsβStudents must:
Avoid hard-coded credentials
Use approved API endpoints
Protect tokens
Avoid logging secrets
Use request timeouts
Handle errors gracefullyExpected Outputs
Section titled βExpected Outputsβapi-client.py
normalized-api-data.json
security-api-report.csv
README.mdLab 08 β Cloud Security Configuration Auditor
Section titled βLab 08 β Cloud Security Configuration AuditorβMission
Section titled βMissionβBuild a read-only cloud security assessment tool for a controlled cloud lab.
The first version must be:
READ ONLYPossible Platforms
Section titled βPossible PlatformsβThe methodology can be applied to:
AWS
AZURE
GOOGLE CLOUDusing the appropriate authorized APIs or CLIs.
Skills Used
Section titled βSkills UsedβPYTHON
CLOUD APIs
JSON
IDENTITY
CONFIGURATION CHECKS
REPORTINGSecurity Checks
Section titled βSecurity ChecksβExamples may include:
Logging enabled?
Encryption configured?
Public exposure present?
Privileged identity assignments?
Security monitoring configured?
Selected storage protections enabled?Workflow
Section titled βWorkflowβCLOUD API βRESOURCE INVENTORY βCONFIGURATION DATA βSECURITY BASELINE βCOMPARE βPASS / REVIEW / FAIL βREPORTExpected Outputs
Section titled βExpected Outputsβcloud-inventory.json
configuration-findings.csv
identity-review.csv
cloud-security-report.mdKey Security Lesson
Section titled βKey Security LessonβCloud automation should normally begin with:
VISIBILITYbefore:
AUTOMATIC REMEDIATIONLab 09 β SOC Alert Triage Automation
Section titled βLab 09 β SOC Alert Triage AutomationβMission
Section titled βMissionβBuild an alert-processing workflow that converts raw security alerts into analyst-ready investigation packages.
Skills Used
Section titled βSkills UsedβPYTHON
JSON
APIs
SQL
DATA NORMALIZATION
ENRICHMENT
RISK SCORING
REPORTINGUse synthetic alerts from multiple security products.
Example:
{ "alert_id": "ALT-1001", "user": "admin01", "source_ip": "10.10.10.25", "asset": "WEB01", "severity": "high"}Workflow
Section titled βWorkflowβRAW ALERT βVALIDATE βNORMALIZE βUSER LOOKUP βASSET LOOKUP βRELATED EVENTS βCONTEXT βPRIORITY RECOMMENDATION βANALYST REVIEWStudents Will Generate
Section titled βStudents Will GenerateβAlert Summary
User Context
Asset Context
Related Events
Risk Indicators
Recommended Investigation Priority
Analyst Notes SectionImportant Control
Section titled βImportant ControlβThe automation should:
RECOMMENDrather than automatically perform disruptive response actions.
Expected Outputs
Section titled βExpected Outputsβnormalized-alert.json
enriched-alert.json
timeline.csv
investigation-package.mdLab 10 β Enterprise Security Automation Capstone
Section titled βLab 10 β Enterprise Security Automation CapstoneβMission
Section titled βMissionβBuild an end-to-end security automation platform combining the skills from the entire Programming learning path.
This is the final Programming Lab.
Capstone Architecture
Section titled βCapstone Architectureβ SECURITY DATA β βββββββββββββββββββ β DATA COLLECTOR β ββββββββββ¬βββββββββ β βββββββββββββββββββ β VALIDATION β ββββββββββ¬βββββββββ β βββββββββββββββββββ β NORMALIZATION β ββββββββββ¬βββββββββ β βββββββββββββββββββ β ENRICHMENT β ββββββββββ¬βββββββββ β βββββββββββββββββββ β CORRELATION β ββββββββββ¬βββββββββ β βββββββββββββββββββ β RISK ANALYSIS β ββββββββββ¬βββββββββ β βββββββββββββββββββ β HUMAN REVIEW β ββββββββββ¬βββββββββ β βββββββββββββββββββ β REPORTING β βββββββββββββββββββTechnologies
Section titled βTechnologiesβStudents should combine several of:
PYTHON
BASH
POWERSHELL
SQL
JSON
REST APIs
HTML / JAVASCRIPTSuggested Enterprise Scenario
Section titled βSuggested Enterprise ScenarioβYour organization has:
LINUX SERVERS
WINDOWS SERVERS
CLOUD RESOURCES
SECURITY ALERTS
VULNERABILITY FINDINGS
USER ACCOUNTSBuild a system that collects security information and creates a unified analyst report.
Phase 01 β Linux Collection
Section titled βPhase 01 β Linux CollectionβUse Bash to collect approved information such as:
Hostname
OS
Running Services
Listening Ports
Selected Security LogsExport:
linux-inventory.jsonPhase 02 β Windows Collection
Section titled βPhase 02 β Windows CollectionβUse PowerShell to collect:
System Information
Administrators
Services
Firewall Status
Defender Status
Authentication EventsExport:
windows-inventory.jsonPhase 03 β Vulnerability Data
Section titled βPhase 03 β Vulnerability DataβProcess:
scanner-export.csvusing Python.
Normalize:
Asset
Finding
Severity
Status
OwnerPhase 04 β Security Database
Section titled βPhase 04 β Security DatabaseβStore or query normalized information using SQL.
Tables may include:
assets
users
events
findings
alertsPhase 05 β Security Correlation
Section titled βPhase 05 β Security CorrelationβCorrelate:
ASSET +IDENTITY +ALERTS +VULNERABILITIESPhase 06 β Risk Prioritization
Section titled βPhase 06 β Risk PrioritizationβBuild a simple documented scoring model using:
EVENT SEVERITY
ASSET CRITICALITY
IDENTITY PRIVILEGE
OPEN VULNERABILITIES
DETECTION CONFIDENCEPhase 07 β Analyst Report
Section titled βPhase 07 β Analyst ReportβGenerate:
EXECUTIVE SUMMARY
HIGH-RISK ASSETS
PRIVILEGED IDENTITIES
CRITICAL FINDINGS
AUTHENTICATION ANOMALIES
OPEN ALERTS
RECOMMENDED INVESTIGATIONSPhase 08 β Optional Dashboard
Section titled βPhase 08 β Optional DashboardβUse HTML and JavaScript to display:
Metrics
Findings
Assets
Alerts
Risk LevelsThe dashboard should consume sanitized report data rather than embed secrets.
Phase 09 β Logging
Section titled βPhase 09 β LoggingβThe entire workflow should log:
RUN ID
START
INPUT VALIDATION
RECORD COUNTS
WARNINGS
ERRORS
COMPLETIONPhase 10 β Testing
Section titled βPhase 10 β TestingβTest:
Missing Files
Empty Data
Malformed JSON
Invalid IPs
Duplicate Findings
Unavailable API
Missing User
Missing Asset
Unknown SeverityPhase 11 β Security Controls
Section titled βPhase 11 β Security ControlsβThe project must demonstrate:
LEAST PRIVILEGE
INPUT VALIDATION
NO HARD-CODED SECRETS
ERROR HANDLING
SAFE LOGGING
READ-ONLY COLLECTION WHERE POSSIBLE
HUMAN REVIEW
LIMITED BLAST RADIUSCapstone Deliverables
Section titled βCapstone DeliverablesβStudents should produce:
enterprise-security-automation/|+-- README.md|+-- architecture.md|+-- collectors/|+-- parsers/|+-- enrichment/|+-- database/|+-- reports/|+-- tests/|+-- sample-data/|+-- docs/Final artifacts:
Architecture Diagram
Source Code
Sample Dataset
SQL Queries
Security Report
Test Results
Runbook
Project READMEProgramming Labs Skill Progression
Section titled βProgramming Labs Skill Progressionβ| Lab | Primary Skill |
|---|---|
| Lab 01 | Python Log Analysis |
| Lab 02 | IOC Processing |
| Lab 03 | Bash Automation |
| Lab 04 | PowerShell Automation |
| Lab 05 | SQL Security Analytics |
| Lab 06 | Vulnerability Analysis |
| Lab 07 | API Integration |
| Lab 08 | Cloud Security Automation |
| Lab 09 | SOC Automation |
| Lab 10 | Enterprise Automation |
Lab Difficulty Progression
Section titled βLab Difficulty ProgressionβLAB 01BEGINNER βLAB 02BEGINNER+ βLAB 03INTERMEDIATE βLAB 04INTERMEDIATE βLAB 05INTERMEDIATE βLAB 06INTERMEDIATE+ βLAB 07INTERMEDIATE+ βLAB 08ADVANCED βLAB 09ADVANCED βLAB 10CAPSTONEWhat Students Should Have After Completing the Labs
Section titled βWhat Students Should Have After Completing the LabsβStudents should be able to demonstrate:
PYTHON SECURITY PROGRAMMING
LINUX AUTOMATION
WINDOWS AUTOMATION
SQL SECURITY ANALYSIS
API INTEGRATION
SECURITY DATA NORMALIZATION
SECURITY DATA CORRELATION
CLOUD SECURITY AUTOMATION
SOC AUTOMATION
ENTERPRISE WORKFLOW DESIGNMore importantly, they should understand:
WHEN TO AUTOMATE
HOW TO AUTOMATE SAFELY
HOW TO TEST AUTOMATION
HOW TO LIMIT PRIVILEGE
HOW TO HANDLE FAILURE
WHEN HUMAN REVIEW IS REQUIREDFinal Programming Labs Mental Model
Section titled βFinal Programming Labs Mental ModelβSECURITY PROBLEM βDATA βCODE βAUTOMATION βSECURITY CONTEXT βACTIONABLE RESULTBut professional automation adds:
VALIDATION
TESTING
LOGGING
LEAST PRIVILEGE
ERROR HANDLING
DOCUMENTATION
HUMAN OVERSIGHTTherefore:
GOOD CODE +SECURITY KNOWLEDGE +SAFE AUTOMATION =SECURITY ENGINEERINGWhatβs Next?
Section titled βWhatβs Next?ββ‘οΈ Lab 01 β Build a Security Log Analyzer
The first practical lab begins with the most important security-programming skill:
RAW SECURITY LOGS βPYTHON βPARSE βNORMALIZE βANALYZE βCORRELATE βREPORTYou will build the first complete programming-based security tool and convert raw authentication events into an analyst-ready investigation report.