# commando-x/vuln-bank-devsecops architecture

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

- Interactive diagram: https://gitdiagram.com/commando-x/vuln-bank-devsecops
- Repository: https://github.com/commando-x/vuln-bank-devsecops

## Overview

Vuln Bank is an intentionally vulnerable Flask banking application used to teach automated security testing and Kubernetes hardening. Its main workflow is registration and login, followed by account viewing and transfers; loan and administrative operations provide additional banking stages. The sampled app excerpt shows SQLite access and some template rendering, but omits portions of the route implementation. CI security testing and Kubernetes hardening are documented or represented in the tree; their internal wiring is not shown.

Main entry points: [`app.py`](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py) (Flask routes), [`bank.db`](https://github.com/commando-x/vuln-bank-devsecops/blob/main/bank.db) (SQLite bank data), [`.github/workflows/devsecops.yml`](https://github.com/commando-x/vuln-bank-devsecops/blob/main/.github/workflows/devsecops.yml) (Security test pipeline), [`deploy/k8s-infra-hardening/manifests/vuln-bank/app.yaml`](https://github.com/commando-x/vuln-bank-devsecops/blob/main/deploy/k8s-infra-hardening/manifests/vuln-bank/app.yaml) (Bank deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_banking["Banking application"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_registration["Registration<br/>[app.py]"]
  node_authentication["Login<br/>[app.py]"]
  node_account_view["Account dashboard<br/>[app.py]"]
  node_balance_check["Balance lookup<br/>[app.py]"]
  node_transfers["Funds transfer<br/>[app.py]"]
  node_loans["Loan operations<br/>[app.py]"]
  node_admin_ops["Administration<br/>[app.py]"]
  node_bank_db[("SQLite bank data<br/>[bank.db]")]
end

subgraph group_views["User interface"]
  node_register_view["Registration form<br/>[register.html]"]
  node_login_view["Login form<br/>[login.html]"]
  node_dashboard_view["Dashboard view<br/>[dashboard.html]"]
  node_admin_view["Admin view<br/>[admin.html]"]
end

subgraph group_security["Security testing"]
  node_security_pipeline["Security test pipeline<br/>[devsecops.yml]"]
  node_zap_config["ZAP configuration<br/>[config.yaml]"]
end

subgraph group_infra["Kubernetes hardening"]
  node_k8s_hardening["Cluster hardening"]
  node_deployment["Bank deployment<br/>[app.yaml]"]
end

node_customer(("Bank customer"))
node_admin_actor(("Bank administrator"))

node_customer -->|"uses"| node_flask_app
node_admin_actor -->|"uses"| node_flask_app
node_flask_app -->|"routes"| node_registration
node_flask_app -->|"routes"| node_authentication
node_flask_app -->|"routes"| node_account_view
node_flask_app -->|"routes"| node_balance_check
node_flask_app -->|"routes"| node_transfers
node_flask_app -.->|"routes"| node_loans
node_flask_app -->|"routes"| node_admin_ops
node_registration -->|"reads/writes"| node_bank_db
node_authentication -->|"reads"| node_bank_db
node_account_view -->|"reads"| node_bank_db
node_balance_check -->|"reads"| node_bank_db
node_transfers -->|"updates"| node_bank_db
node_loans -.->|"reads/writes"| node_bank_db
node_admin_ops -->|"reads/writes"| node_bank_db
node_registration -->|"renders"| node_register_view
node_authentication -->|"renders"| node_login_view
node_account_view -->|"renders"| node_dashboard_view
node_admin_ops -->|"renders"| node_admin_view
node_security_pipeline -.->|"uses"| node_zap_config
node_deployment -.->|"part of"| node_k8s_hardening

click node_flask_app "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_registration "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_authentication "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_account_view "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_balance_check "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_transfers "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_loans "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_admin_ops "https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py"
click node_bank_db "https://github.com/commando-x/vuln-bank-devsecops/blob/main/bank.db"
click node_register_view "https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/register.html"
click node_login_view "https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/login.html"
click node_dashboard_view "https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/dashboard.html"
click node_admin_view "https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/admin.html"
click node_security_pipeline "https://github.com/commando-x/vuln-bank-devsecops/blob/main/.github/workflows/devsecops.yml"
click node_zap_config "https://github.com/commando-x/vuln-bank-devsecops/blob/main/.zap/config.yaml"
click node_k8s_hardening "https://github.com/commando-x/vuln-bank-devsecops/tree/main/deploy/k8s-infra-hardening"
click node_deployment "https://github.com/commando-x/vuln-bank-devsecops/blob/main/deploy/k8s-infra-hardening/manifests/vuln-bank/app.yaml"

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_flask_app,node_registration,node_authentication,node_account_view,node_balance_check,node_transfers,node_loans,node_admin_ops,node_bank_db toneBlue
class node_register_view,node_login_view,node_dashboard_view,node_admin_view toneAmber
class node_security_pipeline,node_zap_config toneMint
class node_k8s_hardening,node_deployment toneRose
class node_customer,node_admin_actor toneIndigo
```

## Components

### Banking application

- [Flask routes](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [Registration](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [Login](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [Account dashboard](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [Balance lookup](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [Funds transfer](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [Loan operations](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [Administration](https://github.com/commando-x/vuln-bank-devsecops/blob/main/app.py): `app.py`
- [SQLite bank data](https://github.com/commando-x/vuln-bank-devsecops/blob/main/bank.db): `bank.db`

### User interface

- [Registration form](https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/register.html): `templates/register.html`
- [Login form](https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/login.html): `templates/login.html`
- [Dashboard view](https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Admin view](https://github.com/commando-x/vuln-bank-devsecops/blob/main/templates/admin.html): `templates/admin.html`

### Security testing

- [Security test pipeline](https://github.com/commando-x/vuln-bank-devsecops/blob/main/.github/workflows/devsecops.yml): `.github/workflows/devsecops.yml`
- [ZAP configuration](https://github.com/commando-x/vuln-bank-devsecops/blob/main/.zap/config.yaml): `.zap/config.yaml`

### Kubernetes hardening

- [Cluster hardening](https://github.com/commando-x/vuln-bank-devsecops/tree/main/deploy/k8s-infra-hardening): `deploy/k8s-infra-hardening`
- [Bank deployment](https://github.com/commando-x/vuln-bank-devsecops/blob/main/deploy/k8s-infra-hardening/manifests/vuln-bank/app.yaml): `deploy/k8s-infra-hardening/manifests/vuln-bank/app.yaml`

### Other components

- **Bank customer**
- **Bank administrator**

## Connections

- Bank customer → Flask routes: uses (evidence: `README.md`)
- Bank administrator → Flask routes: uses (evidence: `README.md`)
- Flask routes → Registration: routes (evidence: `app.py`)
- Flask routes → Login: routes (evidence: `app.py`)
- Flask routes → Account dashboard: routes (evidence: `app.py`)
- Flask routes → Balance lookup: routes (evidence: `app.py`)
- Flask routes → Funds transfer: routes (evidence: `app.py`)
- Flask routes → Loan operations: routes (evidence: `app.py`)
- Flask routes → Administration: routes (evidence: `app.py`)
- Registration → SQLite bank data: reads/writes (evidence: `app.py`)
- Login → SQLite bank data: reads (evidence: `app.py`)
- Account dashboard → SQLite bank data: reads (evidence: `app.py`)
- Balance lookup → SQLite bank data: reads (evidence: `app.py`)
- Funds transfer → SQLite bank data: updates (evidence: `app.py`)
- Loan operations → SQLite bank data: reads/writes
- Administration → SQLite bank data: reads/writes (evidence: `app.py`)
- Registration → Registration form: renders (evidence: `app.py`)
- Login → Login form: renders (evidence: `app.py`)
- Account dashboard → Dashboard view: renders (evidence: `app.py`)
- Administration → Admin view: renders (evidence: `app.py`)
- Security test pipeline → ZAP configuration: uses
- Bank deployment → Cluster hardening: part of
