Resources /
Blog

Salesforce DevSecOps Blueprint: Secure by Design

Submit your details to get a book

8
Min Read
Resources /
Blog

Salesforce DevSecOps Blueprint: Secure by Design

Download

Submit your details to get a book

8
Min Read
Neon shield and padlock above a pillar, next to code, eye, branch and check tiles
Neon shield and padlock above a pillar, next to code, eye, branch and check tiles

A Salesforce DevSecOps blueprint is a plan, done in phases, for securing the release pipeline itself. It answers four questions: who and what can deploy, which checks a change must pass, how sandboxes and data are protected, and what evidence you'll keep.

You build it in four phases, and each one leans on the controls you put in place in the phase before it. Our DevSecOps framework for Salesforce covers the stages, roles and metrics behind it, and our guide to building security into every deployment walks through the pipeline checks one by one.

Why does a Salesforce release pipeline need its own security plan?

CI/CD systems "deliver code from an engineer's workstation to production," says OWASP's Top 10 CI/CD Security Risks project. It warns that attackers see CI/CD services as a path to "an organization's crown jewels."

A Salesforce release pipeline is exactly that kind of path. If someone gets hold of the login it deploys with, they decide what lands in your production org.

Salesforce already gives you a lot of the pieces you'd need. There's the JWT flow for CI logins, Code Analyzer for scanning code, Shield Platform Encryption for data at rest and Event Monitoring for logs.

What those tools don't do is tell you when and how your release process should use them. A blueprint puts them in order, so your DevSecOps Salesforce practices work the same way on every release.

What are the four phases of a Salesforce DevSecOps blueprint?

The infographic below lines up each phase with the OWASP or NIST risk behind it and the Salesforce controls you use. After the image, we take the phases one at a time.

Infographic of a four-phase blueprint for securing a Salesforce release pipeline, showing for each phase the OWASP or NIST risk it answers and the controls it uses

You'll find the source for every item on it in the phase sections further down. If you'd rather read it as a list, here are the four phases and the main controls in each:

  • Phase 1, identity: you give each pipeline its own scoped login, require MFA for the people involved and make sure whoever writes a change can't deploy it alone
  • Phase 2, gates: every change gets scanned and its permission changes reviewed, then it's validated in the target org and approved before it reaches production
  • Phase 3, environments: you keep sandboxes apart from production, mask any production data copied into them and encrypt the sensitive fields
  • Phase 4, evidence: you collect Salesforce's own logs alongside the pipeline's records and keep them longer than Salesforce's built-in retention windows

Phase 1: Who and what can deploy to Salesforce?

Start with identities, since every later gate depends on them. OWASP's risk on inadequate identity and access management warns that compromising nearly any account in the CI/CD chain can lead into production.

Give each pipeline its own dedicated identity instead of a shared admin login. OWASP recommends you "Avoid using shared accounts" and grant each account only the permissions its context needs.

For the Salesforce side, the Salesforce DX guide says to use the JWT flow in CI environments that can't log in through a browser. It signs the login request with a digital certificate and uses an external client app or connected app you create.

There is one exception in the same guide: if your org uses high assurance authentication, you can't use the JWT flow and Salesforce CLI for headless logins.

Treat the private key like any other pipeline secret. OWASP's credential hygiene guidance favors temporary credentials, regular rotation of static ones and limits such as a fixed source IP.

People need protecting too. OWASP's CI/CD Security Cheat Sheet says to enable MFA in source control and enforce it on the automation servers that run your pipelines.

How do you build separation of duties into the pipeline?

OWASP's flow control guidance says no single person or programmatic account should ship code through the pipeline without outside review. It also says accounts that can push unreviewed code shouldn't be able to trigger the deploy pipelines.

On Salesforce, the developer or admin who builds a change shouldn't be its only approver for production. Protected branches and required reviews, both on OWASP's cheat sheet, enforce the same rule in Salesforce version control before code merges.

Phase 2: Which security gates and tools does every change pass?

With identities in place, every change runs the same gates on its way to production. Our DevSecOps pipeline guide covers each check in detail, so this blueprint keeps to the order.

First comes static code scanning. Salesforce describes Code Analyzer as "a unified tool to help Salesforce developers analyze their source code for security vulnerabilities, performance issues, best practices, and more."

The same README says to integrate Code Analyzer into your CI/CD process to enforce the rules you define. Our roundup of static code analysis tools covers other scanners.

Next, review permission set and profile changes on their own, so an access change can't slip through inside a larger release. Then validate the release in the target org and get a named approval before production.

OWASP's cheat sheet backs that last step: it asks for manual approval and review before any production deployment is triggered. A Salesforce deployment that skips it has no named person signing off on what goes out.

Each gate should record its result. NIST's Secure Software Development Framework, SP 800-218, suggests that teams "Record security check approvals, rejections, and exception requests as part of the workflow and tracking system."

Phase 3: How do you protect sandboxes and Salesforce data?

The SSDF asks teams to separate and protect each development environment (task PO.5.1). Its implementation examples include MFA for each environment and keeping the use of production software and services in non-production environments to a minimum.

