SfSkills Domains Docs GitHub

Home / security / shield-event-log-retention-strategy

shield-event-log-retention-strategy

Use when designing Salesforce Shield Event Monitoring retention, SIEM routing, and storage-tier strategy — which event types to keep, for how long, where, and how to answer audit queries across hot/warm/cold tiers. Triggers: 'shield event log retention'. NOT for enabling Shield (see salesforce-shield-deployment) — use security/event-monitoring.

Open the skill folder on GitHub


Shield Event Log Retention Strategy

Salesforce Shield Event Monitoring emits dozens of event types — login, API, report export, URI, lightning performance, Apex execution — and each has its own volume, value, and retention implication. The default Shield retention is short (typically 30 days for Event Monitoring log files); the default volume is high; the default search experience is slow. Teams that do not design a retention strategy end up either paying to keep everything forever, or losing audit evidence exactly when they need it.

A working strategy assigns each event type to a retention tier (hot for recent investigation, warm for routine audit, cold for regulatory retention), picks a routing target (Splunk, Sentinel, Datadog, native Big Objects), and writes a query runbook so auditors can answer "did X happen" without re-ingesting cold data.


Before Starting

Core Concepts

Event Value Tiers

TierExamplesRetention
High-valueLogin, LoginAs, APITotalUsage, ReportExport, RestApi1-7 years depending on regulation
Medium-valueApexExecution, ApexCallout, VisualforceRequest90-365 days
Low-valueURI, LightningPageView30-90 days
Very-low-valueLightningInteraction, LightningPerformance7-30 days

Storage Tiers

  1. Hot — queryable from your SIEM directly. Typical retention: 30-90 days. Cost dominates here.
  2. Warm — archived to cheaper storage (S3, Azure Blob) with a re-hydration path. Typical retention: 1-2 years.
  3. Cold — immutable object storage with legal-hold support. Typical retention: 5-7+ years.

Routing Paths

PathWhen to use
Event Monitoring Analytics AppBuilt-in dashboards, short retention.
Pull via Event Log File APIHourly batch pull into SIEM; standard path.
Push via StreamingReal-time event bus subscription; higher cost.
Big ObjectsIn-platform archive for long-retention data.

The Query Runbook

A retention strategy is incomplete without a query runbook — documented steps to answer audit questions against each tier. Without it, cold storage is theoretically compliant and practically useless.


Common Patterns

Pattern 1: SIEM Hot + Object Storage Cold

Event Log Files pulled hourly into the SIEM for 60 days of hot retention; nightly export to S3 (or equivalent) for 7-year cold retention. Queries ≤ 60 days run in SIEM; older queries trigger an Athena (or equivalent) scan.

Pattern 2: Split By Event Type

High-value events go to a long-retention SIEM index; low-value events go to a short-retention index or are discarded. Cuts SIEM cost dramatically.

Pattern 3: Big Objects For Regulatory Audit

Use Salesforce Big Objects to archive high-value events in-platform. Auditors can query without leaving Salesforce; no SIEM round-trip.

Pattern 4: Streaming For Real-Time Detection

Subscribe to the real-time event bus for Login, LoginAs, and any event that feeds fraud detection or anomaly alerting. Batch ELF stays as the archival source.

Pattern 5: Sampling For Very-Low-Value Events

Keep a 10% sample of LightningInteraction for UX debugging; drop the rest. Useful when full retention would balloon ingest.


Decision Guidance

SituationRecommended ApproachReason
Regulated industry, long audit retentionSIEM hot + object storage coldCost-effective compliance
Real-time fraud / anomaly detectionStreaming + SIEM correlationDetection lag matters
Cost-sensitive orgSplit by event value + sample low-valueLargest SIEM savings
In-platform audit preferredBig Objects for high-value eventsSimpler auditor experience
Multi-region / sovereigntyRegional SIEM indicesData residency

Review Checklist

  1. Enumerate event types and their volumes.
  2. Classify each event by value tier.
  3. Select retention per tier (aligned with regulation).
  4. Design storage-tier architecture (hot / warm / cold).
  5. Implement the hourly pull and archive pipeline.
  6. Write the query runbook; test against a sample audit question.

Salesforce-Specific Gotchas

  1. Default Event Monitoring log-file retention is short; do not assume the platform keeps logs for audits.
  2. Event Log File API emits hourly; gaps happen — monitor for missing intervals.
  3. Big Objects have no standard SOQL reporting UI; Auditors must be trained or tooling built.
  4. Some event types are off by default; "Shield" doesn't mean "every event on."
  5. Real-time event bus events have their own retention (shorter) — not a substitute for ELF.

Proactive Triggers

Output Artifacts

ArtifactDescription
Retention matrixEvent type → tier → retention
Routing architecturePull/push, hot/warm/cold topology
Query runbookSteps per common audit question

Package files