Skip to main content

WAF++ PASS – API server for persisting and querying scan results

Project description

wafpass-server

REST API for persisting and querying WAF++ PASS scan results.

Receives wafpass-result.json payloads from wafpass check --output json, stores them in PostgreSQL, and exposes them to the dashboard and CI tooling.

API endpoints

Method Path Description
POST /runs Ingest a wafpass-result.json payload
GET /runs List runs (query: limit, offset, project)
GET /runs/{id} Single run with all findings
GET /runs/{id}/findings Findings only (query: severity, pillar, status)
GET /health Health check
GET /api/docs Swagger UI

Setup

Environment variables

Copy .env.example from the repo root:

DATABASE_URL=postgresql+asyncpg://wafpass:changeme@localhost:5432/wafpass
WAFPASS_ENV=local
CORS_ORIGINS=http://localhost:5173,http://localhost:3000

Run locally

pip install -e ".[dev]"
alembic upgrade head
uvicorn wafpass_server.main:app --reload --port 8000

Run migrations

alembic upgrade head       # apply all migrations
alembic downgrade -1       # roll back one step
alembic revision --autogenerate -m "add column"  # generate new migration

Docker

docker build -t wafpass-server .
docker run -e DATABASE_URL=... -p 8000:8000 wafpass-server

docker-compose (full stack)

From the repo root:

cp .env.example .env   # fill in passwords
docker compose up

Posting a scan result

wafpass check infra/ --output json > result.json
curl -X POST http://localhost:8000/runs \
     -H "Content-Type: application/json" \
     -d @result.json

Or set metadata fields before posting:

import json, httpx

result = json.load(open("result.json"))
result.update({"project": "my-infra", "branch": "main", "git_sha": "abc1234"})
httpx.post("http://localhost:8000/runs", json=result)

Result schema

The payload shape is defined by WafpassResultSchema in wafpass-core (wafpass/schema.py). wafpass-server mirrors that schema in wafpass_server/schemas.py (RunCreate). Once wafpass-core is published to PyPI, replace the local definition with a direct import.

Key fields stored per run:

Column Type Description
id uuid Auto-generated primary key
project text Repo / project name
branch text VCS branch
git_sha text Commit SHA
triggered_by text local | github-actions | gitlab-ci | …
iac_framework text terraform | cdk | …
score int Overall compliance score (0–100)
pillar_scores jsonb Per-pillar scores {"SEC": 90, …}
findings jsonb Array of check results
created_at timestamptz Inserted at

Development

pip install -e ".[dev]"
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wafpass_server-0.3.5.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wafpass_server-0.3.5-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file wafpass_server-0.3.5.tar.gz.

File metadata

  • Download URL: wafpass_server-0.3.5.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wafpass_server-0.3.5.tar.gz
Algorithm Hash digest
SHA256 2c6231f89cab7d1d4a91cd861c17471cd21abdcdc2c96471bacbda70ccdaaa1b
MD5 03d4f11a7f73eaed0718ac5fd7639b01
BLAKE2b-256 cfa560611c50a145ca3afb213a01a719733310ca02f2b485667ec0f8d398ff85

See more details on using hashes here.

Provenance

The following attestation bundles were made for wafpass_server-0.3.5.tar.gz:

Publisher: release.yml on WAF2p/wafpass-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wafpass_server-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: wafpass_server-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wafpass_server-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4387027855903b6d8964c52233a08dcb6798ea44e65571ccbfdb597ec13b30f4
MD5 09acb38bb1b37ae0cce849195e390b92
BLAKE2b-256 82eb91dcebdad3545e33e98e87c20712d1fa4ffed9dd27188d43f09ba09a3282

See more details on using hashes here.

Provenance

The following attestation bundles were made for wafpass_server-0.3.5-py3-none-any.whl:

Publisher: release.yml on WAF2p/wafpass-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page