# mmmphyun/aleph-project architecture

> Architecture diagram of the GitHub repository mmmphyun/aleph-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mmmphyun/aleph-project
- Repository: https://github.com/mmmphyun/aleph-project

## Overview

CloudShield is a hybrid-cloud threat-detection and automated-response pipeline. Its main workflow carries simulated or real attacks into target logs, streams those logs through CloudWatch to a Lambda orchestrator, accumulates events across batches, detects threats, applies infrastructure controls, and notifies SecOps in Slack. The graph also preserves the documented network-analysis and Terraform infrastructure branches. Some runtime calls and deployment wiring are documented in the README but their full implementations were not sampled; those links cite the README.

Main entry points: [`src/remediation/orchestrator.py`](https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/orchestrator.py) (Lambda Orchestrator), [`src/remediation/remediation.py`](https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/remediation.py) (Remediation Engine), [`src/reporter/slack_notifier.py`](https://github.com/mmmphyun/aleph-project/blob/main/src/reporter/slack_notifier.py) (Slack Notifier), [`src/contracts/incident.py`](https://github.com/mmmphyun/aleph-project/blob/main/src/contracts/incident.py) (Incident Contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Attack Simulation"]
  node_hydra_lab["Hydra Lab<br/>[hydra_lab.py]"]
  node_hydra_worker["Hydra Worker<br/>[hydra_worker.py]"]
  node_lab_runner["Lab Runner<br/>[run.py]"]
  node_sg_timeline["SG Timeline"]
  node_waf_timeline["WAF Timeline"]
end

subgraph group_telemetry["Log Collection"]
  node_target["Target EC2"]
  node_cw_agent["CloudWatch Agent"]
  node_cloudwatch["CloudWatch Logs"]
  node_collector["Log Processor<br/>[cw_processor.py]"]
  node_collection_latency["Collection Latency"]
end

subgraph group_detection["Detection and Contracts"]
  node_events["Event Contracts<br/>[events.py]"]
  node_rules["Signature Rules<br/>[rules.py]"]
  node_url_normalizer["URL Normalizer<br/>[url_normalizer.py]"]
  node_incident_mapper["Incident Mapper<br/>[incident_mapper.py]"]
  node_incident_contract["Incident Contract<br/>[incident.py]"]
end

subgraph group_response["Response and Reporting"]
  node_orchestrator["Lambda Orchestrator<br/>[orchestrator.py]"]
  node_auth_window["Auth Window<br/>[auth_window.py]"]
  node_web_window["Web Window<br/>[web_window.py]"]
  node_dynamodb[("DynamoDB")]
  node_remediation["Remediation Engine<br/>[remediation.py]"]
  node_slack["Slack Webhook"]
  node_slack_notifier["Slack Notifier<br/>[slack_notifier.py]"]
end

subgraph group_infrastructure["Cloud Infrastructure"]
  node_aws_controls["AWS Security Controls"]
  node_terraform["Terraform Infrastructure"]
end

node_attacker(("Attack Source"))

node_attacker -->|"sends attacks"| node_target
node_hydra_lab -->|"runs simulations"| node_attacker
node_target -->|"records logs"| node_cw_agent
node_cw_agent -->|"streams logs"| node_cloudwatch
node_cloudwatch -->|"triggers batches"| node_orchestrator
node_orchestrator -->|"decodes logs"| node_collector
node_collector -->|"parses payload"| node_events
node_orchestrator -->|"decodes payload"| node_events
node_orchestrator -->|"updates counts"| node_auth_window
node_orchestrator -->|"records web events"| node_web_window
node_auth_window -->|"persists counters"| node_dynamodb
node_web_window -->|"persists events"| node_dynamodb
node_orchestrator -->|"evaluates threats"| node_rules
node_rules -->|"normalizes paths"| node_url_normalizer
node_orchestrator -->|"maps detections"| node_incident_mapper
node_incident_mapper -->|"builds reports"| node_incident_contract
node_orchestrator -->|"requests controls"| node_remediation
node_remediation -->|"reads action"| node_incident_contract
node_remediation -->|"blocks or isolates"| node_aws_controls
node_orchestrator -->|"requests notification"| node_slack_notifier
node_slack_notifier -->|"renders report"| node_incident_contract
node_slack_notifier -->|"posts cards"| node_slack
node_terraform -->|"provisions services"| node_aws_controls
node_sg_timeline -.-> node_waf_timeline

click node_hydra_lab "https://github.com/mmmphyun/aleph-project/blob/main/network/lab/hydra_lab.py"
click node_hydra_worker "https://github.com/mmmphyun/aleph-project/blob/main/network/lab/hydra_worker.py"
click node_lab_runner "https://github.com/mmmphyun/aleph-project/blob/main/network/lab/run.py"
click node_sg_timeline "https://github.com/mmmphyun/aleph-project/blob/main/network/sg_connection_timeline.py"
click node_waf_timeline "https://github.com/mmmphyun/aleph-project/blob/main/network/waf_packet_timeline.py"
click node_cw_agent "https://github.com/mmmphyun/aleph-project/blob/main/src/collector/amazon-cloudwatch-agent.json"
click node_collector "https://github.com/mmmphyun/aleph-project/blob/main/src/collector/cw_processor.py"
click node_collection_latency "https://github.com/mmmphyun/aleph-project/blob/main/src/collector/collection_latency.py"
click node_orchestrator "https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/orchestrator.py"
click node_events "https://github.com/mmmphyun/aleph-project/blob/main/src/contracts/events.py"
click node_rules "https://github.com/mmmphyun/aleph-project/blob/main/src/detection/rules.py"
click node_url_normalizer "https://github.com/mmmphyun/aleph-project/blob/main/src/detection/url_normalizer.py"
click node_auth_window "https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/auth_window.py"
click node_web_window "https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/web_window.py"
click node_incident_mapper "https://github.com/mmmphyun/aleph-project/blob/main/src/detection/incident_mapper.py"
click node_incident_contract "https://github.com/mmmphyun/aleph-project/blob/main/src/contracts/incident.py"
click node_remediation "https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/remediation.py"
click node_slack_notifier "https://github.com/mmmphyun/aleph-project/blob/main/src/reporter/slack_notifier.py"
click node_terraform "https://github.com/mmmphyun/aleph-project/tree/main/infra/terraform"

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_hydra_lab,node_hydra_worker,node_lab_runner,node_sg_timeline,node_waf_timeline toneBlue
class node_target,node_cw_agent,node_cloudwatch,node_collector,node_collection_latency toneAmber
class node_events,node_rules,node_url_normalizer,node_incident_mapper,node_incident_contract toneMint
class node_orchestrator,node_auth_window,node_web_window,node_dynamodb,node_remediation,node_slack,node_slack_notifier toneRose
class node_aws_controls,node_terraform,node_attacker toneIndigo
```

## Components

### Attack Simulation

- [Hydra Lab](https://github.com/mmmphyun/aleph-project/blob/main/network/lab/hydra_lab.py): `network/lab/hydra_lab.py`
- [Hydra Worker](https://github.com/mmmphyun/aleph-project/blob/main/network/lab/hydra_worker.py): `network/lab/hydra_worker.py`
- [Lab Runner](https://github.com/mmmphyun/aleph-project/blob/main/network/lab/run.py): `network/lab/run.py`
- [SG Timeline](https://github.com/mmmphyun/aleph-project/blob/main/network/sg_connection_timeline.py): `network/sg_connection_timeline.py`
- [WAF Timeline](https://github.com/mmmphyun/aleph-project/blob/main/network/waf_packet_timeline.py): `network/waf_packet_timeline.py`

### Log Collection

- **Target EC2**
- [CloudWatch Agent](https://github.com/mmmphyun/aleph-project/blob/main/src/collector/amazon-cloudwatch-agent.json): `src/collector/amazon-cloudwatch-agent.json`
- **CloudWatch Logs**
- [Log Processor](https://github.com/mmmphyun/aleph-project/blob/main/src/collector/cw_processor.py): `src/collector/cw_processor.py`
- [Collection Latency](https://github.com/mmmphyun/aleph-project/blob/main/src/collector/collection_latency.py): `src/collector/collection_latency.py`

### Detection and Contracts

- [Event Contracts](https://github.com/mmmphyun/aleph-project/blob/main/src/contracts/events.py): `src/contracts/events.py`
- [Signature Rules](https://github.com/mmmphyun/aleph-project/blob/main/src/detection/rules.py): `src/detection/rules.py`
- [URL Normalizer](https://github.com/mmmphyun/aleph-project/blob/main/src/detection/url_normalizer.py): `src/detection/url_normalizer.py`
- [Incident Mapper](https://github.com/mmmphyun/aleph-project/blob/main/src/detection/incident_mapper.py): `src/detection/incident_mapper.py`
- [Incident Contract](https://github.com/mmmphyun/aleph-project/blob/main/src/contracts/incident.py): `src/contracts/incident.py`

### Response and Reporting

- [Lambda Orchestrator](https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/orchestrator.py): `src/remediation/orchestrator.py`
- [Auth Window](https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/auth_window.py): `src/remediation/auth_window.py`
- [Web Window](https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/web_window.py): `src/remediation/web_window.py`
- **DynamoDB**
- [Remediation Engine](https://github.com/mmmphyun/aleph-project/blob/main/src/remediation/remediation.py): `src/remediation/remediation.py`
- **Slack Webhook**
- [Slack Notifier](https://github.com/mmmphyun/aleph-project/blob/main/src/reporter/slack_notifier.py): `src/reporter/slack_notifier.py`

### Cloud Infrastructure

- **AWS Security Controls**
- [Terraform Infrastructure](https://github.com/mmmphyun/aleph-project/tree/main/infra/terraform): `infra/terraform`

### Other components

- **Attack Source**

## Connections

- Attack Source → Target EC2: sends attacks (evidence: `README.md`)
- Hydra Lab → Attack Source: runs simulations (evidence: `README.md`)
- Target EC2 → CloudWatch Agent: records logs (evidence: `README.md`)
- CloudWatch Agent → CloudWatch Logs: streams logs (evidence: `README.md`)
- CloudWatch Logs → Lambda Orchestrator: triggers batches (evidence: `README.md`)
- Lambda Orchestrator → Log Processor: decodes logs (evidence: `README.md`)
- Log Processor → Event Contracts: parses payload (evidence: `src/collector/cw_processor.py`)
- Lambda Orchestrator → Event Contracts: decodes payload (evidence: `src/remediation/orchestrator.py`)
- Lambda Orchestrator → Auth Window: updates counts (evidence: `src/remediation/orchestrator.py`)
- Lambda Orchestrator → Web Window: records web events (evidence: `src/remediation/orchestrator.py`)
- Auth Window → DynamoDB: persists counters (evidence: `README.md`)
- Web Window → DynamoDB: persists events (evidence: `src/remediation/web_window.py`)
- Lambda Orchestrator → Signature Rules: evaluates threats (evidence: `README.md`)
- Signature Rules → URL Normalizer: normalizes paths (evidence: `src/detection/rules.py`)
- Lambda Orchestrator → Incident Mapper: maps detections (evidence: `README.md`)
- Incident Mapper → Incident Contract: builds reports (evidence: `src/detection/incident_mapper.py`)
- Lambda Orchestrator → Remediation Engine: requests controls (evidence: `README.md`)
- Remediation Engine → Incident Contract: reads action (evidence: `src/remediation/remediation.py`)
- Remediation Engine → AWS Security Controls: blocks or isolates (evidence: `README.md`)
- Lambda Orchestrator → Slack Notifier: requests notification (evidence: `README.md`)
- Slack Notifier → Incident Contract: renders report (evidence: `src/reporter/slack_notifier.py`)
- Slack Notifier → Slack Webhook: posts cards (evidence: `README.md`)
- Terraform Infrastructure → AWS Security Controls: provisions services (evidence: `README.md`)
- SG Timeline → WAF Timeline (evidence: `network/sg_connection_timeline.py`)
