Appearance
Deployment
This page covers running IDVIZE in production: Docker containers, a production checklist, backup and restore, and upgrade procedures.
Current state
Docker files and compose configuration ship with the repository. The deployment model has been tested on single-node Docker Compose. Kubernetes manifests and multi-replica orchestration are planned but not yet built.
Architecture overview
A production IDVIZE deployment has three components:
| Component | Image | Default port | Purpose |
|---|---|---|---|
| API | idvize-api | 3001 | Express backend, schema migrations, assessment engine, platform adapters |
| Web | idvize | 80 (Nginx) | React SPA, serves static assets, proxies API requests |
| PostgreSQL | postgres:16 | 5432 | All persistent state: tenants, users, assessments, audit logs, credentials |
The API is the only component that connects to PostgreSQL. The web container serves the compiled frontend and proxies /v1/* requests to the API.
Docker
Building images
bash
# API (multi-stage: build with Node, run with Node slim)
cd idvize-api
docker build -t idvize-api:latest .
# Frontend (multi-stage: build with Node, serve with Nginx)
cd idvize
docker build -t idvize:latest .Docker Compose
The repository includes docker-compose.yml at the root. Start everything:
bash
docker compose up -dThis starts PostgreSQL, waits for it to accept connections, runs schema migrations automatically on API startup, then starts the web frontend.
Environment variables
Pass environment variables to the API container. Required:
| Variable | Purpose |
|---|---|
DATABASE_URL | PostgreSQL connection string for the owner role (migrations) |
JWT_SIGNING_SECRET | HMAC-SHA-256 secret for JWT and plan approval hashes. No default in production — the server refuses to start without it. |
API_KEY | Static API key for machine-to-machine endpoints. |
SEED_MODE | production for an empty database. demo loads sample tenants and data. |
Optional:
| Variable | Purpose | Default |
|---|---|---|
DATABASE_APP_URL | PostgreSQL connection for the restricted idvize_app role (runtime queries, RLS enforced). Set this in production. If unset, the API derives it from DATABASE_URL by switching to user idvize_app with the built-in development password, which is published in the source code. | DATABASE_URL host with idvize_app and the development password |
PORT | API listen port | 3001 |
NODE_ENV | production enables stricter validation | development |
LOG_LEVEL | debug, info, warn, error | info |
CORS_ORIGINS | Comma-separated allowed frontend origins | localhost defaults |
ANTHROPIC_API_KEY | Enables AI-assisted cost analysis and plan review. Without it, AI features return graceful fallbacks. | None |
CONTINUOUS_ASSESSMENT_INTERVAL_MINUTES | How often the assessment sweep runs. 0 disables it. | 60 |
COMMERCIAL_ENFORCEMENT | observe (log-only) or enforce (block unlicensed actions) | observe |
Platform connector credentials (Entra, SailPoint, CyberArk, Okta) are configured per-tenant through the integrations API, not as global environment variables. See Integrations.
Health check
GET /healthReturns JSON with service status, running commit, branch, uptime, active modules and integration status. Unauthenticated — suitable for load balancer and container orchestrator probes.
The Docker image includes a built-in healthcheck that polls /health every 30 seconds with a 5-second timeout and a 40-second start period.
Networking
The API container exposes port 3001. The web container exposes port 80. In production, place both behind a reverse proxy (Nginx, Caddy, or a cloud load balancer) that terminates TLS.
WARNING
IDVIZE does not terminate TLS itself. Always run it behind a TLS-terminating proxy in production.
Production checklist
Before going live, verify each item:
Security
- [ ]
JWT_SIGNING_SECRETis a cryptographically random string (min 32 characters), not a default or example value - [ ]
API_KEYis unique per environment - [ ]
SEED_MODEisproduction(neverdemoordevelopmentin production) - [ ] TLS is terminated at the reverse proxy; no plaintext HTTP is reachable from the internet
- [ ] PostgreSQL is not exposed to the public network
- [ ]
DATABASE_APP_URLuses a restricted role (not the owner) for runtime queries — RLS enforces tenant isolation at the database level - [ ] The
idvize_approle's password is changed from the development default after the first migration (ALTER ROLE idvize_app PASSWORD '<random>'), andDATABASE_APP_URLcarries the new password. The migration creates the role with a password that is in the source code. - [ ] Connector credentials are stored through the integrations API (AES-256-GCM encrypted at rest), not as environment variables
- [ ]
CORS_ORIGINSlists only the production frontend origin
Database
- [ ] PostgreSQL 14 or later
- [ ] Dual-role setup: an owner role (for migrations) and an app role (for runtime, RLS enforced)
- [ ] Automated backups configured (see Backup and restore)
- [ ] Connection pooling in place (PgBouncer or equivalent) if serving more than one tenant
Operations
- [ ] Health check endpoint (
/health) is polled by a load balancer or monitoring system - [ ] Container logs are shipped to a log aggregator (the API uses structured JSON logging)
- [ ]
CONTINUOUS_ASSESSMENT_INTERVAL_MINUTESis set to an appropriate cadence for the workload - [ ] DNS and TLS certificates are configured for the production domain
Known limitations
- Single-instance only. Several in-memory caches (replay protection, adapter tenant locks) are not shared across replicas. Running multiple API instances against the same database will work for reads but may produce duplicate assessment writes or race on ingestion locks. Multi-instance support requires a shared cache layer.
- No built-in rate limiting. Apply rate limits at the reverse proxy or API gateway.
- No refresh tokens. JWTs expire after 8 hours. Users must re-authenticate after expiry.
Backup and restore
What to back up
All persistent state is in PostgreSQL. The application has no local file state that needs backup.
Critical tables (data loss is unrecoverable):
| Category | Tables |
|---|---|
| Tenants and users | tenants, users, revoked_sessions |
| Assessments | assessments (append-only ledger), assessments_archive, assessment_sweeps |
| Decisions and baselines | baseline_decisions, control_declarations, automation_policy_versions |
| Identities and accounts | identities, accounts, account_correlations, account_owners, account_retirements |
| Access objects | access_objects, access_edges, auth_policies, auth_policy_reads, authentication_methods |
| Execution | execution_sessions, execution_approvals, execution_evidence, rollback_objects |
| Commercial | tenant_product_grants, usage_ledger, ai_usage_ledger |
| SoD | sod_policies, sod_policy_sides, sod_violations, sod_violation_history |
| Audit | audit_logs (append-only — the compliance trail) |
| Credentials | connector_credentials (AES-256-GCM encrypted) |
Taking a backup
Use pg_dump for logical backups:
bash
pg_dump -Fc -f idvize-backup-$(date +%Y%m%d-%H%M).dump \
-U idvize_owner idvizeFor large databases, use pg_dump with --jobs for parallel dump:
bash
pg_dump -Fd -j 4 -f idvize-backup-$(date +%Y%m%d-%H%M) \
-U idvize_owner idvizeRestore
bash
pg_restore -d idvize -U idvize_owner --clean --if-exists \
idvize-backup-20261116-0800.dumpAfter restore, restart the API server. It will re-apply RLS policies and grants on startup.
Backup schedule
Recommended:
| Frequency | Retention | Method |
|---|---|---|
| Every hour | 48 hours | pg_dump to local storage |
| Daily | 30 days | pg_dump to offsite / object storage |
| Weekly | 1 year | Full backup to offsite with integrity check |
The assessments and audit_logs tables are append-only and grow continuously. Plan storage accordingly.
Upgrading
Standard upgrade (zero-downtime on single instance)
Pull the latest code or image.
bashgit pull origin main # or docker pull idvize-api:latest docker pull idvize:latestBack up the database before applying migrations.
bashpg_dump -Fc -f pre-upgrade-$(date +%Y%m%d-%H%M).dump \ -U idvize_owner idvizeRestart the API container. Migrations run automatically on startup. The migration system uses a PostgreSQL advisory lock, so concurrent starts are safe — one instance runs migrations while others wait.
bashdocker compose up -d --buildVerify.
bashcurl -s http://localhost:3001/health | jq .Confirm
status: "ok"and that thebuild.commitmatches the expected version.
Rollback
If a migration introduces a problem:
- Stop the API container.
- Restore the pre-upgrade database backup.
- Deploy the previous image or checkout the previous commit.
- Restart.
WARNING
Migrations are forward-only. There is no automated rollback for schema changes. Always take a backup before upgrading.
API versioning
The API is served under /v1/.... When a breaking change is introduced, a new version (/v2/...) is added alongside the old one. The previous version continues to serve requests with Deprecation and Sunset headers until the announced sunset date. See the versioning policy for details.
Monitoring
Logs
The API emits structured JSON logs to stdout. Ship them to your log aggregator (ELK, Datadog, CloudWatch, etc.).
Key log fields:
level:debug,info,warn,errortenantId: Present on tenant-scoped requestsrequestId: Correlation ID fromX-Request-IDheader (auto-generated if absent)method,path,statusCode,durationMs: On every HTTP request
Metrics to watch
| Metric | Where to find it | Alert threshold |
|---|---|---|
| Health check | GET /health | Any non-200 response |
| Assessment sweep age | GET /v1/controls/monitoring (lastComplete.ageMinutes) | > 2x the configured interval |
| Database connections | PostgreSQL pg_stat_activity | > 80% of max_connections |
| Audit log growth | SELECT count(*) FROM audit_logs WHERE created_at > now() - interval '1 hour' | Unusual spikes may indicate brute force or misconfiguration |
| Disk usage | Container and database volumes | > 80% capacity |
Alerting
IDVIZE does not include a built-in alerting system. Use your infrastructure's monitoring to alert on:
- Health check failures
- Container restarts
- Assessment sweep not completing within its interval
- Database connection exhaustion
- Disk space on the PostgreSQL volume