SfSkills Domains Docs GitHub

Home / architect / salesforce-shield-architecture

salesforce-shield-architecture

Salesforce Shield as an architectural choice — Platform Encryption + Event Monitoring + Field Audit Trail as three SEPARATELY-LICENSED components, none of which ship in any standard edition.

Open the skill folder on GitHub


Salesforce Shield Architecture

Shield is the wrong size of question to answer with "go to Setup → enable encryption". It's three separately-priced add-on products — Platform Encryption, Event Monitoring, Field Audit Trail — sold per-org, none included in any standard edition. The architectural decision is which components, with what posture, against which fields, and that has to happen before anyone clicks anything in Setup.

This skill is the architectural decision layer. The setup mechanics for each component live in their own skills: security/platform-encryption, security/event-monitoring, security/field-audit-trail. Compliance certification mapping (specifically what HIPAA / FedRAMP-High / PCI require from Shield) lives in a separate skill — Shield is part of the answer to those, not the whole answer.


Before Starting


Core Concepts

Shield's three components, each with its own license

ComponentWhat it doesLicense (separately purchased)
Shield Platform EncryptionAt-rest encryption of selected fields, files, search indexes. Uses Salesforce-managed or customer-supplied keys.Platform Encryption PSL
Event MonitoringHourly / real-time event log files (Login, API, Apex, Visualforce, etc.) and Real-Time Event Monitoring streams via Pub/Sub. Backs Transaction Security Policies for in-flight blocking.Event Monitoring PSL
Field Audit TrailPer-object configurable history retention up to 10 years; stores history rows in FieldHistoryArchive (queryable). Replaces the 18-month default FieldHistory retention.Field Audit Trail PSL

Standard Salesforce ships with classic encryption (a different product — single-key, weaker, fewer field types) and 18-month field history retention in <Object>History (no separate license). Shield upgrades both, plus adds Event Monitoring.

Platform Encryption: probabilistic vs deterministic

The most consequential per-field decision under Shield Platform Encryption. Salesforce supports two schemes:

SchemeSame plaintext → same ciphertext?Exact-match filter?Sort / ORDER BY?Strength
Probabilistic (default)No (random IV per encryption)NONOStronger — ciphertext analysis cannot infer plaintext distribution
Deterministic — case-sensitiveYesYES (=, IN)NOWeaker — ciphertext frequency analysis is possible
Deterministic — case-insensitiveYes (after case-fold)YES, case-insensitiveNOSame as case-sensitive plus case-fold

Sorting is not a capability either scheme buys you. Salesforce states you can't sort records in list views by fields that contain encrypted data, and the same restriction applies to encrypted fields in flows, orchestrations and processes. The mechanism makes this unsurprising: deterministic encryption guarantees only that equal plaintexts produce equal ciphertexts — it says nothing about order. Ciphertext collates in an order unrelated to the plaintext, so a lexicographic sort on ciphertext would return rows in an order that is not the business order even where the platform allowed it. Treat any claim that deterministic encryption "enables sorting" as false regardless of how it is justified.

Deterministic is therefore the only path if SOQL needs to filter by exact match on the encrypted field. It does not unlock ranges, LIKE/wildcard, or ordering. If the design needs to sort or range-scan on a value, the answer is not a different encryption scheme — it is to keep a separate unencrypted sortable surrogate (a bucketed or masked field), or to not encrypt that field. Probabilistic is the right default for everything else. You cannot change scheme on a populated field without re-encrypting every row.

Field types you cannot encrypt

The blocklist matters because authors often promise encryption of fields that physically cannot be encrypted:

If a field on the encryption candidate list is one of these, the architectural answer is to encrypt the underlying field that the formula / roll-up reads from, not the derived field.

BYOK vs Cache-Only Key Service (CCKM)

The two customer-supplied-key models have very different operational shapes:

ModeKey resides where?Key fetch pathOutage impact
Salesforce-managedSalesforce key infrastructureInternalSalesforce's standard reliability
BYOK (tenant-secret upload)Salesforce, after upload from customerCustomer uploads key material; Salesforce derives data-encryption keys from itCustomer can rotate / destroy. Loss of key = loss of data
Cache-Only Key Service (CCKM)Customer HSM (e.g. AWS CloudHSM, Azure Key Vault, on-prem)Salesforce fetches just-in-time, holds in cache onlyStrongest posture; KMS outage causes encryption operations to FAIL until cache or KMS is restored

CCKM is the right answer for high-compliance shops (regulator-audited key custody). BYOK is the right middle ground for "we want to control rotation but don't want to operate an HSM for Salesforce traffic". Salesforce-managed is fine for orgs whose compliance posture doesn't require customer custody.

Field Audit Trail retention

Not a single dial — set per object in metadata XML:

