# eseigbeihinosen/soc-powershell-labs architecture

> Architecture diagram of the GitHub repository eseigbeihinosen/soc-powershell-labs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eseigbeihinosen/soc-powershell-labs
- Repository: https://github.com/eseigbeihinosen/soc-powershell-labs

## Overview

#### Purpose and execution model
SOC-PowerShell-Labs is a collection of independent Windows PowerShell monitoring exercises for SOC investigation and learning. There is no shared application host or orchestrator: operators invoke scripts directly from `scripts/`, and each script reads local Windows state, produces local reports/logs, or runs until manually stopped.

#### Security event collection and reporting
The log-analysis scripts query Windows Security events and transform them into CSV-oriented investigation outputs:
- `scripts/log-analysis/event-log-monitor.ps1` collects login success, login failure, and administrative-privilege events.
- `scripts/log-analysis/failed-login-analysis.ps1` analyzes Event ID 4625 over the prior seven days, aggregates failures by user, and flags a brute-force threshold of five or more attempts.
- `scripts/log-analysis/user-activity-report.ps1` records logon/logoff activity with event type, timestamp, user, and source.

Boundary: these depend on the local Windows event-log subsystem and potentially on permissions to read Security logs. Outputs are written under the Git-ignored Logs area.

#### File-integrity baseline and comparison
`scripts/file-monitoring/file-integrity-check.ps1` implements a two-stage integrity workflow:
1. `-Mode baseline` recursively captures monitored-file SHA-256 hashes into a CSV baseline within the target folder.
2. `-Mode check` recomputes hashes and compares current contents to that baseline, classifying modified, newly added, and missing files.

The monitored filesystem path is an explicit operator input. Storing the baseline beside monitored content is an important trust boundary: baseline protection determines the reliability of later change reports.

#### Process lifecycle monitoring
`scripts/process-monitoring/process-monitor.ps1` is a continuous local-process observer. It polls/runs repeatedly to identify process starts and stops, correlating events with timestamps, names, and PIDs. It writes a default append-style operational log to `C:\Temp\ProcessMonitorLog.txt`.

Its boundary is the local Windows process table; PID reuse and multi-process applications can affect interpretation. The loop is operator-controlled and stops with Ctrl+C.

#### Network connection monitoring
`scripts/network-monitoring/connection-monitor.ps1` continuously captures local TCP and UDP connection state. Each interval, it records local/remote addressing, ports, TCP state where applicable, and owning PID, allowing analysts to correlate network activity with processes. The documented default interval is 30 seconds, and output is `scripts\Logs\NetworkConnections.log`.

This stage depends on Windows networking/connection inspection facilities. It observes endpoint metadata rather than packet contents or remote-service identity.

#### Storage, privacy, and operational boundaries
Generated Logs content is excluded by `.gitignore`, separating potentially sensitive endpoint telemetry from source control. CSV serves as the interchange/reporting format for event and file workflows; plaintext logs serve continuous process and network workflows. The repository has no cloud services, databases, agents, or centralized ingestion pipeline: all collection, analysis, storage, and review occur on the executing Windows host.

