# subhankit18/secureme-sih26155 architecture

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

- Interactive diagram: https://gitdiagram.com/subhankit18/secureme-sih26155
- Repository: https://github.com/subhankit18/secureme-sih26155

## Overview

SECUREME audits uploaded network-device configuration files without connecting to or executing commands on devices. The principal workflow is upload, deterministic vendor detection, vendor-specific parsing into normalized controls, validation, deterministic PASS/FAIL evaluation with risk and evidence, then optional Groq explanations and a report. The product also exposes review approval and re-audit, persisted audit history, and PDF downloads. The README documents the core workflow; source excerpts show API and persistence behavior, but some pipeline and reporting internals were not sampled.

Main entry points: [`app/pipeline.py`](https://github.com/subhankit18/secureme-sih26155/blob/main/app/pipeline.py) (Audit Pipeline), [`web_api.py`](https://github.com/subhankit18/secureme-sih26155/blob/main/web_api.py) (Web API), [`app/compliance.py`](https://github.com/subhankit18/secureme-sih26155/blob/main/app/compliance.py) (Compliance Evaluation), [`app/reaudit.py`](https://github.com/subhankit18/secureme-sih26155/blob/main/app/reaudit.py) (Re-audit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_webapi["Web API<br/>[web_api.py]"]
  node_frontend["Web Frontend<br/>[index.html]"]
end

subgraph group_analysis["Configuration Analysis"]
  node_pipeline["Audit Pipeline<br/>[pipeline.py]"]
  node_detect["Vendor Detection"]
  node_cisco["Cisco Parser<br/>[cisco.py]"]
  node_fortinet["Fortinet Parser<br/>[fortinet.py]"]
  node_normalized["Normalized Models<br/>[models.py]"]
  node_validation["Config Validation<br/>[normalizer.py]"]
  node_controls["Demo Controls<br/>[controls.json]"]
  node_compliance["Compliance Evaluation<br/>[compliance.py]"]
  node_risk["Risk Scoring<br/>[risk_scoring.py]"]
  node_groq["AI Assistance<br/>[groq_service.py]"]
end

subgraph group_review["Review and Reports"]
  node_reaudit["Re-audit<br/>[reaudit.py]"]
  node_pdf["PDF Report<br/>[pdf_report.py]"]
  node_terminal["Terminal Report<br/>[pipeline.py]"]
end

subgraph group_storage["Audit Persistence"]
  node_database["Database Session<br/>[database.py]"]
  node_records[("Audit Records<br/>[db_models.py]")]
end

node_operator(("Security Analyst"))

node_operator -->|"uses"| node_frontend
node_operator -->|"uploads config"| node_webapi
node_webapi -->|"serves"| node_frontend
node_webapi -->|"runs analysis"| node_pipeline
node_pipeline -->|"detects vendor"| node_detect
node_pipeline -->|"parses Cisco"| node_cisco
node_pipeline -->|"parses Fortinet"| node_fortinet
node_cisco -->|"builds config"| node_normalized
node_fortinet -->|"builds config"| node_normalized
node_pipeline -->|"validates config"| node_validation
node_pipeline -->|"evaluates controls"| node_compliance
node_compliance -->|"loads rules"| node_controls
node_compliance -->|"scores failures"| node_risk
node_pipeline -->|"requests enrichment"| node_groq
node_pipeline -->|"persists results"| node_database
node_database -->|"provides base"| node_records
node_webapi -->|"uses session"| node_database
node_webapi -->|"reads reviews"| node_records
node_webapi -->|"requests re-audit"| node_reaudit
node_reaudit -->|"reevaluates controls"| node_compliance
node_reaudit -->|"reads and writes"| node_records
node_webapi -->|"builds download"| node_pdf
node_pipeline -->|"prints report"| node_terminal

click node_webapi "https://github.com/subhankit18/secureme-sih26155/blob/main/web_api.py"
click node_frontend "https://github.com/subhankit18/secureme-sih26155/blob/main/frontend/index.html"
click node_pipeline "https://github.com/subhankit18/secureme-sih26155/blob/main/app/pipeline.py"
click node_detect "https://github.com/subhankit18/secureme-sih26155/blob/main/app/vendor_detection.py"
click node_cisco "https://github.com/subhankit18/secureme-sih26155/blob/main/app/parsers/cisco.py"
click node_fortinet "https://github.com/subhankit18/secureme-sih26155/blob/main/app/parsers/fortinet.py"
click node_normalized "https://github.com/subhankit18/secureme-sih26155/blob/main/app/models.py"
click node_validation "https://github.com/subhankit18/secureme-sih26155/blob/main/app/normalizer.py"
click node_controls "https://github.com/subhankit18/secureme-sih26155/blob/main/config/controls.json"
click node_compliance "https://github.com/subhankit18/secureme-sih26155/blob/main/app/compliance.py"
click node_risk "https://github.com/subhankit18/secureme-sih26155/blob/main/app/risk_scoring.py"
click node_groq "https://github.com/subhankit18/secureme-sih26155/blob/main/app/ai/groq_service.py"
click node_database "https://github.com/subhankit18/secureme-sih26155/blob/main/app/database.py"
click node_records "https://github.com/subhankit18/secureme-sih26155/blob/main/app/db_models.py"
click node_reaudit "https://github.com/subhankit18/secureme-sih26155/blob/main/app/reaudit.py"
click node_pdf "https://github.com/subhankit18/secureme-sih26155/blob/main/app/pdf_report.py"
click node_terminal "https://github.com/subhankit18/secureme-sih26155/blob/main/app/pipeline.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_webapi,node_frontend toneBlue
class node_pipeline,node_detect,node_cisco,node_fortinet,node_normalized,node_validation,node_controls,node_compliance,node_risk,node_groq toneAmber
class node_reaudit,node_pdf,node_terminal toneMint
class node_database,node_records toneRose
class node_operator toneIndigo
```

## Components

### User Interface

- [Web API](https://github.com/subhankit18/secureme-sih26155/blob/main/web_api.py): `web_api.py`
- [Web Frontend](https://github.com/subhankit18/secureme-sih26155/blob/main/frontend/index.html): `frontend/index.html`

### Configuration Analysis

- [Audit Pipeline](https://github.com/subhankit18/secureme-sih26155/blob/main/app/pipeline.py): `app/pipeline.py`
- [Vendor Detection](https://github.com/subhankit18/secureme-sih26155/blob/main/app/vendor_detection.py): `app/vendor_detection.py`
- [Cisco Parser](https://github.com/subhankit18/secureme-sih26155/blob/main/app/parsers/cisco.py): `app/parsers/cisco.py`
- [Fortinet Parser](https://github.com/subhankit18/secureme-sih26155/blob/main/app/parsers/fortinet.py): `app/parsers/fortinet.py`
- [Normalized Models](https://github.com/subhankit18/secureme-sih26155/blob/main/app/models.py): `app/models.py`
- [Config Validation](https://github.com/subhankit18/secureme-sih26155/blob/main/app/normalizer.py): `app/normalizer.py`
- [Demo Controls](https://github.com/subhankit18/secureme-sih26155/blob/main/config/controls.json): `config/controls.json`
- [Compliance Evaluation](https://github.com/subhankit18/secureme-sih26155/blob/main/app/compliance.py): `app/compliance.py`
- [Risk Scoring](https://github.com/subhankit18/secureme-sih26155/blob/main/app/risk_scoring.py): `app/risk_scoring.py`
- [AI Assistance](https://github.com/subhankit18/secureme-sih26155/blob/main/app/ai/groq_service.py): `app/ai/groq_service.py`

### Review and Reports

- [Re-audit](https://github.com/subhankit18/secureme-sih26155/blob/main/app/reaudit.py): `app/reaudit.py`
- [PDF Report](https://github.com/subhankit18/secureme-sih26155/blob/main/app/pdf_report.py): `app/pdf_report.py`
- [Terminal Report](https://github.com/subhankit18/secureme-sih26155/blob/main/app/pipeline.py): `app/pipeline.py`

### Audit Persistence

- [Database Session](https://github.com/subhankit18/secureme-sih26155/blob/main/app/database.py): `app/database.py`
- [Audit Records](https://github.com/subhankit18/secureme-sih26155/blob/main/app/db_models.py): `app/db_models.py`

### Other components

- **Security Analyst**

## Connections

- Security Analyst → Web Frontend: uses
- Security Analyst → Web API: uploads config (evidence: `web_api.py`)
- Web API → Web Frontend: serves (evidence: `web_api.py`)
- Web API → Audit Pipeline: runs analysis (evidence: `web_api.py`)
- Audit Pipeline → Vendor Detection: detects vendor (evidence: `app/pipeline.py`)
- Audit Pipeline → Cisco Parser: parses Cisco (evidence: `app/pipeline.py`)
- Audit Pipeline → Fortinet Parser: parses Fortinet (evidence: `app/pipeline.py`)
- Cisco Parser → Normalized Models: builds config (evidence: `app/parsers/cisco.py`)
- Fortinet Parser → Normalized Models: builds config (evidence: `app/parsers/fortinet.py`)
- Audit Pipeline → Config Validation: validates config (evidence: `app/pipeline.py`)
- Audit Pipeline → Compliance Evaluation: evaluates controls (evidence: `app/pipeline.py`)
- Compliance Evaluation → Demo Controls: loads rules (evidence: `README.md`)
- Compliance Evaluation → Risk Scoring: scores failures (evidence: `app/compliance.py`)
- Audit Pipeline → AI Assistance: requests enrichment (evidence: `app/pipeline.py`)
- Audit Pipeline → Database Session: persists results (evidence: `app/pipeline.py`)
- Database Session → Audit Records: provides base (evidence: `app/db_models.py`)
- Web API → Database Session: uses session (evidence: `web_api.py`)
- Web API → Audit Records: reads reviews (evidence: `web_api.py`)
- Web API → Re-audit: requests re-audit (evidence: `web_api.py`)
- Re-audit → Compliance Evaluation: reevaluates controls (evidence: `app/reaudit.py`)
- Re-audit → Audit Records: reads and writes (evidence: `app/reaudit.py`)
- Web API → PDF Report: builds download (evidence: `web_api.py`)
- Audit Pipeline → Terminal Report: prints report (evidence: `app/pipeline.py`)
