# ozayyyy/api-security-testing-framework architecture

> Architecture diagram of the GitHub repository ozayyyy/api-security-testing-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ozayyyy/api-security-testing-framework
- Repository: https://github.com/ozayyyy/api-security-testing-framework

## Overview

APISTF is a deterministic REST API security assessment framework. An operator configures a target and identities, optionally supplies an OpenAPI specification, and runs selected probes; detectors send requests and produce evidence-backed findings that can be written as JSON, Markdown, or HTML. The safe HTTP client enforces the target allowlist and request budget, records audit entries, and redacts evidence. The README documents detector capabilities not all represented by sampled source; the excessive-data detector has no dedicated file in the supplied tree, so its node uses the existing detector directory.

Main entry points: [`apistf/runner.py`](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/runner.py) (Detector runner), [`apistf/client.py`](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/client.py) (Safe HTTP client), [`apistf/findings.py`](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/findings.py) (Finding records), [`apistf/cli.py`](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/cli.py) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Scan setup"]
  node_cli["CLI<br/>[cli.py]"]
  node_configuration["Target identities<br/>[config.py]"]
  node_openapi["OpenAPI parser<br/>[openapi.py]"]
  node_runner["Detector runner<br/>[runner.py]"]
end

subgraph group_probes["Security probes"]
  node_detector_base["Detector context<br/>[base.py]"]
  node_bola["BOLA probe<br/>[bola.py]"]
  node_bfla["BFLA probe<br/>[bfla.py]"]
  node_business_logic["Business logic probe<br/>[business_logic.py]"]
  node_inconsistent_authz["Inconsistent authz probe"]
  node_jwt["JWT probe<br/>[jwt.py]"]
  node_mass_assignment["Mass assignment probe<br/>[mass_assignment.py]"]
  node_rate_limit["Rate limit probe<br/>[rate_limit.py]"]
  node_session["Session probe<br/>[session.py]"]
  node_excessive_data["Excessive data probe"]
end

subgraph group_transport["Safe transport"]
  node_safe_client["Safe HTTP client<br/>[client.py]"]
  node_audit["Audit log<br/>[audit.py]"]
  node_redaction["Evidence redaction<br/>[redaction.py]"]
end

subgraph group_results["Evidence and reports"]
  node_findings["Finding records<br/>[findings.py]"]
  node_reporting["Report writer<br/>[reporting.py]"]
end

node_operator(("Operator"))
node_target_api(("Target API"))

node_operator -->|"starts scan"| node_cli
node_cli -->|"builds config"| node_configuration
node_cli -->|"loads spec"| node_openapi
node_cli -->|"runs detectors"| node_runner
node_runner -->|"creates context"| node_detector_base
node_runner -->|"passes config"| node_configuration
node_runner -->|"passes spec"| node_openapi
node_runner -->|"creates client"| node_safe_client
node_runner -->|"dispatches"| node_bola
node_runner -->|"dispatches"| node_bfla
node_runner -->|"dispatches"| node_business_logic
node_runner -->|"dispatches"| node_inconsistent_authz
node_runner -->|"dispatches"| node_jwt
node_runner -->|"dispatches"| node_mass_assignment
node_runner -->|"dispatches"| node_rate_limit
node_runner -->|"dispatches"| node_session
node_detector_base -->|"provides client"| node_safe_client
node_bola -.->|"sends probes"| node_safe_client
node_bfla -.->|"sends probes"| node_safe_client
node_business_logic -->|"sends probes"| node_safe_client
node_inconsistent_authz -->|"sends probes"| node_safe_client
node_jwt -->|"sends probes"| node_safe_client
node_mass_assignment -.->|"sends probes"| node_safe_client
node_rate_limit -.->|"sends probes"| node_safe_client
node_session -->|"sends probes"| node_safe_client
node_excessive_data -.->|"sends probes"| node_safe_client
node_safe_client -->|"sends requests"| node_target_api
node_safe_client -->|"checks limits"| node_configuration
node_safe_client -->|"appends records"| node_audit
node_safe_client -->|"redacts evidence"| node_redaction
node_business_logic -->|"creates findings"| node_findings
node_inconsistent_authz -->|"creates findings"| node_findings
node_jwt -->|"creates findings"| node_findings
node_session -->|"creates findings"| node_findings
node_runner -->|"collects findings"| node_findings
node_cli -->|"writes report"| node_reporting
node_reporting -->|"serializes findings"| node_findings

