SecuAAS Docs

PostgreSQL Database

SecuSiem — PostgreSQL Database

PostgreSQL Database

PostgreSQL Database

SecuSiem uses PostgreSQL 16 as the primary database for storing tenant metadata, API keys, alerts, and usage data.

Deployment

PostgreSQL is deployed as a StatefulSet in the secusiem-system namespace with:

  • Image: postgres:16-alpine
  • Storage: 100Gi on csi-cinder-high-speed
  • CPU: 500m request / 2000m limit
  • Memory: 1Gi request / 2Gi limit
  • Liveness probe: pg_isready (every 10s)
  • Readiness probe: pg_isready (every 5s)

Database Schema

Table tenants

Primary table representing client organizations.

ColumnTypeDescription
idVARCHAR(36) PKTenant UUID
nameVARCHAR(255)Organization name
slugVARCHAR(100) UNIQUEURL-safe identifier
loki_org_idVARCHAR(100) UNIQUELoki multi-tenant ID (e.g., tenant-acme)
s3_bucketVARCHAR(255) UNIQUEOVH S3 bucket name
grafana_org_idINTEGERGrafana organization ID
authentik_group_idVARCHAR(100)Authentik group ID
pricing_tierENUMstarter, business, enterprise
stripe_customer_idVARCHAR(100) UNIQUEStripe customer ID
stripe_subscription_idVARCHAR(100) UNIQUEStripe subscription ID
statusENUMactive, suspended, trial, cancelled
trial_ends_atDATETIMETrial period end date
contact_emailVARCHAR(255)Contact email
contact_nameVARCHAR(255)Contact name
settingsJSONCustom configuration
extra_metadataJSONAdditional metadata
created_atDATETIMECreation date
updated_atDATETIMELast update
deleted_atDATETIMESoft delete timestamp

Table api_keys

ColumnTypeDescription
idVARCHAR(36) PKUUID
tenant_idVARCHAR(36) FKReference to tenant
key_hashVARCHAR(255) UNIQUEbcrypt hash of the key
key_prefixVARCHAR(20)Prefix for identification (e.g., sk_live_AbCd...)
nameVARCHAR(255)Descriptive name
scopesJSONPermissions (logs:write, logs:read, etc.)
rate_limit_rpmINTEGERRequests per minute limit
is_activeBOOLEANActive or revoked
expires_atDATETIMEExpiration date
last_used_atDATETIMELast usage timestamp

Table usage_records

ColumnTypeDescription
idVARCHAR(36) PKUUID
tenant_idVARCHAR(36) FKReference to tenant
period_startDATETIMEPeriod start
period_endDATETIMEPeriod end
logs_ingested_mbFLOATIngested log volume (MB)
logs_stored_gbFLOATStored volume (GB)
alerts_generatedINTEGERNumber of alerts
api_callsINTEGERNumber of API calls
claude_api_callsINTEGERNumber of Claude analyses
estimated_cost_usdFLOATEstimated cost

Table alerts

ColumnTypeDescription
idVARCHAR(36) PKUUID
tenant_idVARCHAR(36) FKReference to tenant
rule_idVARCHAR(100)Detection rule ID
severityENUMlow, medium, high, critical
titleVARCHAR(500)Alert title
descriptionTEXTAlert description
mitre_tacticVARCHAR(20)MITRE ATT&CK tactic
mitre_techniqueVARCHAR(20)MITRE ATT&CK technique
source_ipVARCHAR(45)Source IP address
is_resolvedBOOLEANResolved status
resolved_atDATETIMEResolution timestamp
created_atDATETIMECreation date

Table detection_rules

ColumnTypeDescription
idVARCHAR(36) PKUUID
tenant_idVARCHAR(36) FKTenant (null for global rules)
rule_idVARCHAR(100)Rule identifier
nameVARCHAR(255)Rule name
patternsJSONRegex patterns array
severityENUMSeverity level
mitre_tacticVARCHAR(20)ATT&CK tactic
mitre_techniqueVARCHAR(20)ATT&CK technique
is_activeBOOLEANRule status
thresholdINTEGERMatch count threshold
window_secondsINTEGERTime window for threshold

Table audit_logs

ColumnTypeDescription
idVARCHAR(36) PKUUID
tenant_idVARCHAR(36) FKTenant
user_idVARCHAR(100)User who performed the action
actionVARCHAR(100)Action performed
resource_typeVARCHAR(50)Resource type
resource_idVARCHAR(100)Resource identifier
detailsJSONAdditional details
ip_addressVARCHAR(45)Client IP
created_atDATETIMETimestamp

On this page