Skip to content

Commit bb62c0e

Browse files
committed
Add changelog, enhance microservices support, and update dependencies
- Introduced a new `CHANGELOG.md` to document project changes and follow semantic versioning. - Added direct microservices mode with a foundational controller, planner, and worker services. - Implemented a FastAPI control plane for session lifecycle operations. - Expanded CLI options to include microservices mode and updated the README with relevant commands. - Enhanced CI workflows with vulnerability scanning and dependency audits. - Updated Python version requirement to 3.10+ and added new dependencies for FastAPI, Redis, and others. - Introduced a benchmark suite for performance calibration and added Docker support for local development.
1 parent f321e0d commit bb62c0e

65 files changed

Lines changed: 1784 additions & 703 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/secnode-pentest.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
- name: Build package
3030
run: uv build
3131

32+
- name: Dependency vulnerability audit
33+
run: uv run pip-audit
34+
3235
security-scan:
3336
needs: lint-test-build
3437
runs-on: ubuntu-latest
@@ -52,3 +55,22 @@ jobs:
5255
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
5356
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
5457
run: uv run secnodeapi --target https://staging-api.example.com/swagger.json
58+
59+
container-scan:
60+
needs: lint-test-build
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- name: Build image
66+
run: docker build -t secnodeapi:ci -f docker/Dockerfile .
67+
68+
- name: Trivy scan
69+
uses: aquasecurity/[email protected]
70+
with:
71+
image-ref: secnodeapi:ci
72+
format: table
73+
exit-code: "1"
74+
ignore-unfixed: true
75+
vuln-type: "os,library"
76+
severity: "CRITICAL,HIGH"

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Direct microservices mode (`--mode microservices`) with controller/planner/worker foundation.
13+
- FastAPI control plane entrypoint (`secnodeapi-server`) for session lifecycle operations.
14+
- Attack graph, memory subsystem, worker facades, and tool adapter scaffolding.
15+
- CI container vulnerability scanning via Trivy.
16+
- CI dependency vulnerability audit using `pip-audit`.
17+
- Developer workflows for local stack (`make up`, `make down`) and audit target (`make audit-uv`).
18+
19+
### Changed
20+
21+
- CLI mode options expanded to include `microservices`.
22+
- README updated with direct microservices runtime description and commands.
23+
- Dependency set expanded with `fastapi`, `uvicorn`, `redis`, and `networkx`.
24+
25+
## [0.1.0] - 2026-03-08
26+
27+
### Added
28+
29+
- Initial autonomous API pentesting framework with schema fetch, AI understanding, test generation, execution, and reporting.
30+
- Async execution pipeline and findings model/report generation.
31+
- Baseline unit test suite and CI checks.
32+
- Contributor-facing project docs: license, code of conduct, security policy, and contribution guide.
33+
34+
### Changed
35+
36+
- AI engine refactored into modular `understand`, `generate`, and `validate` components.
37+
- Pipeline execution tuned with budget clipping and category token handling improvements.
38+
- Environment support extended for OpenAI, Anthropic, and Ollama provider configuration.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Thank you for your interest in contributing to SecNode API! This guide will help
66

77
### Prerequisites
88

9-
- Python 3.9+
9+
- Python 3.10+
1010
- Git
1111
- uv (recommended)
1212

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PYTHON ?= python
22
UV ?= uv
33

4-
.PHONY: install install-dev install-uv install-dev-uv lint lint-uv test test-uv test-cov test-cov-uv build build-uv run run-uv clean
4+
.PHONY: install install-dev install-uv install-dev-uv lint lint-uv test test-uv test-cov test-cov-uv build build-uv run run-uv audit-uv up down benchmark clean
55

66
install:
77
$(PYTHON) -m pip install -r requirements.txt
@@ -48,5 +48,17 @@ run:
4848
run-uv:
4949
$(UV) run secnodeapi --help
5050