<HistoryRetentionPolicy>
    <archiveAfterMonths>18</archiveAfterMonths>
    <archiveRetentionYears>10</archiveRetentionYears>
    <description>HIPAA-archived patient records</description>
</HistoryRetentionPolicy>

archiveAfterMonths controls when records move from the standard <Object>History table (queryable in reports) to FieldHistoryArchive (queryable via SOQL only). archiveRetentionYears controls deletion from the archive — capped at 10 years.


Decision Guidance

SituationApproachReason
User asks "how do I turn on encryption?" before licensing is confirmedStop. Confirm Platform Encryption PSL first.Telling them to go to Setup against a non-Shield org wastes a sprint.
Field needs SOQL WHERE equality filter AND must be encryptedDeterministic case-sensitive (or case-insensitive if business requires)Probabilistic blocks the filter
Field is a Formula / Roll-Up / Unique-Indexed-External-IDEncrypt the source field insteadThe derived field cannot be encrypted; encrypting the source flows the property through
HIPAA / FedRAMP / regulator-audited key custodyCCKM (Cache-Only Key Service) with customer HSMHighest posture; KMS outage = encryption ops fail (acceptable trade)
Compliance requires customer-controlled rotation but no HSM operationsBYOK (tenant-secret upload)Customer rotates / destroys; Salesforce holds the derived key
Internal policy, no specific regulatorSalesforce-managed keysLowest operational cost, still encrypted-at-rest
Audit retention needed > 18 monthsField Audit Trail with HistoryRetentionPolicy per objectStandard 18-month History retention is hard-capped
Real-time blocking of suspicious sessions / API callsEvent Monitoring + Transaction Security PoliciesTSP is the only policy-driven block-in-flight mechanism
Need event log files but no real-time blockingEvent Monitoring without TSP — log-only modeCheaper to operate; many orgs don't need real-time
Asked for "everything Shield does" without a compliance driverPush back. Shield is paid; per-component justification mattersBuying all three components without a driver is a budget smell

  1. Pre-flight: license confirmation. Permission Set Licenses page. Three lines, three independent purchases. If any is missing, the conversation pauses for procurement.
  2. Compliance driver inventory. What forces Shield to be in scope (regulator, contract, internal control)? Map each requirement to the minimum Shield component that addresses it.
  3. Field inventory + scheme decision. For Platform Encryption: list every candidate field with its filter / sort / search requirement; pick probabilistic vs deterministic per field. Identify any encryption-blocked field types and reroute to source fields.
  4. Key-management posture. Salesforce-managed / BYOK / CCKM. Document the outage tradeoff for CCKM.
  5. Audit retention design. For Field Audit Trail: per-object HistoryRetentionPolicy XML, with archiveAfterMonths and archiveRetentionYears decided per object.
  6. Event Monitoring scope. Log-files-only vs Log-files + Real-Time Event Monitoring + Transaction Security Policies. Document which event types are subscribed and why.
  7. Cost projection. Component licenses + key-management infrastructure (HSM if CCKM) + storage growth from Field Audit Trail archive.

Review Checklist


Salesforce-Specific Gotchas

  1. Three Shield components, three separate licenses. None included in any standard edition. Verify each PSL before any Setup work. (See references/gotchas.md § 1.)
  2. Probabilistic encryption blocks SOQL WHERE equality filters; deterministic restores exact-match filtering only. Neither scheme restores sorting — you can't sort records in list views by fields containing encrypted data, and ciphertext order does not track plaintext order in any case. Wrong scheme = wrong queries; expecting sort from deterministic = a design that fails at query time. (See references/gotchas.md § 2.)
  3. Formula / Roll-Up / unique-indexed External ID cannot be encrypted. Encrypt the source field instead. (See references/gotchas.md § 3.)
  4. Cache-Only Key Service outage = encryption operations fail. A customer-HSM outage stops new writes that need encryption. Trade for the strongest custody posture. (See references/gotchas.md § 4.)
  5. Field Audit Trail retention requires metadata XML, not Setup UI. HistoryRetentionPolicy is set per object via Tooling API or metadata deploy — not a checkbox. (See references/gotchas.md § 5.)
  6. Tenant secret rotation re-encrypts all data. Plan the operation as a maintenance window for orgs with significant encrypted data volume. (See references/gotchas.md § 6.)
  7. Real-Time Event Monitoring is Pub/Sub-only as of recent releases. Old code paths against the streaming-API channels are deprecated. (See references/gotchas.md § 7.)

Output Artifacts

ArtifactDescription
Shield Architecture Decision DocumentLicense inventory, component selection, per-field scheme decisions, key-management mode, retention policy, Event Monitoring scope, cost projection
HistoryRetentionPolicy XML per audited objectMetadata payloads ready for deploy
Pre-flight license-confirmation runbookProcurement gate before any Setup work
CCKM HSM availability runbook (if CCKM chosen)Failure-mode response, KMS outage expected behavior

Package files