click node_cli "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/cli.py"
click node_configuration "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/config.py"
click node_openapi "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/openapi.py"
click node_runner "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/runner.py"
click node_detector_base "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/base.py"
click node_bola "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/bola.py"
click node_bfla "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/bfla.py"
click node_business_logic "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/business_logic.py"
click node_inconsistent_authz "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/inconsistent_authz.py"
click node_jwt "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/jwt.py"
click node_mass_assignment "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/mass_assignment.py"
click node_rate_limit "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/rate_limit.py"
click node_session "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/session.py"
click node_excessive_data "https://github.com/ozayyyy/api-security-testing-framework/tree/main/apistf/detectors"
click node_safe_client "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/client.py"
click node_audit "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/audit.py"
click node_redaction "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/redaction.py"
click node_findings "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/findings.py"
click node_reporting "https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/reporting.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_cli,node_configuration,node_openapi,node_runner toneBlue
class node_detector_base,node_bola,node_bfla,node_business_logic,node_inconsistent_authz,node_jwt,node_mass_assignment,node_rate_limit,node_session,node_excessive_data toneAmber
class node_safe_client,node_audit,node_redaction,node_target_api toneMint
class node_findings,node_reporting toneRose
class node_operator toneIndigo
```

## Components

### Scan setup

- [CLI](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/cli.py): `apistf/cli.py`
- [Target identities](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/config.py): `apistf/config.py`
- [OpenAPI parser](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/openapi.py): `apistf/openapi.py`
- [Detector runner](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/runner.py): `apistf/runner.py`

### Security probes

- [Detector context](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/base.py): `apistf/detectors/base.py`
- [BOLA probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/bola.py): `apistf/detectors/bola.py`
- [BFLA probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/bfla.py): `apistf/detectors/bfla.py`
- [Business logic probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/business_logic.py): `apistf/detectors/business_logic.py`
- [Inconsistent authz probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/inconsistent_authz.py): `apistf/detectors/inconsistent_authz.py`
- [JWT probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/jwt.py): `apistf/detectors/jwt.py`
- [Mass assignment probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/mass_assignment.py): `apistf/detectors/mass_assignment.py`
- [Rate limit probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/rate_limit.py): `apistf/detectors/rate_limit.py`
- [Session probe](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/detectors/session.py): `apistf/detectors/session.py`
- [Excessive data probe](https://github.com/ozayyyy/api-security-testing-framework/tree/main/apistf/detectors): `apistf/detectors`

### Safe transport

- [Safe HTTP client](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/client.py): `apistf/client.py`
- [Audit log](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/audit.py): `apistf/audit.py`
- [Evidence redaction](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/redaction.py): `apistf/redaction.py`

### Evidence and reports

- [Finding records](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/findings.py): `apistf/findings.py`
- [Report writer](https://github.com/ozayyyy/api-security-testing-framework/blob/main/apistf/reporting.py): `apistf/reporting.py`

### Other components

- **Operator**
- **Target API**

## Connections

- Operator → CLI: starts scan (evidence: `README.md`)
- CLI → Target identities: builds config (evidence: `apistf/cli.py`)
- CLI → OpenAPI parser: loads spec (evidence: `apistf/cli.py`)
- CLI → Detector runner: runs detectors (evidence: `apistf/cli.py`)
- Detector runner → Detector context: creates context (evidence: `apistf/runner.py`)
- Detector runner → Target identities: passes config (evidence: `apistf/runner.py`)
- Detector runner → OpenAPI parser: passes spec (evidence: `apistf/runner.py`)
- Detector runner → Safe HTTP client: creates client (evidence: `apistf/runner.py`)
- Detector runner → BOLA probe: dispatches
- Detector runner → BFLA probe: dispatches
- Detector runner → Business logic probe: dispatches
- Detector runner → Inconsistent authz probe: dispatches
- Detector runner → JWT probe: dispatches
- Detector runner → Mass assignment probe: dispatches
- Detector runner → Rate limit probe: dispatches
- Detector runner → Session probe: dispatches
- Detector context → Safe HTTP client: provides client (evidence: `apistf/detectors/base.py`)
- BOLA probe → Safe HTTP client: sends probes
- BFLA probe → Safe HTTP client: sends probes
- Business logic probe → Safe HTTP client: sends probes (evidence: `apistf/detectors/business_logic.py`)
- Inconsistent authz probe → Safe HTTP client: sends probes (evidence: `apistf/detectors/inconsistent_authz.py`)
- JWT probe → Safe HTTP client: sends probes (evidence: `apistf/detectors/jwt.py`)
- Mass assignment probe → Safe HTTP client: sends probes
- Rate limit probe → Safe HTTP client: sends probes
- Session probe → Safe HTTP client: sends probes (evidence: `apistf/detectors/session.py`)
- Excessive data probe → Safe HTTP client: sends probes (evidence: `README.md`)
- Safe HTTP client → Target API: sends requests (evidence: `apistf/client.py`)
- Safe HTTP client → Target identities: checks limits (evidence: `apistf/client.py`)
- Safe HTTP client → Audit log: appends records (evidence: `apistf/client.py`)
- Safe HTTP client → Evidence redaction: redacts evidence (evidence: `apistf/client.py`)
- Business logic probe → Finding records: creates findings (evidence: `apistf/detectors/business_logic.py`)
- Inconsistent authz probe → Finding records: creates findings (evidence: `apistf/detectors/inconsistent_authz.py`)
- JWT probe → Finding records: creates findings (evidence: `apistf/detectors/jwt.py`)
- Session probe → Finding records: creates findings (evidence: `apistf/detectors/session.py`)
- Detector runner → Finding records: collects findings (evidence: `apistf/runner.py`)
- CLI → Report writer: writes report (evidence: `apistf/cli.py`)
- Report writer → Finding records: serializes findings (evidence: `apistf/reporting.py`)
