DORA Compliance Auditor for OpenAPI Specs
Project description
PanDoraSpec
The Open DORA Compliance Engine for OpenAPI Specs.
PanDoraSpec is a CLI tool that performs deep technical due diligence on APIs to verify compliance with DORA (Digital Operational Resilience Act) requirements. It compares OpenAPI/Swagger specifications against real-world implementation to detect schema drift, resilience gaps, and security issues.
📦 Installation
pip install pandoraspec
System Requirements
The PDF report generation requires weasyprint, which depends on Pango.
🚀 Usage
Run the audit directly from your terminal.
Basic Scan
pandoraspec https://petstore.swagger.io/v2/swagger.json
With Options
pandoraspec https://api.example.com/spec.json --vendor "Stripe" --key "sk_live_..."
Local File
pandoraspec ./openapi.yaml
Override Base URL
If your OpenAPI spec uses variables (e.g. https://{env}.api.com) or you want to audit a specific target:
pandoraspec https://api.example.com/spec.json --base-url https://staging.api.example.com
🏎️ Zero-Config Testing (DORA Compliance)
For standard DORA compliance, you simply need to verify that your API implementation matches its specification. No configuration is required.
pandoraspec https://petstore.swagger.io/v2/swagger.json
This runs a fuzzing audit where random data is generated based on your schema types (e.g., sending random integers for IDs).
- Value: This is sufficient to prove that your API correctly handles unexpected inputs and adheres to the basic contract (e.g., returning 400 Bad Request instead of 500 Server Error).
- Limitation: Detailed business logic requiring valid IDs (e.g.,
GET /user/{id}where{id}must exist) may return404 Not Found. This is acceptable for a compliance scan but may not fully exercise deeper code paths.
🧠 Advanced Testing with Seed Data
To test specific business workflows (e.g., successfully retrieving a user profile), you can provide "Seed Data". This tells PanDoraSpec to use known, valid values instead of random fuzzing data.
pandoraspec https://petstore.swagger.io/v2/swagger.json --config seed_parameters.yaml
Configuration Hierarchy
You can define seed values at three levels of specificity. The engine resolves values in this order: Endpoints > Verbs > General.
seed_data:
# 1. General: Applies to EVERYTHING (path params, query params, headers)
general:
username: "test_user"
limit: 50
# 2. Verbs: Applies only to specific HTTP methods (Overwrites General)
verbs:
POST:
username: "admin_user" # Creation requests use a different user
# 3. Endpoints: Applies only to specific routes (Overwrites Everything)
endpoints:
/users/me:
GET:
limit: 10
🔗 Dynamic Seed Data (Recursive Chaining)
You can even test dependency chains where one endpoint requires data from another. PanDoraSpec handles recursion automatically: if Endpoint A needs data from B, and B needs data from C, it will resolve the entire chain in order.
Supported Features:
- Recursive Resolution: Automatically resolves upstream dependencies (chains of
from_endpoint). - Deep Extraction: Extract values from nested JSON using dot notation, including list indices (e.g.,
data.items.0.id). - Parameter Interpolation: Use
{param}in the dependency URL to chain multiple steps. - Smart Logging: Fuzzed values are masked as
randomin logs to keep output clean, while your seeded values are shown clearly.
endpoints:
# Level 1: Get the current user ID
/user/me:
GET:
authorization: "Bearer static-token"
# Level 2: Use that ID to get their orders
/users/{userId}/orders:
GET:
userId:
from_endpoint: "GET /user/me"
extract: "data.id" # JSON extraction
# Level 3: Get details of the FIRST order from that list (Recursive!)
/orders/{orderId}:
GET:
orderId:
# This calls Level 2 first (which calls Level 1), then extracts the first order ID
from_endpoint: "GET /users/{userId}/orders"
extract: "data.items.0.id" # Supports list index '0'
🛠️ Development Setup
To run the CLI locally without reinstalling after every change:
- Clone & CD:
git clone ...
cd pandoraspec
- Create & Activate Virtual Environment: It's recommended to use a virtual environment to keep dependencies isolated.
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Editable Install:
pip install -e .
This links the pandoraspec command directly to your source code. Any changes you make will be reflected immediately.
🛡️ What It Checks
Module A: The Integrity Test (Drift)
Checks if your API implementation matches your documentation.
- Why? DORA requires you to monitor if the service effectively supports your critical functions. If the API behaves differently than documented, it's a risk.
Module B: The Resilience Test
Stress tests the API to ensure it handles invalid inputs gracefully (4xx vs 5xx).
- Why? DORA Article 25 calls for "Digital operational resilience testing".
Module C: Security Hygiene
Checks for common security headers and configurations.
Module D: The Report
Generates a PDF report: "DORA ICT Third-Party Technical Risk Assessment".
📄 License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pandoraspec-0.2.3.tar.gz.
File metadata
- Download URL: pandoraspec-0.2.3.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56c336e266d4971d2c2a9306d3c3b420871ef0cf86489e6f4c2391125baaf283
|
|
| MD5 |
5e7ef42bfdda713aded6baad730df1e9
|
|
| BLAKE2b-256 |
e9bb37f887e2672bf9dfd47a3c04c1943eb4328977d0dcdfd1291b240481fa21
|
File details
Details for the file pandoraspec-0.2.3-py3-none-any.whl.
File metadata
- Download URL: pandoraspec-0.2.3-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aedbbca20784f46c296bed3cabea0f64f0ff205b6b8f374fccf5f9e9c410307
|
|
| MD5 |
80da03e5cfbd05e1c42dcaf0d9d74cf2
|
|
| BLAKE2b-256 |
6962d82dd03c9c7e9719f1c04e39065a462e94e826b6707ec86f2bf26dea9a51
|