# aditya0x53/zero-trust-browser-gateway architecture

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

- Interactive diagram: https://gitdiagram.com/aditya0x53/zero-trust-browser-gateway
- Repository: https://github.com/aditya0x53/zero-trust-browser-gateway

## Overview

The product is a Zero Trust forward proxy for detecting evasive JavaScript threats. Its main workflow intercepts client traffic, analyzes pages in headless Chromium, derives behavioral features, scores risk, and applies allow/block/quarantine policy; traffic and decisions are logged for dashboard review. The graph also preserves documented analysis capabilities and model training. Some subsystem links come from the README rather than sampled call sites; unsampled components are included only where the README or source index supports them.

Main entry points: [`proxy/forward_proxy.py`](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/proxy/forward_proxy.py) (Forward proxy), [`policy/policy_engine.py`](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/policy/policy_engine.py) (Policy engine), [`feature_engine/feature_extractor.py`](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/feature_engine/feature_extractor.py) (Feature extractor), [`browser_analyser/analyser_service.py`](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/analyser_service.py) (Browser analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["Traffic ingress"]
  node_proxy["Forward proxy<br/>[forward_proxy.py]"]
end

subgraph group_detection["Behavioral detection"]
  node_analyzer["Browser analyzer"]
  node_entropy["Entropy analysis"]
  node_graph_analysis["Graph analysis<br/>[graph_analyzer.py]"]
  node_anomaly["Anomaly detection"]
  node_extractor["Feature extractor"]
  node_plugins["Feature plugins<br/>[plugin_manager.py]"]
end

subgraph group_decision["Risk and policy"]
  node_scorer["Risk scorer<br/>[risk_scorer.py]"]
  node_trainer["Model training<br/>[Train.py]"]
  node_policy["Policy engine<br/>[policy_engine.py]"]
  node_quarantine[("Quarantine records")]
end

subgraph group_operations["Operations and review"]
  node_traffic_logger[("Traffic logger<br/>[traffic_logger.py]")]
  node_dashboard["Management dashboard<br/>[dashboard_app.py]"]
  node_blocked_page["Blocked page<br/>[blocked.html]"]
end

subgraph group_foundation["Shared infrastructure"]
  node_config["Configuration loader<br/>[config_loader.py]"]
  node_logging["Logging setup<br/>[logging_setup.py]"]
end

node_client(("Browser / client"))

node_client -->|"sends traffic"| node_proxy
node_proxy -->|"requests analysis"| node_analyzer
node_analyzer -->|"reports behavior"| node_extractor
node_extractor -->|"provides features"| node_scorer
node_scorer -->|"provides risk"| node_policy
node_policy -->|"extracts features"| node_extractor
node_policy -->|"scores features"| node_scorer
node_policy -->|"writes records"| node_quarantine
node_proxy -->|"requests decision"| node_policy
node_proxy -->|"logs traffic"| node_traffic_logger
node_dashboard -->|"reads traffic"| node_traffic_logger
node_policy -->|"returns action"| node_proxy
node_policy -->|"serves on block"| node_blocked_page
node_analyzer -->|"analyzes scripts"| node_entropy
node_extractor -->|"derives graph features"| node_graph_analysis
node_analyzer -.->|"uses detection"| node_anomaly
node_extractor -.->|"loads extensions"| node_plugins
node_trainer -->|"uses features"| node_extractor
node_proxy -->|"loads settings"| node_config
node_analyzer -->|"loads settings"| node_config
node_proxy -->|"uses logging"| node_logging
node_extractor -->|"uses logging"| node_logging

click node_proxy "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/proxy/forward_proxy.py"
click node_analyzer "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/analyser_service.py"
click node_entropy "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/entropy_analyzer.py"
click node_graph_analysis "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/graph_analyzer.py"
click node_anomaly "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/anomaly_detector.py"
click node_extractor "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/feature_engine/feature_extractor.py"
click node_plugins "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/feature_engine/plugin_manager.py"
click node_scorer "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/ml_model/risk_scorer.py"
click node_trainer "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/ml_model/Train.py"
click node_policy "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/policy/policy_engine.py"
click node_quarantine "https://github.com/aditya0x53/zero-trust-browser-gateway/tree/main/quarantine"
click node_traffic_logger "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/proxy/traffic_logger.py"
click node_dashboard "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/dashboard/dashboard_app.py"
click node_blocked_page "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/dashboard/templates/blocked.html"
click node_config "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/config/config_loader.py"
click node_logging "https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/config/logging_setup.py"

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_proxy,node_client toneBlue
class node_analyzer,node_entropy,node_graph_analysis,node_anomaly,node_extractor,node_plugins toneAmber
class node_scorer,node_trainer,node_policy,node_quarantine toneMint
class node_traffic_logger,node_dashboard,node_blocked_page toneRose
class node_config,node_logging toneIndigo
```

## Components

### Traffic ingress

- [Forward proxy](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/proxy/forward_proxy.py): `proxy/forward_proxy.py`

### Behavioral detection

- [Browser analyzer](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/analyser_service.py): `browser_analyser/analyser_service.py`
- [Entropy analysis](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/entropy_analyzer.py): `browser_analyser/entropy_analyzer.py`
- [Graph analysis](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/graph_analyzer.py): `browser_analyser/graph_analyzer.py`
- [Anomaly detection](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/browser_analyser/anomaly_detector.py): `browser_analyser/anomaly_detector.py`
- [Feature extractor](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/feature_engine/feature_extractor.py): `feature_engine/feature_extractor.py`
- [Feature plugins](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/feature_engine/plugin_manager.py): `feature_engine/plugin_manager.py`

### Risk and policy

- [Risk scorer](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/ml_model/risk_scorer.py): `ml_model/risk_scorer.py`
- [Model training](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/ml_model/Train.py): `ml_model/Train.py`
- [Policy engine](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/policy/policy_engine.py): `policy/policy_engine.py`
- [Quarantine records](https://github.com/aditya0x53/zero-trust-browser-gateway/tree/main/quarantine): `quarantine`

### Operations and review

- [Traffic logger](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/proxy/traffic_logger.py): `proxy/traffic_logger.py`
- [Management dashboard](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/dashboard/dashboard_app.py): `dashboard/dashboard_app.py`
- [Blocked page](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/dashboard/templates/blocked.html): `dashboard/templates/blocked.html`

### Shared infrastructure

- [Configuration loader](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/config/config_loader.py): `config/config_loader.py`
- [Logging setup](https://github.com/aditya0x53/zero-trust-browser-gateway/blob/main/config/logging_setup.py): `config/logging_setup.py`

### Other components

- **Browser / client**

## Connections

- Browser / client → Forward proxy: sends traffic (evidence: `README.md`)
- Forward proxy → Browser analyzer: requests analysis (evidence: `proxy/forward_proxy.py`)
- Browser analyzer → Feature extractor: reports behavior (evidence: `README.md`)
- Feature extractor → Risk scorer: provides features (evidence: `README.md`)
- Risk scorer → Policy engine: provides risk (evidence: `README.md`)
- Policy engine → Feature extractor: extracts features (evidence: `policy/policy_engine.py`)
- Policy engine → Risk scorer: scores features (evidence: `policy/policy_engine.py`)
- Policy engine → Quarantine records: writes records (evidence: `policy/policy_engine.py`)
- Forward proxy → Policy engine: requests decision (evidence: `README.md`)
- Forward proxy → Traffic logger: logs traffic (evidence: `proxy/forward_proxy.py`)
- Management dashboard → Traffic logger: reads traffic (evidence: `dashboard/dashboard_app.py`)
- Policy engine → Forward proxy: returns action (evidence: `README.md`)
- Policy engine → Blocked page: serves on block (evidence: `README.md`)
- Browser analyzer → Entropy analysis: analyzes scripts (evidence: `README.md`)
- Feature extractor → Graph analysis: derives graph features (evidence: `README.md`)
- Browser analyzer → Anomaly detection: uses detection (evidence: `README.md`)
- Feature extractor → Feature plugins: loads extensions (evidence: `README.md`)
- Model training → Feature extractor: uses features (evidence: `ml_model/Train.py`)
- Forward proxy → Configuration loader: loads settings (evidence: `proxy/forward_proxy.py`)
- Browser analyzer → Configuration loader: loads settings (evidence: `browser_analyser/analyser_service.py`)
- Forward proxy → Logging setup: uses logging (evidence: `proxy/forward_proxy.py`)
- Feature extractor → Logging setup: uses logging (evidence: `feature_engine/feature_extractor.py`)