51+
audit-uv:
52+
$(UV) run pip-audit
53+
54+
up:
55+
docker compose -f deploy/docker-compose.yml up --build
56+
57+
down:
58+
docker compose -f deploy/docker-compose.yml down
59+
60+
benchmark:
61+
@echo "Benchmark fixtures and calibration harness live in benchmarks/"
62+
5163
clean:
5264
$(PYTHON) -c "import shutil, pathlib; [shutil.rmtree(p, ignore_errors=True) for p in ['dist','build','.pytest_cache','htmlcov']]; [q.unlink() for q in pathlib.Path('.').rglob('*.pyc')]"

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SecNode API
22

33
[![CI](https://github.com/SecNode/API-PENTESTER/actions/workflows/secnode-pentest.yml/badge.svg)](https://github.com/SecNode/API-PENTESTER/actions/workflows/secnode-pentest.yml)
4-
[![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/downloads/)
4+
[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
55
[![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](./LICENSE)
66

77
AI-augmented, schema-driven API penetration testing from OpenAPI/Swagger specs, with asynchronous execution and structured reporting.
@@ -14,6 +14,7 @@ SecNode API helps security engineers and backend teams run repeatable API risk a
1414
- Uses an LLM to understand API behavior and generate adversarial test cases
1515
- Executes tests concurrently with optional proxy routing
1616
- Supports autonomous agent mode with request budgets and iterative replanning
17+
- Supports direct microservices mode with controller/planner/worker boundaries
1718
- Produces both human-readable and machine-readable findings
1819

1920
## What It Is and Is Not
@@ -28,7 +29,7 @@ SecNode API is a practical automation layer for API security testing.
2829

2930
### Requirements
3031

31-
- Python 3.9+
32+
- Python 3.10+
3233
- Access to an LLM provider key (OpenAI or Anthropic)
3334

3435
### Install from source
@@ -112,12 +113,14 @@ secnodeapi --target https://api.example.com/swagger.json --dry-run --dry-run-out
112113
secnodeapi --target https://api.example.com/swagger.json --auth-header "Authorization: Bearer <token>"
113114
secnodeapi --target https://api.example.com/swagger.json --proxy http://127.0.0.1:8080 --insecure
114115
secnodeapi --target https://api.example.com/swagger.json --mode agent --request-budget 500 --max-iterations 6
116+
secnodeapi --target https://api.example.com/swagger.json --mode microservices
115117
```
116118

117119
### Key options
118120

119121
- `--target` URL or local path to OpenAPI schema (required)
120122
- `--mode` `agent` (default) or `legacy` execution pipeline
123+
- `--mode` `agent`, `legacy`, or `microservices`
121124
- `--concurrency` concurrent request workers
122125
- `--auth-header` single inline auth header
123126
- `--auth-file` JSON file of auth headers
@@ -167,6 +170,25 @@ GitHub Actions workflow runs:
167170
- package build
168171
- scan job template for staging targets
169172

173+
## Direct Microservices Runtime
174+
175+
This repository now includes a direct microservices runtime foundation:
176+
177+
- Controller service
178+
- Planner service
179+
- Skill engine service with ranked skill dispatch
180+
- Specialized workers (recon, discovery, fuzzing, exploit)
181+
- Tool adapters (`ffuf`, `nuclei`, `sqlmap`, `zap`, `kiterunner`)
182+
- Memory subsystem (session, history, skill metrics)
183+
- Attack graph engine
184+
- FastAPI control plane
185+
186+
Run local stack:
187+
188+
```bash
189+
docker compose -f deploy/docker-compose.yml up --build
190+
```
191+
170192
## Security and Responsible Use
171193

172194
Only test systems you own or are explicitly authorized to assess.

benchmarks/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Benchmark Suite
2+
3+
This directory tracks benchmark scenarios used to calibrate precision/recall
4+
for autonomous findings.
5+
6+
## Planned Targets
7+
8+
- Deliberately vulnerable API fixtures (BOLA, BFLA, mass assignment)
9+
- Rate limiting and auth differential scenarios
10+
- Multi-step exploit chain scenarios
11+
12+
## Baseline Metrics
13+
14+
- endpoint coverage ratio
15+
- findings precision and recall
16+
- deterministic-vs-AI validation ratio
17+
- exploit-chain reproducibility rate

deploy/docker-compose.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
version: "3.9"
2+
3+
services:
4+
api-gateway:
5+
build:
6+
context: ..
7+
dockerfile: docker/Dockerfile
8+
ports:
9+
- "8000:8000"
10+
environment:
11+
- SECNODE_LLM=${SECNODE_LLM:-openai/gpt-4o}
12+
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
13+
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
14+
depends_on:
15+
- redis
16+
- postgres
17+
18+
redis:
19+
image: redis:7-alpine
20+
ports:
21+
- "6379:6379"
22+
23+
postgres:
24+
image: postgres:16-alpine
25+
environment:
26+
- POSTGRES_USER=secnode
27+
- POSTGRES_PASSWORD=secnode
28+
- POSTGRES_DB=secnode
29+
ports:
30+
- "5432:5432"
31+
32+
recon-worker:
33+
build:
34+
context: ..
35+
dockerfile: docker/Dockerfile
36+
command: ["python", "-m", "secnodeapi.cli", "--help"]
37+
depends_on:
38+
- redis
39+
40+
discovery-worker:
41+
build:
42+
context: ..
43+
dockerfile: docker/Dockerfile
44+
command: ["python", "-m", "secnodeapi.cli", "--help"]
45+
depends_on:
46+
- redis
47+
48+
fuzzing-worker:
49+
build:
50+
context: ..
51+
dockerfile: docker/Dockerfile
52+
command: ["python", "-m", "secnodeapi.cli", "--help"]
53+
depends_on:
54+
- redis
55+
56+
exploit-worker:
57+
build:
58+
context: ..
59+
dockerfile: docker/Dockerfile
60+
command: ["python", "-m", "secnodeapi.cli", "--help"]
61+
depends_on:
62+
- redis

docker/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
COPY pyproject.toml requirements.txt /app/
6+
COPY src /app/src
7+
8+
RUN pip install --no-cache-dir -r requirements.txt && pip install --no-cache-dir -e .
9+
10+
EXPOSE 8000
11+
12+
CMD ["secnodeapi-server"]

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ name = "secnodeapi"
77
version = "0.1.0"
88
description = "Autonomous, AI-augmented API penetration testing framework."
99
readme = "README.md"
10-
requires-python = ">=3.9"
10+
requires-python = ">=3.10"
1111
dependencies = [
1212
"httpx==0.27.0",
1313
"pydantic==2.6.3",
1414
"structlog==24.1.0",
1515
"litellm==1.34.0",
1616
"PyYAML==6.0.1",
17+
"fastapi==0.115.0",
18+
"uvicorn==0.30.6",
19+
"redis==5.0.8",
20+
"networkx==3.3",
1721
]
1822

1923
[project.optional-dependencies]
@@ -22,10 +26,12 @@ dev = [
2226
"pytest-asyncio==0.25.3",
2327
"pytest-cov==6.0.0",
2428
"ruff==0.11.2",
29+
"pip-audit==2.8.0",
2530
]
2631

2732
[project.scripts]
2833
secnodeapi = "secnodeapi.cli:entrypoint"
34+
secnodeapi-server = "secnodeapi.api.server:run"
2935

3036
[tool.setuptools]
3137
package-dir = {"" = "src"}

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ pydantic==2.6.3
33
structlog==24.1.0
44
litellm==1.34.0
55
PyYAML==6.0.1
6+
fastapi==0.115.0
7+
uvicorn==0.30.6
8+
redis==5.0.8
9+
networkx==3.3
610
pytest==8.3.5
711
pytest-asyncio==0.25.3
812
pytest-cov==6.0.0
913
ruff==0.11.2
14+
pip-audit==2.8.0

0 commit comments

Comments
 (0)