Main entry points: [`scripts/file-monitoring/file-integrity-check.ps1`](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/file-monitoring/file-integrity-check.ps1) (Integrity check), [`scripts/log-analysis/event-log-monitor.ps1`](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/event-log-monitor.ps1) (Event log monitor), [`scripts/log-analysis/failed-login-analysis.ps1`](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/failed-login-analysis.ps1) (Failed login analysis), [`scripts/log-analysis/user-activity-report.ps1`](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/user-activity-report.ps1) (User activity report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_event["Security event reporting"]
  node_windows_security[("Windows Security logs<br/>Windows subsystem")]
  node_event_monitor["Event log monitor<br/>PowerShell script"]
  node_failed_login["Failed login analysis<br/>PowerShell script"]
  node_failure_aggregation["Failure aggregation<br/>analysis stage"]
  node_activity_report["User activity report<br/>PowerShell script"]
  node_event_csv["Event CSV reports<br/>local CSV output"]
end

subgraph group_integrity["File integrity"]
  node_target_files[("Monitored filesystem<br/>operator-selected path")]
  node_integrity_check["Integrity check<br/>PowerShell script"]
  node_hash_baseline["Hash baseline CSV<br/>local CSV baseline"]
  node_change_report["File change report<br/>local CSV output"]
end

subgraph group_continuous["Continuous monitors"]
  node_process_table[("Windows process table<br/>Windows subsystem")]
  node_process_monitor["Process monitor<br/>PowerShell script"]
  node_process_log["Process monitor log<br/>append log"]
  node_network_inspection[("Windows connection inspection<br/>Windows subsystem")]
  node_connection_monitor["Connection monitor<br/>PowerShell script"]
  node_network_log["Network connections log<br/>append log"]
end

node_operator(("SOC operator<br/>user"))
node_gitignore["Git ignore rules<br/>source-control boundary<br/>[.gitignore]"]

node_operator -->|"runs"| node_event_monitor
node_operator -->|"runs"| node_failed_login
node_operator -->|"runs"| node_activity_report
node_operator -->|"runs with mode and target"| node_integrity_check
node_operator -->|"runs / stops"| node_process_monitor
node_operator -->|"runs / stops"| node_connection_monitor
node_windows_security -->|"security events"| node_event_monitor
node_windows_security -->|"Event ID 4625"| node_failed_login
node_windows_security -->|"logon/logoff events"| node_activity_report
node_event_monitor -->|"writes"| node_event_csv
node_failed_login -->|"transforms"| node_failure_aggregation
node_failure_aggregation -->|"writes findings"| node_event_csv
node_activity_report -->|"writes"| node_event_csv
node_target_files -->|"hashes recursively"| node_integrity_check
node_integrity_check -->|"baseline mode writes"| node_hash_baseline
node_hash_baseline -->|"check mode compares"| node_integrity_check
node_integrity_check -->|"writes classifications"| node_change_report
node_process_table -->|"process state"| node_process_monitor
node_process_monitor -->|"appends"| node_process_log
node_network_inspection -->|"TCP/UDP state"| node_connection_monitor
node_connection_monitor -->|"appends"| node_network_log
node_gitignore -.->|"excludes Logs output"| node_event_csv
node_gitignore -.->|"excludes Logs output"| node_network_log

click node_event_monitor "https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/event-log-monitor.ps1"
click node_failed_login "https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/failed-login-analysis.ps1"
click node_activity_report "https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/user-activity-report.ps1"
click node_integrity_check "https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/file-monitoring/file-integrity-check.ps1"
click node_process_monitor "https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/process-monitoring/process-monitor.ps1"
click node_connection_monitor "https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/network-monitoring/connection-monitor.ps1"
click node_gitignore "https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/.gitignore"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_windows_security,node_event_monitor,node_failed_login,node_failure_aggregation,node_activity_report,node_event_csv toneBlue
class node_target_files,node_integrity_check,node_hash_baseline,node_change_report toneAmber
class node_process_table,node_process_monitor,node_process_log,node_network_inspection,node_connection_monitor,node_network_log toneMint
class node_operator,node_gitignore toneNeutral
```

## Components

### Security event reporting

- **Windows Security logs**: Windows subsystem · Security-log access may require permissions.
- [Event log monitor](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/event-log-monitor.ps1): PowerShell script · Collects login and privilege events. · `scripts/log-analysis/event-log-monitor.ps1`
- [Failed login analysis](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/failed-login-analysis.ps1): PowerShell script · Analyzes seven days of Event ID 4625 data. · `scripts/log-analysis/failed-login-analysis.ps1`
- **Failure aggregation**: analysis stage · Groups failures by user and flags five or more attempts.
- [User activity report](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/log-analysis/user-activity-report.ps1): PowerShell script · Records logon and logoff activity. · `scripts/log-analysis/user-activity-report.ps1`
- **Event CSV reports**: local CSV output · Investigation-oriented local reports.

### File integrity

- **Monitored filesystem**: operator-selected path · The target folder is an explicit input.
- [Integrity check](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/file-monitoring/file-integrity-check.ps1): PowerShell script · Runs baseline or check mode with SHA-256 hashes. · `scripts/file-monitoring/file-integrity-check.ps1`
- **Hash baseline CSV**: local CSV baseline · Stored beside monitored content; its protection is a trust boundary.
- **File change report**: local CSV output · Classifies modified, added, and missing files.

### Continuous monitors

- **Windows process table**: Windows subsystem · PID reuse and multi-process applications affect interpretation.
- [Process monitor](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/process-monitoring/process-monitor.ps1): PowerShell script · Continuously detects process starts and stops until Ctrl+C. · `scripts/process-monitoring/process-monitor.ps1`
- **Process monitor log**: append log · Written to the local C:\Temp path.
- **Windows connection inspection**: Windows subsystem · Provides endpoint metadata, not packet contents or remote identity.
- [Connection monitor](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/scripts/network-monitoring/connection-monitor.ps1): PowerShell script · Polls TCP and UDP connections at a 30-second default interval. · `scripts/network-monitoring/connection-monitor.ps1`
- **Network connections log**: append log · Written under the local Logs area.

### Other components

- **SOC operator**: user · Invokes and stops scripts locally.
- [Git ignore rules](https://github.com/eseigbeihinosen/soc-powershell-labs/blob/main/.gitignore): source-control boundary · Excludes generated Logs telemetry from source control. · `.gitignore`

## Connections

- SOC operator → Event log monitor: runs
- SOC operator → Failed login analysis: runs
- SOC operator → User activity report: runs
- SOC operator → Integrity check: runs with mode and target
- SOC operator → Process monitor: runs / stops
- SOC operator → Connection monitor: runs / stops
- Windows Security logs → Event log monitor: security events
- Windows Security logs → Failed login analysis: Event ID 4625
- Windows Security logs → User activity report: logon/logoff events
- Event log monitor → Event CSV reports: writes
- Failed login analysis → Failure aggregation: transforms
- Failure aggregation → Event CSV reports: writes findings
- User activity report → Event CSV reports: writes
- Monitored filesystem → Integrity check: hashes recursively
- Integrity check → Hash baseline CSV: baseline mode writes
- Hash baseline CSV → Integrity check: check mode compares
- Integrity check → File change report: writes classifications
- Windows process table → Process monitor: process state
- Process monitor → Process monitor log: appends
- Windows connection inspection → Connection monitor: TCP/UDP state
- Connection monitor → Network connections log: appends
- Git ignore rules → Event CSV reports: excludes Logs output
- Git ignore rules → Network connections log: excludes Logs output
