Competitor Ingest DB Snapshot Governance (CM3)

Status: Draft · Date: 2025-12-04 Scope: Enforce database snapshot governance including versioning, freshness SLA, and rollback procedures for imported external feeds.

Objectives

Snapshot Versioning

Version Scheme

{tool}-{timestamp}-{sequence}

Examples:
- syft-20251204T000000Z-001
- trivy-20251204T120000Z-001
- clair-20251204T060000Z-002

Snapshot Record

{
  "id": "syft-20251204T000000Z-001",
  "tool": "syft",
  "toolVersion": "1.0.0",
  "importedAt": "2025-12-04T00:00:00Z",
  "sourceHash": "b3:...",
  "normalizedHash": "b3:...",
  "recordCount": 1234,
  "state": "active",
  "previousSnapshot": "syft-20251203T000000Z-001",
  "metadata": {
    "sourceUri": "https://example.com/sbom.json",
    "importUser": "system",
    "importReason": "scheduled_sync"
  }
}

Freshness SLA

Thresholds by Tool

ToolMax AgeStale ThresholdCritical Threshold
Syft7 days14 days30 days
Trivy7 days14 days30 days
Clair7 days14 days30 days
CustomConfigurableConfigurableConfigurable

Freshness States

StateConditionAction
freshage < max_ageNormal operation
stalemax_age <= age < criticalEmit warning
criticalage >= criticalBlock queries without override
expiredManual expiryData unavailable

SLA Monitoring

{
  "sla": {
    "tool": "syft",
    "snapshotId": "syft-20251204T000000Z-001",
    "importedAt": "2025-12-04T00:00:00Z",
    "age": "P2D",
    "state": "fresh",
    "nextCheck": "2025-12-05T00:00:00Z",
    "thresholds": {
      "maxAge": "P7D",
      "stale": "P14D",
      "critical": "P30D"
    }
  }
}

Rollback Procedures

Rollback Triggers

TriggerAuto/ManualAction
Import failureAutoRollback to previous
Validation failureAutoRollback to previous
Data corruptionManualRollback to specified
Compliance requirementManualRollback to specified
User requestManualRollback to specified

Rollback Workflow

┌─────────────┐
│   Initiate  │
│  Rollback   │
└─────────────┘
       │
       ▼
┌─────────────┐
│   Verify    │──Fail──► Abort
│   Target    │
└─────────────┘
       │
      Pass
       │
       ▼
┌─────────────┐
│   Create    │
│  Savepoint  │
└─────────────┘
       │
       ▼
┌─────────────┐
│   Restore   │──Fail──► Restore Savepoint
│   Snapshot  │
└─────────────┘
       │
      Pass
       │
       ▼
┌─────────────┐
│   Verify    │──Fail──► Restore Savepoint
│   Restore   │
└─────────────┘
       │
      Pass
       │
       ▼
┌─────────────┐
│   Commit    │
│   Change    │
└─────────────┘
       │
       ▼
┌─────────────┐
│   Update    │
│   Active    │
└─────────────┘

Rollback Command

# Rollback to previous snapshot
stellaops ingest rollback --tool syft

# Rollback to specific snapshot
stellaops ingest rollback --tool syft --snapshot-id syft-20251201T000000Z-001

# Dry run
stellaops ingest rollback --tool syft --dry-run

# Force rollback (skip confirmations)
stellaops ingest rollback --tool syft --force

Rollback Response

{
  "rollback": {
    "status": "completed",
    "tool": "syft",
    "from": {
      "snapshotId": "syft-20251204T000000Z-001",
      "recordCount": 1234
    },
    "to": {
      "snapshotId": "syft-20251203T000000Z-001",
      "recordCount": 1200
    },
    "executedAt": "2025-12-04T12:00:00Z",
    "executedBy": "admin@example.com",
    "reason": "Data corruption detected"
  }
}

Retention Policy

Snapshot Retention

CategoryRetentionCleanup
ActiveIndefiniteNever
Previous (N-1)30 daysAuto
Archived90 daysAuto
Audit1 yearManual

Cleanup Schedule

{
  "retention": {
    "schedule": "0 0 * * *",
    "rules": [
      {
        "category": "previous",
        "maxAge": "P30D",
        "action": "archive"
      },
      {
        "category": "archived",
        "maxAge": "P90D",
        "action": "delete"
      }
    ],
    "exceptions": [
      {
        "snapshotId": "syft-20251101T000000Z-001",
        "reason": "Audit hold",
        "expiresAt": "2026-12-01T00:00:00Z"
      }
    ]
  }
}

Audit Trail

Audit Events

EventFieldsRetention
snapshot_importedid, tool, hash, user, timestamp1 year
snapshot_activatedid, previous_id, user, timestamp1 year
snapshot_rolled_backfrom_id, to_id, reason, user1 year
snapshot_expiredid, reason, user, timestamp1 year
snapshot_deletedid, reason, user, timestamp1 year

Audit Record Format

{
  "audit": {
    "id": "audit-12345",
    "event": "snapshot_rolled_back",
    "timestamp": "2025-12-04T12:00:00Z",
    "user": "admin@example.com",
    "details": {
      "fromSnapshot": "syft-20251204T000000Z-001",
      "toSnapshot": "syft-20251203T000000Z-001",
      "reason": "Data corruption detected",
      "recordsAffected": 34
    },
    "hash": "b3:..."
  }
}

API Endpoints

List Snapshots

GET /api/v1/ingest/snapshots?tool=syft&state=active

Get Snapshot Details

GET /api/v1/ingest/snapshots/{snapshotId}

Initiate Rollback

POST /api/v1/ingest/snapshots/{snapshotId}/rollback
Content-Type: application/json

{
  "reason": "Data corruption detected",
  "dryRun": false
}

Check SLA Status

GET /api/v1/ingest/sla?tool=syft