api

module
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: GPL-3.0

README

OpenCTEM API

Go Version PostgreSQL Redis License

Backend API for the OpenCTEM Continuous Threat Exposure Management platform. Built with Go, PostgreSQL, and Redis using Clean Architecture (DDD).

Features

Asset Management (35 asset types)
  • External Attack Surface: Domains, Subdomains, Certificates, IPs
  • Applications: Websites, APIs, Mobile Apps, Services
  • Cloud: Cloud Accounts, Compute, Storage, Serverless, Container Registry
  • Infrastructure: Hosts, Containers, Databases, Networks, VPCs, K8s
  • Identity: IAM Users, IAM Roles, Service Accounts
  • Code: Git Repositories
  • Recon: HTTP Services, Open Ports, Discovered URLs
Security & Findings
  • Vulnerability management with severity-based prioritization
  • CVSS scoring and exploit maturity tracking
  • Finding lifecycle: Open > Confirmed > Fix Applied > Resolved
  • AI-powered triage (Claude, OpenAI, Gemini)
  • SLA policy enforcement with escalation
Scanning
  • 30+ scanner integrations via Agent SDK (Nuclei, Trivy, Semgrep, Gitleaks, Nmap, etc.)
  • Pipeline-based scan orchestration with multi-step workflows
  • Platform agents with K8s-inspired lifecycle management
  • Bootstrap token authentication for agent self-registration
Access Control
  • 2-layer RBAC: Permissions (what you can DO) + Groups (what you can SEE)
  • 164 granular permissions across all modules
  • Real-time permission sync via Redis
  • OAuth2 (Google, GitHub, Microsoft) + OIDC (Keycloak)
Integrations
  • ITSM: Jira, Linear, Asana
  • SCM: GitHub, GitLab (repository sync, credential import)
  • Notifications: Slack, Teams, Telegram, Email, Webhooks
  • Compliance: PCI-DSS, HIPAA, SOC2, GDPR, ISO27001, NIST, FedRAMP, CCPA
Observability
  • Prometheus metrics (HTTP, Redis, Pipeline, Scan, Agent, Finding)
  • Structured logging (slog)
  • Audit logging with tenant isolation

Tech Stack

Component Technology
Language Go 1.26+
Router Chi (net/http compatible)
Database PostgreSQL 17
Cache/Queue Redis 7 (Asynq)
Auth JWT (local) / OAuth2 / OIDC
Metrics Prometheus client_golang
Encryption AES-256-GCM

Project Structure

api/
├── cmd/
│   ├── server/                # Main API server
│   └── openctem-admin/        # Admin CLI tool
├── internal/
│   ├── app/                   # Application services (business logic, 40+ services)
│   ├── config/                # Configuration loading
│   └── infra/                 # Infrastructure adapters
│       ├── http/              # Handlers (200+ endpoints), middleware, routes
│       ├── postgres/          # Repository implementations (30+ repos)
│       ├── redis/             # Cache, sessions, job queue
│       ├── notifier/          # Slack, Teams, Telegram, Email, Webhook
│       ├── llm/               # AI triage (Claude, OpenAI, Gemini)
│       ├── scm/               # GitHub, GitLab integration
│       ├── controller/        # Background jobs
│       └── telemetry/         # Tracing
├── pkg/
│   ├── domain/                # Domain models (35+ entities)
│   │   ├── asset/             # Asset entity, risk scoring, value objects
│   │   ├── vulnerability/     # Finding, approval, suppression
│   │   ├── scan/              # Scan orchestration
│   │   ├── agent/             # Platform agents, bootstrap tokens
│   │   ├── workflow/          # Workflow engine
│   │   ├── pipeline/          # Scan pipelines
│   │   └── ...                # 25+ more domains
│   ├── jwt/                   # Token generation/validation
│   ├── crypto/                # AES-256-GCM encryption
│   ├── validator/             # Input validation + SSRF protection
│   ├── password/              # bcrypt hashing
│   └── pagination/            # Cursor/offset pagination
├── migrations/                # 156 sequential migrations
├── tests/
│   ├── unit/                  # Unit tests (100+ files)
│   ├── integration/           # Integration tests
│   └── repository/            # Repository tests
└── docs/                      # Architecture docs

Quick Start

Prerequisites
  • Go 1.26+
  • Docker & Docker Compose
  • PostgreSQL 17 (or use Docker)
  • Redis 7 (or use Docker)
Development
# Start dependencies
docker compose up -d postgres redis

# Run with hot reload
make dev

# Or start everything
docker compose up
Production
# Set required environment variables
export DB_PASSWORD=<secure-password>
export REDIS_PASSWORD=<secure-password>
export AUTH_JWT_SECRET=<64-char-secret>
export APP_ENCRYPTION_KEY=$(openssl rand -hex 32)
export CORS_ALLOWED_ORIGINS=https://your-domain.com

# Start
docker compose -f docker-compose.prod.yml up -d
Verify
curl http://localhost:8080/health
# {"status":"healthy"}

curl http://localhost:8080/ready
# {"status":"ready","database":"ok","redis":"ok"}

Environment Variables

Required (Production)
Variable Description
DB_PASSWORD PostgreSQL password
REDIS_PASSWORD Redis password
AUTH_JWT_SECRET JWT signing secret (min 64 chars)
APP_ENCRYPTION_KEY AES-256 key (64 hex chars: openssl rand -hex 32)
CORS_ALLOWED_ORIGINS Allowed CORS origins
Optional
Variable Default Description
AUTH_PROVIDER local Auth provider: local, oidc, hybrid
AUTH_ALLOW_REGISTRATION true Allow public registration. Set false in production — use invitation flow instead
AI_PLATFORM_PROVIDER — AI triage: claude, openai, gemini
SMTP_ENABLED false Enable email notifications (required for invitations)
RATE_LIMIT_RPS 100 Rate limit (requests/second)
LOG_LEVEL info Log level: debug, info, warn, error
Production User Management

