# hany-hosny/enterprise-docker-security-scanning-isolation architecture

> Architecture diagram of the GitHub repository hany-hosny/enterprise-docker-security-scanning-isolation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hany-hosny/enterprise-docker-security-scanning-isolation
- Repository: https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation

## Overview

This repository is a small container-security lab: an operator reaches a Python HTTP app, which exposes liveness, readiness, and persistent visit-counter behavior backed by MariaDB. The Compose topology and image definitions apply the isolation and hardening controls; MariaDB state persists in a named volume. Separate operational capabilities generate Trivy reports and validate static configuration or a running deployment. The app-to-database calls are visible in app.py; deployment, scanner, and validation relationships are documented in the README, while their implementations were not sampled.

Main entry points: [`app.py`](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/app.py) (HTTP counter app), [`compose.yaml`](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/compose.yaml) (MariaDB service), [`scripts/verify-runtime.py`](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/verify-runtime.py) (Runtime inspection), [`Dockerfile`](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/Dockerfile) (Hardened image build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Lab runtime"]
  node_app["HTTP counter app<br/>[app.py]"]
  node_database[("MariaDB service<br/>[compose.yaml]")]
  node_volume[("Persistent DB volume<br/>[compose.yaml]")]
end

subgraph group_hardening["Container hardening"]
  node_topology["Compose topology<br/>[compose.yaml]"]
  node_image["Hardened image build"]
  node_secrets["Runtime secrets<br/>[compose.sh]"]
end

subgraph group_operations["Security operations"]
  node_scan["Image scanner<br/>[scan-images.sh]"]
  node_reports["Trivy reports"]
  node_summary["Finding summary<br/>[summarize-trivy.py]"]
end

subgraph group_checks["Validation"]
  node_static["Static validation<br/>[validate-static.sh]"]
  node_composecheck["Compose checks"]
  node_runtimecheck["Runtime inspection<br/>[verify-runtime.py]"]
  node_smoke["HTTP smoke test<br/>[smoke-test.sh]"]
end

node_operator(("Host operator"))

node_operator -->|"sends HTTP requests"| node_app
node_app -->|"queries counter"| node_database
node_database -->|"persists data"| node_volume
node_topology -->|"configures service"| node_app
node_topology -->|"configures service"| node_database
node_image -->|"builds runtime"| node_app
node_secrets -->|"supplies secrets"| node_topology
node_scan -->|"writes reports"| node_reports
node_summary -->|"reads reports"| node_reports
node_static -->|"runs checks"| node_composecheck
node_runtimecheck -->|"inspects container"| node_app
node_runtimecheck -->|"inspects container"| node_database
node_smoke -->|"tests endpoints"| node_app

click node_app "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/app.py"
click node_database "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/compose.yaml"
click node_volume "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/compose.yaml"
click node_topology "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/compose.yaml"
click node_image "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/Dockerfile"
click node_secrets "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/compose.sh"
click node_scan "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/scan-images.sh"
click node_summary "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/summarize-trivy.py"
click node_static "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/validate-static.sh"
click node_composecheck "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/validate-compose.py"
click node_runtimecheck "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/verify-runtime.py"
click node_smoke "https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/smoke-test.sh"

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_app,node_database,node_volume toneBlue
class node_topology,node_image,node_secrets toneAmber
class node_scan,node_reports,node_summary toneMint
class node_static,node_composecheck,node_runtimecheck,node_smoke toneRose
class node_operator toneIndigo
```

## Components

### Lab runtime

- [HTTP counter app](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/app.py): `app.py`
- [MariaDB service](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/compose.yaml): `compose.yaml`
- [Persistent DB volume](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/compose.yaml): `compose.yaml`

### Container hardening

- [Compose topology](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/compose.yaml): `compose.yaml`
- [Hardened image build](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/Dockerfile): `Dockerfile`
- [Runtime secrets](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/compose.sh): `scripts/compose.sh`

### Security operations

- [Image scanner](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/scan-images.sh): `scripts/scan-images.sh`
- **Trivy reports**
- [Finding summary](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/summarize-trivy.py): `scripts/summarize-trivy.py`

### Validation

- [Static validation](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/validate-static.sh): `scripts/validate-static.sh`
- [Compose checks](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/validate-compose.py): `scripts/validate-compose.py`
- [Runtime inspection](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/verify-runtime.py): `scripts/verify-runtime.py`
- [HTTP smoke test](https://github.com/hany-hosny/enterprise-docker-security-scanning-isolation/blob/main/scripts/smoke-test.sh): `scripts/smoke-test.sh`

### Other components

- **Host operator**

## Connections

- Host operator → HTTP counter app: sends HTTP requests (evidence: `README.md`)
- HTTP counter app → MariaDB service: queries counter (evidence: `app.py`)
- MariaDB service → Persistent DB volume: persists data (evidence: `README.md`)
- Compose topology → HTTP counter app: configures service (evidence: `README.md`)
- Compose topology → MariaDB service: configures service (evidence: `README.md`)
- Hardened image build → HTTP counter app: builds runtime (evidence: `README.md`)
- Runtime secrets → Compose topology: supplies secrets (evidence: `README.md`)
- Image scanner → Trivy reports: writes reports (evidence: `README.md`)
- Finding summary → Trivy reports: reads reports (evidence: `README.md`)
- Static validation → Compose checks: runs checks (evidence: `README.md`)
- Runtime inspection → HTTP counter app: inspects container (evidence: `README.md`)
- Runtime inspection → MariaDB service: inspects container (evidence: `README.md`)
- HTTP smoke test → HTTP counter app: tests endpoints (evidence: `README.md`)
