Skip to content

API Deployment

The CBOM API is a Spring Boot application that handles asset ingestion, risk classification, compliance evaluation, CycloneDX export, and user authentication. It runs on port 9090 by default.


Create a .env file from the template:

Terminal window
cd cbom/api
cp .env.template .env
VariableDescriptionDefault
CBOM_PORTAPI server port9090
MONGODB_URIMongoDB connection stringmongodb://localhost:27017/cbom
CBOM_JWT_SECRETJWT signing secret (min 32 chars)Dev default (change in prod)
CBOM_JWT_EXPIRATION_HOURSToken expiration24
CBOM_CORS_ORIGINSAllowed CORS origins (comma-separated)http://localhost:4200,http://localhost:9090
CBOM_SMTP_HOSTSMTP server for alert emailssmtp.gmail.com
CBOM_SMTP_PORTSMTP port587
CBOM_SMTP_USERNAMESMTP username
CBOM_SMTP_PASSWORDSMTP password
CBOM_ALERT_EMAIL_ENABLEDEnable email alertsfalse
CBOM_ALERT_EMAIL_TOAlert recipient email

Terminal window
cd cbom/api
mvn spring-boot:run

The dev profile enables:

  • CORS for localhost:4200 (Angular dev server)
  • Swagger UI at /swagger-ui.html
  • API docs at /api-docs
Terminal window
java -jar cbom-api.jar --spring.profiles.active=prod

The prod profile enables:

  • Embedded Angular UI (served from classpath /static/)
  • CORS disabled (same-origin)
  • Response compression (HTML, CSS, JS, JSON)
  • Static resource caching (1 year max-age)

ProfileUse Case
dev (default)Local development, CORS enabled, Swagger enabled
prodProduction, embedded UI, compression, no CORS

The API connects to MongoDB using the MONGODB_URI environment variable.

Terminal window
# Docker (development)
docker run -d \
--name cbom-mongo \
-p 27017:27017 \
-v cbom-data:/data/db \
mongo:7
# Connection string for replica set (production)
MONGODB_URI=mongodb://user:pass@host1:27017,host2:27017/cbom?replicaSet=rs0&authSource=admin

The API auto-creates the cbom database and crypto_assets collection with required indexes on first startup.


Key endpoint groups:

PathPurpose
POST /api/ingestSensor asset ingestion
GET /api/assetsQuery crypto assets
GET /api/analytics/*Dashboard analytics
GET /api/export/cyclonedxCycloneDX v1.6 export
GET /api/bom-link/*BOM-Link URN operations
GET /api/relationships/*Asset relationship queries
POST /api/attestations/*Compliance attestations
GET /api/sensorsSensor management
GET /api/schedulesScan schedules
GET /api/alertsAlert management
POST /api/auth/*Authentication (login, register)
GET /api/settingsPlatform settings
GET /api/quantum-risk/rulesRisk classification rules

Full API documentation available at /swagger-ui.html when running in dev mode.


Terminal window
curl http://localhost:9090/actuator/health