Skip to content

Security: Astraive/loza

Security

docs/security.md

Security

For the current list of open security work, see Open security findings. Historical v0.2.4-era audit/review reports are marked Status: HISTORICAL and are not a statement of current risk.

Architecture

Go SDK
  |  HTTPS
  |  Authorization: Bearer lz_sec_live_k_xxx_yyyy
  |  X-Loza-Service: checkout-api
  |  X-Loza-Env: prod
  v
loza-collector (data plane)
  |  validates API key (with cache)
  |  attaches org/project/key context
  |  enforces per-route RBAC permission
  |  enforces ABAC restrictions
  |  rate limits per key
  |  redacts/enriches
  v
loza-cortex / sinks

Key Types

Type Format Use Case
Secret lz_sec_live_k_xxx_yyy Backend/server SDKs
Public lz_pub_live_k_xxx_yyy Frontend/browser/mobile
Local lz_local_dev_yyy Local development

RBAC Roles

Role Use Case Permissions
collector_ingest_public Frontend events:write, heartbeat:write
collector_ingest_server Backend events:write, logs:write, traces:write, metrics:write, heartbeat:write
collector_ingest_enterprise Enterprise All above + profiles:write, attachments:write
project_readonly Dashboard All read permissions
project_operator DevOps Read + schema:write
project_admin Admin Read + delete + project:admin (no ingest)

SDK Configuration

// Production
client := loza.New(loza.Config{
    Endpoint: "https://collector.loza.dev",
    APIKey:   os.Getenv("LOZA_API_KEY"),
    Service:  "checkout-service",
    Env:      "prod",
})

// Local dev
client := loza.New(loza.Config{
    Endpoint: "http://localhost:9308",
    APIKey:   "lz_local_dev_mydevtoken",
    Service:  "test-service",
    Env:      "dev",
    Insecure: true,
})

Collector Configuration

auth:
  enabled: true
  server_secret: "${COLLECTOR_SERVER_SECRET}"
  cache_ttl: 60s
  negative_cache_ttl: 10s
  keys:
    - name: "prod-backend"
      key_id: "k2M9aQp"
      secret_env: "PROD_KEY_SECRET"
      kind: "sec"
      roles: ["collector_ingest_server"]
      allowed_envs: ["prod"]
      allowed_services: ["checkout-api"]
      max_requests_per_minute: 5000
      max_events_per_minute: 50000
      max_payload_bytes: 262144
    - name: "web-dashboard"
      key_id: "kabc123"
      secret_env: "WEB_KEY_SECRET"
      kind: "pub"
      roles: ["collector_ingest_public"]
      allowed_origins: ["https://app.example.com"]
      max_requests_per_minute: 600
      max_events_per_minute: 1000
      max_payload_bytes: 65536

Default-Deny

All auth decisions follow default-deny. Unknown roles, missing permissions, missing env/service/origin/IP all result in denial.

Token Storage

  • Never store raw tokens
  • HMAC-SHA256: hmac_sha256(server_secret, token_secret)
  • Constant-time comparison

Key Rotation

  1. Create new key
  2. Deploy with new key
  3. Both keys accepted during overlap
  4. Revoke old key

Audit Events

The intended audit events are key.authenticated, key.failed, key.rate_limited, key.permission_denied, key.env_denied, key.origin_denied, and key.payload_too_large.

Status: OPEN. AuditLogger (collector/internal/auth/audit.go) is defined but is not yet invoked from the production auth middleware, so these events are not currently emitted. See OPEN-001 in the tracker.

Further Reading

There aren't any published security advisories