For Salesforce teams, the usual gap is production data copied into a sandbox. Salesforce Data Mask is a managed package that masks data in sandboxes, and Trailhead notes that once sandbox data is masked, you can't unmask it.

Mask a sandbox before developers get access to it after a refresh. Our posts on data masking and sandbox security compare the options.

Production data may need its own layer. Shield Platform Encryption encrypts sensitive data at rest, from many standard and custom fields to files, search indexes and attachments.

It's available in Enterprise, Performance and Unlimited Editions with a Salesforce Shield or Shield Platform Encryption license. If you're working through compliance requirements, our Salesforce encryption guide explains where Shield fits in.

Phase 4: What evidence should the pipeline keep?

OWASP's risk on logging and visibility gives audit logs and application logs equal weight. It also recommends shipping logs to a central place, such as a SIEM, so you can correlate events across systems.

Salesforce logs part of the picture. The MetadataApiOpEventLog object stores details of Metadata API retrieve and deploy requests, from API version 62.0, for users with the View Event Log Object Data permission.

Setup Audit Trail lists the date of each setup change, who made it and what changed. You can download the past 180 days, and after that the records are deleted.

Approvals, scan results and test runs come from the pipeline itself, so export them and keep them together with Salesforce's logs. The SSDF's examples include allowing only authorized people to access that information and preventing any alteration or deletion.

Our audit trail compliance guide covers retention, and our Event Monitoring guide covers alerts.

How do HIPAA, GDPR and SOX map to the blueprint?

Regulations rarely mention pipelines, but several of their requirements land on one. The table below quotes or summarizes each rule from its legal text, and its last column is our own mapping to the blueprint.

RegulationWhat the text requiresBlueprint phase
HIPAA, 45 CFR 164.312(b)Mechanisms that record and examine activity in systems that hold ePHIPhase 4: deploy logs and pipeline records
HIPAA, 45 CFR 164.316(b)(2)(i)Keep required Security Rule policies, procedures and records for 6 yearsPhase 4: retained policies and procedures
GDPR, Article 32(1)Encryption where appropriate, and regular testing of security measuresPhase 2 gates and Phase 3 encryption
GDPR, Article 33(1)Notify the authority of a breach within 72 hours where feasiblePhase 4: logs that show what changed
SOX, Section 404An internal control report in each annual report, with management's assessment of internal control over financial reportingPhases 1 and 2: approvals and separation of duties

HIPAA may add more. In January 2025, HHS published a proposed rule that would expressly require MFA, but it's a proposal, not a final rule.

For each regulation in depth, see our guides to Salesforce HIPAA compliance, GDPR compliance and SOX compliance.

How do you roll out the blueprint without slowing DevOps releases?

Go in phase order, since a gate means little if someone can deploy around it. OWASP's flow control page lists changing production directly, without approval, as one way attackers skip a pipeline's reviews.

Add one gate at a time and watch delivery numbers as you go. Our post on DORA metrics for Salesforce shows how to track lead time and change failure rate during the rollout.

Where Flosum fits

Flosum's Cloud Apps run on Flosum-managed AWS or on a virtual machine you own, encrypted at rest and in transit.

In Flosum's DevOps Cloud App, admin changes, developer code and AI-generated changes go through the same version control, approvals and audit trail. The product page says audit trails, segregation of duties and approval controls are generated automatically in the release pipeline.

The page also says the DevOps Cloud App keeps change history beyond Salesforce's 180-day Setup Audit Trail, which helps with Phase 4. For recovery, its FAQ says "Flosum captures each deployment so changes can be reversed in one click, with impact analysis."

FAQs

What is a Salesforce DevSecOps blueprint?

It's an ordered plan for securing how changes reach a Salesforce org: deploy identities first, then security gates, then sandbox and data protection, then audit evidence. The OWASP Top 10 CI/CD Security Risks is a useful checklist for what each phase should cover.

How is a DevSecOps blueprint different from a DevSecOps framework?

A framework describes the stages, roles and metrics of secure delivery, as our DevSecOps framework post does. A blueprint is the build order for putting those controls on your own release pipeline.

How should a CI/CD pipeline log in to Salesforce?

Salesforce's DX guide points CI systems to the JWT flow, which needs a digital certificate and an external client app or connected app. Give each pipeline its own login with only the permissions it needs.

How long does Salesforce keep Setup Audit Trail records?

The download covers 180 days, and Salesforce deletes setup entity records after that. Export them, along with your pipeline's approvals, if your audits look further back.

Does the January 2025 HIPAA proposal require MFA for deployments?

It's a proposed rule, not a final one. As proposed, it would require MFA on all technology assets in a regulated entity's relevant electronic information systems, so plan for it but check its status first.

Book a demo to see how Flosum's DevOps Cloud App adds approvals, separation of duties and audit trails to every Salesforce release.

Table Of Contents
Author
Stay Up-to-Date
Get flosum.com news in your inbox.

Thank you for subscribing

Ship Salesforce changes faster
Teams on Flosum report 40% higher development velocity and 75%
fewer merge conflicts.
Free to start  |  No credit card required