Skip to main content
InfraAudit is configured entirely through environment variables. For Docker Compose deployments, set them in your .env file. For Kubernetes, set them in a Secret or ConfigMap and reference them in the deployment manifests.

Required variables

The backend will not start without all five of these variables set:
VariableDescription
SUPABASE_URLYour Supabase project URL — e.g. https://xxxxx.supabase.co
SUPABASE_JWT_SECRETJWT secret from Project Settings → API → JWT Settings
SUPABASE_ANON_KEYanon/public key from Project Settings → API
SUPABASE_SERVICE_ROLE_KEYservice_role key from Project Settings → API
ENCRYPTION_KEY32-byte hex key used to encrypt cloud credentials. Generate with openssl rand -hex 32
Never use the default placeholder value for ENCRYPTION_KEY. Generate a unique key before deploying. See Secrets and encryption for details.

Server

VariableDefaultDescription
SERVER_PORT8080Port the HTTP API listens on
ENVIRONMENTdevelopmentdevelopment or production. Production disables the Swagger UI and enables stricter error handling
FRONTEND_URLhttp://localhost:5173URL of the frontend, used for CORS headers and auth redirects
ALLOWED_ORIGINS*Comma-separated list of allowed CORS origins. Set to your frontend URL in production
Set ENVIRONMENT=production before exposing your deployment to the internet. It disables the /swagger UI and /debug endpoints.

Database

VariableDefaultDescription
DB_DRIVERpostgrespostgres or sqlite. SQLite is supported for development and single-user deployments only
DB_HOSTlocalhostPostgres hostname. In Docker Compose this is the service name (postgres)
DB_PORT5432Postgres port
DB_NAMEinfrauditDatabase name
DB_USERinfrauditDatabase user
DB_PASSWORDDatabase password (required for Postgres)
DB_SSLMODEdisablePostgres SSL mode: disable, require, or verify-full. Use require for any remote database
DB_MAX_OPEN_CONNS25Maximum number of open database connections
DB_MAX_IDLE_CONNS5Maximum number of idle database connections
SQLITE_PATH./infraudit.dbPath to the SQLite file when DB_DRIVER=sqlite

Redis

VariableDefaultDescription
REDIS_URLredis://localhost:6379Redis connection URL. In Docker Compose this is redis://redis:6379
REDIS_PASSWORDRedis password, if your Redis instance requires authentication
REDIS_DB0Redis database index
Redis is optional. If the API cannot connect to Redis at startup, it disables caching and continues running. All features remain available; some responses may be slower.

Job scheduler

These variables control when background jobs run. Values are standard cron expressions.
VariableDefaultDescription
JOB_RESOURCE_SYNC_SCHEDULE0 */6 * * *How often to sync the resource inventory from connected providers (every 6 hours)
JOB_DRIFT_DETECTION_SCHEDULE0 */4 * * *How often to run drift detection against baselines (every 4 hours)
JOB_VULNERABILITY_SCAN_SCHEDULE0 2 * * *When to run vulnerability scans (daily at 02:00)
JOB_COST_SYNC_SCHEDULE0 3 * * *When to sync billing data from providers (daily at 03:00)
JOB_COMPLIANCE_CHECK_SCHEDULE0 4 * * *When to run compliance assessments (daily at 04:00)
JOB_TIMEOUT_SECONDS300Maximum runtime for a single job execution before it is cancelled

Notifications

Slack

VariableDefaultDescription
SLACK_WEBHOOK_URLSlack incoming webhook URL for alert delivery
SLACK_CHANNEL#alertsDefault Slack channel for alerts

Email (SMTP)

VariableDefaultDescription
EMAIL_ENABLEDfalseEnable email notifications
SMTP_HOSTSMTP server hostname
SMTP_PORT587SMTP port
SMTP_USERSMTP username
SMTP_PASSWORDSMTP password
SMTP_FROMFrom address for outgoing emails
SMTP_TLStrueEnable STARTTLS
SENDGRID_API_KEYSendGrid API key. When set, InfraAudit uses SendGrid instead of direct SMTP

AI recommendations

VariableDefaultDescription
GEMINI_API_KEYGoogle Gemini API key. When not set, InfraAudit falls back to rule-based recommendations
GEMINI_MODELgemini-2.5-proGemini model to use for recommendations

Vulnerability scanning

VariableDefaultDescription
VULN_SEVERITY_THRESHOLDmediumMinimum severity to store: critical, high, medium, or low
TRIVY_CACHE_DIR/tmp/trivy-cacheLocal directory for the Trivy vulnerability database
TRIVY_DB_REPOSITORYCustom Trivy database OCI image URL, for air-gapped environments
NVD_API_KEYNVD API key for faster CVE enrichment

Logging

VariableDefaultDescription
LOG_LEVELinfoLog verbosity: debug, info, warn, or error
LOG_FORMATtextLog format: text for human-readable output or json for structured log ingestion

Metrics

VariableDefaultDescription
METRICS_ENABLEDtrueEnable the /metrics Prometheus endpoint
METRICS_AUTH_TOKENBearer token required to access /metrics. Set this if the endpoint is internet-accessible

Remediation

VariableDefaultDescription
REMEDIATION_REQUIRE_APPROVALtrueRequire explicit operator approval before executing any remediation action. Disable only in fully automated pipelines
REMEDIATION_ROLLBACK_WINDOW_MINUTES30How long the rollback window remains open after a remediation is executed