In production, disable public registration and use the invitation system:

AUTH_ALLOW_REGISTRATION=false   # No public signup
SMTP_ENABLED=true               # Required for invitation emails

Flow: Admin creates invitation → User receives email → User clicks link → Account created → User joins tenant.

# API: Create invitation (requires team:admin permission)
POST /api/v1/tenants/{tenant}/invitations
{"email": "user@company.com", "role_ids": ["00000000-0000-0000-0000-000000000003"]}

# System roles (pre-seeded, shared across all tenants):
#   00000000-...-000000000001  owner       (full access)
#   00000000-...-000000000002  admin       (all except team:delete)
#   00000000-...-000000000003  member      (read/write, no delete)
#   00000000-...-000000000004  viewer      (read-only)

# User accepts invitation via token link
POST /api/v1/invitations/{token}/accept
Per-Tenant SMTP

Each tenant can configure its own SMTP server for outgoing emails (invitations, notifications). If not configured, the system-wide SMTP (SMTP_HOST, etc.) is used as fallback.

Setup via email integration:

POST /api/v1/integrations
{
  "name": "Company Email",
  "category": "notification",
  "provider": "email",
  "auth_type": "basic",
  "metadata": {
    "smtp_host": "smtp.company.com",
    "smtp_port": 587,
    "smtp_user": "noreply@company.com",
    "smtp_password": "app-password",
    "smtp_from": "noreply@company.com",
    "smtp_from_name": "Security Team",
    "smtp_tls": true
  }
}

Resolution order:

  1. Tenant has active email integration → use tenant SMTP
  2. No tenant integration → use system SMTP (SMTP_HOST, SMTP_PORT, etc.)
  3. No system SMTP → emails skipped (logged as warning)

Credentials are encrypted at rest using AES-256-GCM.

Commands

make dev             # Run with hot reload (Air)
make build           # Build production binary
make test            # Run all tests
make lint            # Run golangci-lint (30 linters)
make fmt             # Format code (goimports)
make migrate-up      # Run database migrations
make migrate-down    # Rollback last migration
make security-scan   # Run security scan (semgrep + gitleaks + trivy)

API Endpoints (200+)

Core
Method Endpoint Description
GET /health Liveness check
GET /ready Readiness check (DB + Redis)
GET /metrics Prometheus metrics
GET /docs API documentation
Assets
Method Endpoint Description
GET /api/v1/assets List assets (paginated, 10+ filters)
POST /api/v1/assets Create asset
GET /api/v1/assets/{id} Get asset (tenant-scoped)
PUT /api/v1/assets/{id} Update asset
DELETE /api/v1/assets/{id} Delete asset
GET /api/v1/assets/stats Aggregated statistics (SQL)
POST /api/v1/assets/bulk/status Atomic bulk status update
POST /api/v1/assets/{id}/scan Trigger scan
Findings, Scans, Integrations, Compliance, Pentest, Workflows...

See /docs endpoint for complete OpenAPI documentation.

Platform Agents
Method Endpoint Description
POST /api/v1/platform/register Agent self-registration
PUT /api/v1/platform/lease Renew agent lease
POST /api/v1/platform/poll Long-poll for jobs
POST /api/v1/platform/jobs/{id}/result Submit job results

Deployment

Docker Compose
# 1. Go to setup directory
cd ../setup

# 2. Initialize environment files
make init-prod

# 3. Generate secrets and update .env files
make generate-secrets
# Update all <CHANGE_ME> values in .env.*.prod files

# 4. Setup SSL (self-signed or Let's Encrypt)
make auto-ssl

# 5. Start production
make prod-up

# 6. Create first admin user
make bootstrap-admin-prod email=admin@example.com
Kubernetes (Helm)
# 1. Create namespace and secrets
kubectl create namespace openctem

kubectl create secret generic openctem-api-secrets \
  --namespace openctem \
  --from-literal=AUTH_JWT_SECRET=$(openssl rand -base64 48) \
  --from-literal=APP_ENCRYPTION_KEY=$(openssl rand -hex 32) \
  --from-literal=DB_USER=openctem \
  --from-literal=DB_PASSWORD=$(openssl rand -hex 24) \
  --from-literal=DB_NAME=openctem

kubectl create secret generic openctem-db-secrets \
  --namespace openctem \
  --from-literal=username=openctem \
  --from-literal=password=<same-db-password>

kubectl create secret generic openctem-redis-secrets \
  --namespace openctem \
  --from-literal=password=$(openssl rand -hex 24)

# 2. Install with bootstrap admin (first-time only)
helm install openctem ../setup/kubernetes/helm/openctem \
  --namespace openctem \
  --set bootstrapAdmin.enabled=true \
  --set bootstrapAdmin.email=admin@example.com \
  --set ingress.hosts[0].host=openctem.yourdomain.com

# 3. Get the admin API key (shown once — save it!)
kubectl logs job/openctem-bootstrap-admin -n openctem
Bootstrap Admin (First-time Setup)

The first admin user must be created via CLI — there is no default account.

Docker Compose:

make bootstrap-admin-prod email=admin@example.com role=super_admin

Kubernetes (during helm install):

helm install openctem ./openctem \
  --set bootstrapAdmin.enabled=true \
  --set bootstrapAdmin.email=admin@example.com

Kubernetes (after install):

kubectl exec -it deploy/openctem-api -n openctem -- \
  /app/bootstrap-admin -email=admin@example.com

Standalone binary:

./bootstrap-admin \
  -db="postgres://user:pass@host:5432/openctem?sslmode=require" \
  -email=admin@example.com \
  -role=super_admin
Flag Env Var Description
-db DATABASE_URL or DB_HOST/DB_USER/DB_PASSWORD/DB_NAME Database connection
-email ADMIN_EMAIL Admin email (required)
-name ADMIN_NAME Display name (defaults to email prefix)
-role — super_admin, ops_admin, viewer
-api-key BOOTSTRAP_ADMIN_KEY Use specific key (auto-generated if empty)
-force — Overwrite existing admin with same email

Security

  • SSRF protection on all URL inputs (webhooks, integrations, template sources)
  • OAuth redirect URI whitelist validation
  • Command injection prevention in scan executors (ExtraArgs validation)
  • Tenant isolation on all 200+ endpoints (WHERE tenant_id = ?)
  • Password reset token single-use enforcement
  • X-Forwarded header injection prevention
  • AES-256-GCM credential encryption
  • bcrypt password hashing (cost=12)
  • Constant-time token comparison
  • Rate limiting on all endpoints

License

MIT License - See LICENSE file for details.

Directories

Path Synopsis
cmd
bootstrap-admin command
Package main provides a CLI tool to create the first admin user.
Package main provides a CLI tool to create the first admin user.
bootstrap-tenant command
Package main provides a CLI tool to create the first tenant with an owner user.
Package main provides a CLI tool to create the first tenant with an owner user.
chainaudit command
Command chainaudit recomputes every audit_log_chain row against live data and classifies why it does or does not verify.
Command chainaudit recomputes every audit_log_chain row against live data and classifies why it does or does not verify.
encrypt-credentials command
Command encrypt-credentials encrypts existing plaintext credentials in the database.
Command encrypt-credentials encrypts existing plaintext credentials in the database.
gen-relationships command
Command gen-relationships reads configs/relationship-types.yaml and emits generated source files for both the Go backend and the TypeScript frontend.
Command gen-relationships reads configs/relationship-types.yaml and emits generated source files for both the Go backend and the TypeScript frontend.
openctem-admin command
openctem-admin/cmd
Package cmd implements the openctem-admin CLI (cobra commands) for tenant ops + maintenance.
Package cmd implements the openctem-admin CLI (cobra commands) for tenant ops + maintenance.
seed command
server command
internal
app
Package app provides adapters for connecting services to sub-packages.
Package app provides adapters for connecting services to sub-packages.
app/accesscontrol
Package accesscontrol provides the application-layer services for the 2-layer access control model (RBAC roles + Groups data scope).
Package accesscontrol provides the application-layer services for the 2-layer access control model (RBAC roles + Groups data scope).
app/activity
Package activity provides the application service that records, queries, and aggregates user-facing activity events (asset created, finding reopened, scan triggered, etc).
Package activity provides the application service that records, queries, and aggregates user-facing activity events (asset created, finding reopened, scan triggered, etc).
app/agent
Package agent implements the application service for the agent bounded context — orchestrates pkg/domain/agent entities and cross-cutting concerns (audit, notifications, RBAC).
Package agent implements the application service for the agent bounded context — orchestrates pkg/domain/agent entities and cross-cutting concerns (audit, notifications, RBAC).
app/aitriage
Package aitriage implements the application service for the aitriage bounded context — orchestrates pkg/domain/aitriage entities and cross-cutting concerns (audit, notifications, RBAC).
Package aitriage implements the application service for the aitriage bounded context — orchestrates pkg/domain/aitriage entities and cross-cutting concerns (audit, notifications, RBAC).
app/apikey
Package apikey implements the application service for the apikey bounded context — orchestrates pkg/domain/apikey entities and cross-cutting concerns (audit, notifications, RBAC).
Package apikey implements the application service for the apikey bounded context — orchestrates pkg/domain/apikey entities and cross-cutting concerns (audit, notifications, RBAC).
app/asset
Package asset implements the application service for the asset bounded context — orchestrates pkg/domain/asset entities and cross-cutting concerns (audit, notifications, RBAC).
Package asset implements the application service for the asset bounded context — orchestrates pkg/domain/asset entities and cross-cutting concerns (audit, notifications, RBAC).
app/assetdiscovery
Package assetdiscovery turns attack-surface growth into tenant notifications: newly discovered internet-facing assets, and existing assets a re-scan turned internet-facing.
Package assetdiscovery turns attack-surface growth into tenant notifications: newly discovered internet-facing assets, and existing assets a re-scan turned internet-facing.
app/assignment
Package assignment implements the application service for the assignment bounded context — orchestrates pkg/domain/assignment entities and cross-cutting concerns (audit, notifications, RBAC).
Package assignment implements the application service for the assignment bounded context — orchestrates pkg/domain/assignment entities and cross-cutting concerns (audit, notifications, RBAC).
app/attack
Package attack implements the application service for the attack bounded context — orchestrates pkg/domain/attack entities and cross-cutting concerns (audit, notifications, RBAC).
Package attack implements the application service for the attack bounded context — orchestrates pkg/domain/attack entities and cross-cutting concerns (audit, notifications, RBAC).
app/audit
Package audit implements the application service for the audit bounded context — orchestrates pkg/domain/audit entities and cross-cutting concerns (audit, notifications, RBAC).
Package audit implements the application service for the audit bounded context — orchestrates pkg/domain/audit entities and cross-cutting concerns (audit, notifications, RBAC).
app/auth
Package auth implements the application service for the auth bounded context — orchestrates pkg/domain/auth entities and cross-cutting concerns (audit, notifications, RBAC).
Package auth implements the application service for the auth bounded context — orchestrates pkg/domain/auth entities and cross-cutting concerns (audit, notifications, RBAC).
app/auth/domainverify
Package domainverify implements DNS-TXT domain-ownership verification and the verified-domain gate for SSO JIT auto-provisioning (SSO P1).
Package domainverify implements DNS-TXT domain-ownership verification and the verified-domain gate for SSO JIT auto-provisioning (SSO P1).
app/capability
Package capability implements the application service for the capability bounded context — orchestrates pkg/domain/capability entities and cross-cutting concerns (audit, notifications, RBAC).
Package capability implements the application service for the capability bounded context — orchestrates pkg/domain/capability entities and cross-cutting concerns (audit, notifications, RBAC).
app/certmonitor
Package certmonitor implements OpenCTEM's Certificate-Transparency (CT) discovery source: a scheduled, per-tenant poller that queries the PUBLIC crt.sh CT-log aggregator for the tenant's own registered domains and emits first-class ExposureEvents.
Package certmonitor implements OpenCTEM's Certificate-Transparency (CT) discovery source: a scheduled, per-tenant poller that queries the PUBLIC crt.sh CT-log aggregator for the tenant's own registered domains and emits first-class ExposureEvents.
app/command
Package command implements the application service for the command bounded context — orchestrates pkg/domain/command entities and cross-cutting concerns (audit, notifications, RBAC).
Package command implements the application service for the command bounded context — orchestrates pkg/domain/command entities and cross-cutting concerns (audit, notifications, RBAC).
app/compliance
Package compliance implements the application service for the compliance bounded context — orchestrates pkg/domain/compliance entities and cross-cutting concerns (audit, notifications, RBAC).
Package compliance implements the application service for the compliance bounded context — orchestrates pkg/domain/compliance entities and cross-cutting concerns (audit, notifications, RBAC).
app/connector
Package connector defines the common contract for cloud / infra asset-inventory connectors (AWS, GCP, Azure, Kubernetes, git-host).
Package connector defines the common contract for cloud / infra asset-inventory connectors (AWS, GCP, Azure, Kubernetes, git-host).
app/ctemid
Package ctemid provides the application service that mirrors the CTEM-ID catalog from an external JSON feed (default https://ctem.org/source.json) into local reference storage, mirroring the KEV/EPSS threat-intel refresh pattern.
Package ctemid provides the application service that mirrors the CTEM-ID catalog from an external JSON feed (default https://ctem.org/source.json) into local reference storage, mirroring the KEV/EPSS threat-intel refresh pattern.
app/dashboard
Package dashboard is the application service for per-user customizable dashboards (RFC-021).
Package dashboard is the application service for per-user customizable dashboards (RFC-021).
app/defectdojo
Package defectdojo wires the DefectDojo co-existence connector (RFC-013): pull findings from a tenant's DefectDojo integration, convert to CTIS, and ingest them — with OpenCTEM remaining the system of record.
Package defectdojo wires the DefectDojo co-existence connector (RFC-013): pull findings from a tenant's DefectDojo integration, convert to CTIS, and ingest them — with OpenCTEM remaining the system of record.
app/exposure
Package exposure implements the application service for the exposure bounded context — orchestrates pkg/domain/exposure entities and cross-cutting concerns (audit, notifications, RBAC).
Package exposure implements the application service for the exposure bounded context — orchestrates pkg/domain/exposure entities and cross-cutting concerns (audit, notifications, RBAC).
app/exposurebridge
Package exposurebridge promotes internal findings that represent an EXPOSURE rather than a code vulnerability into the Exposure Register (the exposure event store), so they show up in the Exposures view continuously — realizing the CTEM Discovery "exposure ≠ vulnerability" principle.
Package exposurebridge promotes internal findings that represent an EXPOSURE rather than a code vulnerability into the Exposure Register (the exposure event store), so they show up in the Exposures view continuously — realizing the CTEM Discovery "exposure ≠ vulnerability" principle.
app/finding
Package finding implements the application service for the finding bounded context — orchestrates pkg/domain/finding entities and cross-cutting concerns (audit, notifications, RBAC).
Package finding implements the application service for the finding bounded context — orchestrates pkg/domain/finding entities and cross-cutting concerns (audit, notifications, RBAC).
app/ingest
Package ingest provides unified ingestion of assets and findings from various formats.
Package ingest provides unified ingestion of assets and findings from various formats.
app/integration
Package integration implements the application service for the integration bounded context — orchestrates pkg/domain/integration entities and cross-cutting concerns (audit, notifications, RBAC).
Package integration implements the application service for the integration bounded context — orchestrates pkg/domain/integration entities and cross-cutting concerns (audit, notifications, RBAC).
app/ioc
Package ioc wires Indicators of Compromise to the runtime telemetry stream.
Package ioc wires Indicators of Compromise to the runtime telemetry stream.
app/jira
Package jira implements the application service for the jira bounded context — orchestrates pkg/domain/jira entities and cross-cutting concerns (audit, notifications, RBAC).
Package jira implements the application service for the jira bounded context — orchestrates pkg/domain/jira entities and cross-cutting concerns (audit, notifications, RBAC).
app/module
Package module implements the application service for the module bounded context — orchestrates pkg/domain/module entities and cross-cutting concerns (audit, notifications, RBAC).
Package module implements the application service for the module bounded context — orchestrates pkg/domain/module entities and cross-cutting concerns (audit, notifications, RBAC).
app/outbox
Package outbox implements the application service for the outbox bounded context — orchestrates pkg/domain/outbox entities and cross-cutting concerns (audit, notifications, RBAC).
Package outbox implements the application service for the outbox bounded context — orchestrates pkg/domain/outbox entities and cross-cutting concerns (audit, notifications, RBAC).
app/pipeline
Package pipeline provides adapters to bridge app types with pipeline interfaces.
Package pipeline provides adapters to bridge app types with pipeline interfaces.
app/reclassify
Package reclassify provides the runtime glue that connects priority-change producers (threat-intel refresh, control CRUD, rule CRUD) to the PriorityReclassifyController's queue/Reclassifier contracts.
Package reclassify provides the runtime glue that connects priority-change producers (threat-intel refresh, control CRUD, rule CRUD) to the PriorityReclassifyController's queue/Reclassifier contracts.
app/remediation
Package remediation implements the application service for remediation groups (RFC-015): grouping findings by the fix that resolves them and resolving a whole group in one action.
Package remediation implements the application service for remediation groups (RFC-015): grouping findings by the fix that resolves them and resolving a whole group in one action.
app/scan
Package scan implements the application service for the scan bounded context — orchestrates pkg/domain/scan entities and cross-cutting concerns (audit, notifications, RBAC).
Package scan implements the application service for the scan bounded context — orchestrates pkg/domain/scan entities and cross-cutting concerns (audit, notifications, RBAC).
app/scancoverage
Package scancoverage holds the pure, IO-free planning logic for license-aware rolling scan coverage (RFC-007): how big a batch may be under a scanner's license, and which assets to scan next.
Package scancoverage holds the pure, IO-free planning logic for license-aware rolling scan coverage (RFC-007): how big a batch may be under a scanner's license, and which assets to scan next.
app/scim
Package scim implements SCIM 2.0 provisioning (RFC-009): per-tenant bearer tokens and the User provisioning that maps SCIM operations onto OpenCTEM users + tenant memberships.
Package scim implements SCIM 2.0 provisioning (RFC-009): per-tenant bearer tokens and the User provisioning that maps SCIM operations onto OpenCTEM users + tenant memberships.
app/scope
Package scope implements the application service for the scope bounded context — orchestrates pkg/domain/scope entities and cross-cutting concerns (audit, notifications, RBAC).
Package scope implements the application service for the scope bounded context — orchestrates pkg/domain/scope entities and cross-cutting concerns (audit, notifications, RBAC).
app/sla
Package sla is the app-layer for SLA policy & compliance.
Package sla is the app-layer for SLA policy & compliance.
app/template
Package template implements the application service for the template bounded context — orchestrates pkg/domain/template entities and cross-cutting concerns (audit, notifications, RBAC).
Package template implements the application service for the template bounded context — orchestrates pkg/domain/template entities and cross-cutting concerns (audit, notifications, RBAC).
app/tenant
Package tenant implements the application service for the tenant bounded context — orchestrates pkg/domain/tenant entities and cross-cutting concerns (audit, notifications, RBAC).
Package tenant implements the application service for the tenant bounded context — orchestrates pkg/domain/tenant entities and cross-cutting concerns (audit, notifications, RBAC).
app/threat
Package threat implements the application service for the threat bounded context — orchestrates pkg/domain/threat entities and cross-cutting concerns (audit, notifications, RBAC).
Package threat implements the application service for the threat bounded context — orchestrates pkg/domain/threat entities and cross-cutting concerns (audit, notifications, RBAC).
app/threatmodel
Package threatmodel implements the continuous threat-modeling generation engine: it resolves a scope's crown-jewel / critical targets, walks the exposure-chain graph per attacker profile, and enumerates the applicable ATT&CK techniques per hop with a live-derived status (open / mitigated / covered / accepted / theoretical).
Package threatmodel implements the continuous threat-modeling generation engine: it resolves a scope's crown-jewel / critical targets, walks the exposure-chain graph per attacker profile, and enumerates the applicable ATT&CK techniques per hop with a live-derived status (open / mitigated / covered / accepted / theoretical).
app/ticketing
Package ticketing holds shared logic for creating issue-tracker tickets (Jira, GitHub Issues, ...) from findings.
Package ticketing holds shared logic for creating issue-tracker tickets (Jira, GitHub Issues, ...) from findings.
app/tool
Package tool implements the application service for the tool bounded context — orchestrates pkg/domain/tool entities and cross-cutting concerns (audit, notifications, RBAC).
Package tool implements the application service for the tool bounded context — orchestrates pkg/domain/tool entities and cross-cutting concerns (audit, notifications, RBAC).
app/validation
Package validation defines the Stage-4 contract: WHAT gets validated, WHAT counts as evidence, WHO gates it — but NOT HOW a technique runs.
Package validation defines the Stage-4 contract: WHAT gets validated, WHAT counts as evidence, WHO gates it — but NOT HOW a technique runs.
app/workflow
Package workflow implements the application service for the workflow bounded context — orchestrates pkg/domain/workflow entities and cross-cutting concerns (audit, notifications, RBAC).
Package workflow implements the application service for the workflow bounded context — orchestrates pkg/domain/workflow entities and cross-cutting concerns (audit, notifications, RBAC).
config
Package config loads and validates application configuration from environment variables.
Package config loads and validates application configuration from environment variables.
infra/adapters
Package adapters provides a registry for scanner output adapters.
Package adapters provides a registry for scanner output adapters.
infra/adapters/core
Package core provides the core interfaces and base implementations for the OpenCTEM Scanner SDK.
Package core provides the core interfaces and base implementations for the OpenCTEM Scanner SDK.
infra/adapters/gitleaks
Package gitleaks provides an adapter to convert Gitleaks JSON output to CTIS.
Package gitleaks provides an adapter to convert Gitleaks JSON output to CTIS.
infra/adapters/nuclei
Package nuclei provides an adapter to convert Nuclei JSONL output to CTIS.
Package nuclei provides an adapter to convert Nuclei JSONL output to CTIS.
infra/adapters/recon
Package recon provides an adapter that turns recon-scanner output (subdomain enumeration, DNS, port scans, HTTP probes, URL crawling) into a CTIS Report, so recon tools plug into the same ingest path as vulnerability scanners.
Package recon provides an adapter that turns recon-scanner output (subdomain enumeration, DNS, port scans, HTTP probes, URL crawling) into a CTIS Report, so recon tools plug into the same ingest path as vulnerability scanners.
infra/adapters/sarif
Package sarif provides an adapter to convert SARIF format to CTIS.
Package sarif provides an adapter to convert SARIF format to CTIS.
infra/adapters/semgrep
Package semgrep provides an adapter to convert Semgrep JSON output to CTIS.
Package semgrep provides an adapter to convert Semgrep JSON output to CTIS.
infra/adapters/trivy
Package trivy provides an adapter to convert Trivy JSON output to CTIS.
Package trivy provides an adapter to convert Trivy JSON output to CTIS.
infra/adapters/vuls
Package vuls provides an adapter to convert Vuls JSON output to CTIS.
Package vuls provides an adapter to convert Vuls JSON output to CTIS.
infra/controller
Package controller implements K8s-style reconciliation loop controllers for self-healing background operations.
Package controller implements K8s-style reconciliation loop controllers for self-healing background operations.
infra/fetchers
Package fetchers provides template fetching from various sources (Git, S3, HTTP).
Package fetchers provides template fetching from various sources (Git, S3, HTTP).
infra/http
Package http hosts the HTTP server scaffolding (router, options, lifecycle).
Package http hosts the HTTP server scaffolding (router, options, lifecycle).
infra/http/handler
Package handler provides HTTP handlers for the API server.
Package handler provides HTTP handlers for the API server.
infra/http/middleware
Package middleware provides HTTP middleware for the API server.
Package middleware provides HTTP middleware for the API server.
infra/http/routes
Package routes registers all HTTP routes for the API.
Package routes registers all HTTP routes for the API.
infra/importer/defectdojo
Package defectdojo converts DefectDojo findings (from its /api/v2/findings/ REST endpoint) into a CTIS report, so DefectDojo can act as a 200+-parser ingestion front-end while OpenCTEM remains the system of record (RFC-013).
Package defectdojo converts DefectDojo findings (from its /api/v2/findings/ REST endpoint) into a CTIS report, so DefectDojo can act as a 200+-parser ingestion front-end while OpenCTEM remains the system of record (RFC-013).
infra/jira
Package jira provides a REST API client for Jira Cloud/Server.
Package jira provides a REST API client for Jira Cloud/Server.
infra/jobs
Package jobs provides background job definitions and handlers using Asynq.
Package jobs provides background job definitions and handlers using Asynq.
infra/llm
Package llm provides abstractions for Large Language Model providers.
Package llm provides abstractions for Large Language Model providers.
infra/notifier
Package notifier provides clients for sending notifications to various providers.
Package notifier provides clients for sending notifications to various providers.
infra/postgres
Package postgres provides PostgreSQL repository implementations for the domain interfaces in pkg/domain/.
Package postgres provides PostgreSQL repository implementations for the domain interfaces in pkg/domain/.
infra/redis
Package redis provides production-ready Redis integration for the OpenCTEM application.
Package redis provides production-ready Redis integration for the OpenCTEM application.
infra/scanner/nessus
Package nessus converts Tenable Nessus / Tenable.sc ".nessus" XML exports into a CTIS report so vulnerability results can flow through the standard ingest pipeline (dedup, correlation, idempotency, scoped auto-resolve).
Package nessus converts Tenable Nessus / Tenable.sc ".nessus" XML exports into a CTIS report so vulnerability results can flow through the standard ingest pipeline (dedup, correlation, idempotency, scoped auto-resolve).
infra/scm
Package scm provides client implementations for various SCM (Source Code Management) providers
Package scm provides client implementations for various SCM (Source Code Management) providers
infra/storage
Package storage provides FileStorage implementations.
Package storage provides FileStorage implementations.
infra/telemetry
Package telemetry exposes Prometheus metrics for every CTEM stage so the loop-closure SLOs in have real numbers to alert on.
Package telemetry exposes Prometheus metrics for every CTEM stage so the loop-closure SLOs in have real numbers to alert on.
infra/websocket
Package websocket provides WebSocket infrastructure for real-time communication.
Package websocket provides WebSocket infrastructure for real-time communication.
metrics
Package metrics
Package metrics
pkg
apierror
Package apierror provides standardized API error handling.
Package apierror provides standardized API error handling.
app
Package app defines service interfaces for the application layer.
Package app defines service interfaces for the application layer.
crypto
Package crypto provides encryption utilities for sensitive data.
Package crypto provides encryption utilities for sensitive data.
domain/accesscontrol
Package accesscontrol provides public types and helpers reusable across the codebase.
Package accesscontrol provides public types and helpers reusable across the codebase.
domain/admin
Package admin defines the AdminUser domain entity for platform administration.
Package admin defines the AdminUser domain entity for platform administration.
domain/agent
Package agent defines the Agent domain entity for scanner/collector/agent management.
Package agent defines the Agent domain entity for scanner/collector/agent management.
domain/aitriage
Package aitriage provides domain entities for AI-powered vulnerability triage.
Package aitriage provides domain entities for AI-powered vulnerability triage.
domain/apikey
Package apikey provides public types and helpers reusable across the codebase.
Package apikey provides public types and helpers reusable across the codebase.
domain/asset
Package asset provides public types and helpers reusable across the codebase.
Package asset provides public types and helpers reusable across the codebase.
domain/assetgroup
Package assetgroup provides domain models for asset group management.
Package assetgroup provides domain models for asset group management.
domain/assettype
Package assettype provides public types and helpers reusable across the codebase.
Package assettype provides public types and helpers reusable across the codebase.
domain/attachment
Package attachment provides the domain model for file attachments.
Package attachment provides the domain model for file attachments.
domain/attackerprofile
Package attackerprofile provides public types and helpers reusable across the codebase.
Package attackerprofile provides public types and helpers reusable across the codebase.
domain/audit
Package audit provides public types and helpers reusable across the codebase.
Package audit provides public types and helpers reusable across the codebase.
domain/branch
Package branch provides public types and helpers reusable across the codebase.
Package branch provides public types and helpers reusable across the codebase.
domain/businessunit
Package businessunit provides domain models for business unit management.
Package businessunit provides domain models for business unit management.
domain/capability
Package capability defines the Capability domain entity.
Package capability defines the Capability domain entity.
domain/command
Package command defines the Command domain entity for server-controlled agents.
Package command defines the Command domain entity for server-controlled agents.
domain/compensatingcontrol
Package compensatingcontrol provides public types and helpers reusable across the codebase.
Package compensatingcontrol provides public types and helpers reusable across the codebase.
domain/compliance
Package compliance defines the Compliance Framework Mapping domain types.
Package compliance defines the Compliance Framework Mapping domain types.
domain/component
Package component provides the component domain model for software dependencies.
Package component provides the component domain model for software dependencies.
domain/credential
Package credential provides domain types for credential leak management.
Package credential provides domain types for credential leak management.
domain/ctemcycle
Package ctemcycle provides public types and helpers reusable across the codebase.
Package ctemcycle provides public types and helpers reusable across the codebase.
domain/ctemid
Package ctemid models the CTEM-ID catalog: a standardized, CVE-like set of exposure-class identifiers published as an external JSON feed.
Package ctemid models the CTEM-ID catalog: a standardized, CVE-like set of exposure-class identifiers published as an external JSON feed.
domain/dashboard
Package dashboard provides domain models for per-user customizable dashboards (RFC-021).
Package dashboard provides domain models for per-user customizable dashboards (RFC-021).
domain/datasource
Package datasource provides public types and helpers reusable across the codebase.
Package datasource provides public types and helpers reusable across the codebase.
domain/exposure
Package exposure provides public types and helpers reusable across the codebase.
Package exposure provides public types and helpers reusable across the codebase.
domain/findingsource
Package findingsource provides public types and helpers reusable across the codebase.
Package findingsource provides public types and helpers reusable across the codebase.
domain/group
Package group provides public types and helpers reusable across the codebase.
Package group provides public types and helpers reusable across the codebase.
domain/identityprovider
Package identityprovider provides the domain model for tenant-scoped identity provider configurations (Entra ID, Okta, Google Workspace, etc.).
Package identityprovider provides the domain model for tenant-scoped identity provider configurations (Entra ID, Okta, Google Workspace, etc.).
domain/ingestjob
Package ingestjob provides the domain entities for the asynchronous ingest queue (RFC-005).
Package ingestjob provides the domain entities for the asynchronous ingest queue (RFC-005).
domain/integration
Package integration provides public types and helpers reusable across the codebase.
Package integration provides public types and helpers reusable across the codebase.
domain/ioc
Package ioc — Indicators of Compromise.
Package ioc — Indicators of Compromise.
domain/module
Package module provides public types and helpers reusable across the codebase.
Package module provides public types and helpers reusable across the codebase.
domain/notification
Package notification provides public types and helpers reusable across the codebase.
Package notification provides public types and helpers reusable across the codebase.
domain/outbox
Package outbox provides domain entities for the notification outbox system.
Package outbox provides domain entities for the notification outbox system.
domain/pentest
Package pentest defines the Pentest Campaign Management domain types.
Package pentest defines the Pentest Campaign Management domain types.
domain/permission
Package permission defines granular permissions for resource-based authorization.
Package permission defines granular permissions for resource-based authorization.
domain/permissionset
Package permissionset provides public types and helpers reusable across the codebase.
Package permissionset provides public types and helpers reusable across the codebase.
domain/pipeline
Package pipeline defines the Pipeline domain entities for scan orchestration.
Package pipeline defines the Pipeline domain entities for scan orchestration.
domain/relationship
Package relationship provides domain entities for relationship suggestions.
Package relationship provides domain entities for relationship suggestions.
domain/remediation
Package remediation provides domain models for remediation campaign management.
Package remediation provides domain models for remediation campaign management.
domain/reportschedule
Package reportschedule provides domain models for recurring report generation.
Package reportschedule provides domain models for recurring report generation.
domain/role
Package role provides domain entities for role-based access control.
Package role provides domain entities for role-based access control.
domain/rule
Package rule provides domain entities for rule management.
Package rule provides domain entities for rule management.
domain/samlprovider
Package samlprovider is the domain model for per-tenant SAML 2.0 Service Provider configuration (RFC-009 Phase 9d/9e).
Package samlprovider is the domain model for per-tenant SAML 2.0 Service Provider configuration (RFC-009 Phase 9d/9e).
domain/scan
Package scan defines the Scan domain entity and types.
Package scan defines the Scan domain entity and types.
domain/scannertemplate
Package scannertemplate defines the ScannerTemplate domain entity for custom scanner templates.
Package scannertemplate defines the ScannerTemplate domain entity for custom scanner templates.
domain/scanprofile
Package scanprofile defines the ScanProfile domain entity for reusable scan configurations.
Package scanprofile defines the ScanProfile domain entity for reusable scan configurations.
domain/scansession
Package scansession provides public types and helpers reusable across the codebase.
Package scansession provides public types and helpers reusable across the codebase.
domain/scimgroup
Package scimgroup is the domain model for SCIM 2.0 Groups (RFC-009 Phase 9c): IdP-pushed groups whose membership drives a user's tenant role.
Package scimgroup is the domain model for SCIM 2.0 Groups (RFC-009 Phase 9c): IdP-pushed groups whose membership drives a user's tenant role.
domain/scimtoken
Package scimtoken is the domain model for per-tenant SCIM 2.0 provisioning bearer tokens (RFC-009).
Package scimtoken is the domain model for per-tenant SCIM 2.0 provisioning bearer tokens (RFC-009).
domain/scope
Package scope provides public types and helpers reusable across the codebase.
Package scope provides public types and helpers reusable across the codebase.
domain/secretstore
Package secretstore provides public types and helpers reusable across the codebase.
Package secretstore provides public types and helpers reusable across the codebase.
domain/session
Package session provides public types and helpers reusable across the codebase.
Package session provides public types and helpers reusable across the codebase.
domain/shared
Package shared provides shared domain types and utilities.
Package shared provides shared domain types and utilities.
domain/simulation
Package simulation provides domain models for Breach and Attack Simulation (BAS).
Package simulation provides domain models for Breach and Attack Simulation (BAS).
domain/sla
Package sla provides public types and helpers reusable across the codebase.
Package sla provides public types and helpers reusable across the codebase.
domain/suppression
Package suppression provides domain logic for platform-controlled false positive management.
Package suppression provides domain logic for platform-controlled false positive management.
domain/telemetry
Package telemetry defines the wire-format constants agents and the correlator share when reading runtime_telemetry_events.properties.
Package telemetry defines the wire-format constants agents and the correlator share when reading runtime_telemetry_events.properties.
domain/templatesource
Package templatesource defines the TemplateSource domain entity for managing external template sources.
Package templatesource defines the TemplateSource domain entity for managing external template sources.
domain/tenant
Package tenant provides public types and helpers reusable across the codebase.
Package tenant provides public types and helpers reusable across the codebase.
domain/threatactor
Package threatactor provides domain models for threat actor intelligence.
Package threatactor provides domain models for threat actor intelligence.
domain/threatintel
Package threatintel provides the threat intelligence domain model.
Package threatintel provides the threat intelligence domain model.
domain/threatmodel
Package threatmodel holds the domain model for Continuous Threat Modeling — a live, per-scope threat model that is derived (never drawn) from attacker profiles × exposure chains × applicable ATT&CK techniques, with every threat's status derived from live findings/validation.
Package threatmodel holds the domain model for Continuous Threat Modeling — a live, per-scope threat model that is derived (never drawn) from attacker profiles × exposure chains × applicable ATT&CK techniques, with every threat's status derived from live findings/validation.
domain/tool
Package tool defines the Tool domain entity for the tool registry.
Package tool defines the Tool domain entity for the tool registry.
domain/toolcategory
Package toolcategory defines the ToolCategory domain entity.
Package toolcategory defines the ToolCategory domain entity.
domain/user
Package user provides the user domain model.
Package user provides the user domain model.
domain/verifieddomain
Package verifieddomain is the domain model for tenant-scoped DNS-TXT domain-ownership verification.
Package verifieddomain is the domain model for tenant-scoped DNS-TXT domain-ownership verification.
domain/vulnerability
Package vulnerability provides the vulnerability domain model.
Package vulnerability provides the vulnerability domain model.
domain/webhook
Package webhook provides public types and helpers reusable across the codebase.
Package webhook provides public types and helpers reusable across the codebase.
domain/workflow
Package workflow defines the Workflow domain entities for automation orchestration.
Package workflow defines the Workflow domain entities for automation orchestration.
email
Package email provides email sending functionality using SMTP.
Package email provides email sending functionality using SMTP.
httpsec
Package httpsec — client IP extraction with trusted-proxy enforcement.
Package httpsec — client IP extraction with trusted-proxy enforcement.
jwt
Package jwt provides JWT token generation and validation utilities.
Package jwt provides JWT token generation and validation utilities.
keycloak
Package keycloak provides Keycloak JWT token validation and claims extraction.
Package keycloak provides Keycloak JWT token validation and claims extraction.
logger
Package logger provides public types and helpers reusable across the codebase.
Package logger provides public types and helpers reusable across the codebase.
migrations
Package migrations provides edition-aware database migration loading.
Package migrations provides edition-aware database migration loading.
pagination
Package pagination provides pagination utilities.
Package pagination provides pagination utilities.
parsers/sarif
Package sarif provides a comprehensive parser and utilities for SARIF (Static Analysis Results Interchange Format) version 2.1.0.
Package sarif provides a comprehensive parser and utilities for SARIF (Static Analysis Results Interchange Format) version 2.1.0.
password
Package password provides secure password hashing and validation.
Package password provides secure password hashing and validation.
report
Package report provides HTML report generation for pentest campaigns.
Package report provides HTML report generation for pentest campaigns.
validator
Package validator provides struct validation utilities with custom validators.
Package validator provides struct validation utilities with custom validators.
tools
lint/getbyid
Package getbyid implements a go/analysis pass that flags repository methods named GetByID / DeleteByID / UpdateByID that do NOT accept a tenantID parameter.
Package getbyid implements a go/analysis pass that flags repository methods named GetByID / DeleteByID / UpdateByID that do NOT accept a tenantID parameter.
lint/getbyid/cmd command
Command getbyidtenant runs the F-310 tenant-scope analyzer as a single-checker binary.
Command getbyidtenant runs the F-310 tenant-scope analyzer as a single-checker binary.
lint/openapicontract
Package openapicontract checks that three descriptions of this server's HTTP surface agree: the // @Router annotations on the handlers, the committed OpenAPI spec, and the routes actually registered with the router.
Package openapicontract checks that three descriptions of this server's HTTP surface agree: the // @Router annotations on the handlers, the committed OpenAPI spec, and the routes actually registered with the router.
lint/routeperm
Package routeperm implements a go/analysis pass that flags HTTP write routes (POST/PUT/PATCH/DELETE) registered in the routes package without a middleware.Require* wrapper.
Package routeperm implements a go/analysis pass that flags HTTP write routes (POST/PUT/PATCH/DELETE) registered in the routes package without a middleware.Require* wrapper.
lint/routeperm/cmd command
Command routepermcheck runs the route-permission analyzer as a single-checker binary.
Command routepermcheck runs the route-permission analyzer as a single-checker binary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL