Prepare for the Security Review
Learning Objectives
After completing this unit, youโll be able to:
- Explain the purpose of the security review.
- Outline what happens during a security review.
- Summarize the scope of the security review.
- List the tools that can help you prepare for the security review.
- Describe what scanners can and canโt do for you.
Understand Whatโs Ahead
By now youโve got the OWASP Top 10 list bookmarked. Youโve designed your solution in a way that comprehensively protects its data, and youโre building it by following secure coding practices.
If youโre building a managed package, Salesforce Platform API solution, or Marketing Cloud Engagement API solution, you know that a security review process awaits your solution. You also know that you canโt launch your product on AgentExchange without passing the review. But what is the security review, exactly?
Test Your Defenses in a Safe Environment
You wouldnโt claim that a feature in your solution worked properly without testing it, would you? Of course not.
One of your solutionโs most important features is its protection of customer data. At Salesforce, we believe that this feature is so important that we help you test it.
In a security review, our Product Security team tests your productโs defenses against the attacks described on the OWASP list. Our testers put on their burglar masks and try to break into your solution in an intensive session that lasts several hours. Their mission is to steal data that they donโt have permission to access.
If at First You Donโt Succeed...
If our team successfully extracts data from your solution, they send you a report listing the vulnerabilities they exploited. You can use this information to reinforce your solution, and then it must go through the security review again. We explain this process in detail in a later unit. While itโs not the most fun ever, itโs a whole lot better than having real customer data stolen.
Like any testing scheme, the security review isnโt comprehensive. It doesnโt cover all possible vulnerabilities, and passing the review is not an ironclad guarantee that your solution is completely secure. But just as testing your product makes you more confident about its quality, the security review provides you with vital feedback for bolstering your productโs defenses. Thereโs no such thing as guaranteed product security, but solutions that pass our security review come pretty close.
We Review the Whole Thing
Maybe your solution is a native app, or agent, and lives only on the Salesforce Platform. Or maybe itโs a composite app, with architectural components or services that live elsewhere in the cloud or on your companyโs servers. The externally hosted pieces must be as secure as the rest. Otherwise, attackers can use them as entry points, just as a burglar can use a ventilation duct. All of your solutionโs components and services, no matter where they live, are fair game for the security review.
Here are some typical solution architectures and the locations of their various parts.
Solution Architecture | What Lives Where | ||
|---|---|---|---|
Salesforce Platform
| Off Platform
| Native Mobile App
| |
100% native | Custom objects Custom Lightning components Custom Apex code | ||
Composite solution with external services | Custom objects Apex code | Services, such as maps, hosted on another platform, such as AWS or Rackspace | |
Composite solution with mobile apps | Custom objects Apex code Workflows | Native apps for iOS and Android | |
API-only solution | Connected App | A stand-alone solution that reads and writes data hosted on the platform. For example, an accounting solution that interacts with Accounts and Opportunities | |
Lightning Bolt Solution | Lightning components Apex code | ||
CRM Analytics solution | Apps Dashboards Lenses Datasets Dataflows Custom objects | ||
The Product Security team attempts to attack all of these piecesโnot just those on the platform. It digs deep and goes for your data everywhere. Plan accordingly! For example, native mobile apps can provide a great user experience, but they require extra work to protect them, depending on how you put them together.
Bring Everything to the Table
When you submit your solution for review, make sure that you provide a complete test setup and instructions for using it. This setup may include a Developer Edition org with your managed package installed.
If your solution includes an iOS or Android mobile app, include the installation link for it. If youโre integrating an external web-based accounting service, set up an instance that hosts it, or provide login credentials to a test account on the site. Overall, when deciding what needs to be provided, a good rule of thumb is to imagine that the Security Review team is a potential customer who wants to test drive your whole solution end-to-end. When in doubt, refer to the security information in the ISVforce Guide.
Use Scanners to Conduct Your Own Review
If this security review process sounds a little scary, donโt worry. We want to see your product on AgentExchange as much as you do, and weโre here to help. Aside from the resources weโve mentioned, we provide scanners your team can use on your product to prepare for the review.
These scanners scour your solution for specific vulnerability patterns. Scanners come in handy even early in the development process.
Scanner | Description | Use If |
|---|---|---|
Salesforce Code Analyzer | Uses multiple rule engines to scan your code: Apex, Visualforce, Javascript, and TypeScript. Can be integrated into your continuous integration (CI) process to regularly monitor code health. Doesnโt scan external endpoints. Powered by Salesforce CLI. | Youโre listing a managed packageโCode Analyzer scan reports are required with your security review. Also use Code Analyzer to integrate scanning rules into your CI process. |
Checkmarx | Scans solution hosted on the platform. | Your solution has Apex code, Visualforce elements, and managed packages. |
ZAP, BURP, or any other DAST scanner
| These are free online scanners and require installation on a local system. | Part of your solution is deployed on a domain that you donโt control. |
Partners can also use their preferred DAST scanner to scan the external endpoints and attach the clean report to the submission.ย
These scanners generate reports that contain the vulnerabilities they find in your product. Of course, they canโt find every vulnerability out there.
For more information about DAST scan requirements, see the โChimera Sunset and DAST Scanโ section on the Partner Security Portal help page.
False Positives
Sometimes a scanner identifies an issue that isnโt really a problem. For instance, the scanner finds a vulnerability pattern that you've protected against, and it fails to recognize your method of protection. We call these errors false positives.
Letโs say you added some code to protect against malicious SQL queries, and the scanner doesnโt recognize that your code addresses this vulnerability. It reports a SQL injection vulnerability. You can interpret that report as a false positive.
If you think an error is a false positive, prepare a document explaining why, and include it with your security review materials. Follow the guidelines outlined in Document Your Responses to False Positives. Be specific about how youโre protecting against the vulnerability indicated. It saves everyone time if we donโt have to chase you down and have you explain it to us.
How to Interpret Scanner Reports
Each scanner provides a different report with their own schema. You must include a Salesforce Code Analyzer report, a Partner Security Portal Source Scanner report, and a DAST scan report from your preferred tool.
This table shows you how to respond to the reports you'll include with your submission.
Scanner | Fix | Ignore |
|---|---|---|
Salesforce Code Analyzer | All security-related findings and fix all errors except false positives. | Any findings unrelated to security, such as code quality, performance, or stylistic findings. |
Checkmarx | Any findings classified as Low, Medium, or High. | Informational warnings. |
ZAP, BURP, or any other DAST scanner
| All findings except those listed in the next column. Once errors are fixed, provide a screenshot of the scan with your review materials to verify the correct external endpoint is being scanned. | Informational issues and warnings. Be sure to document any other false positives. |
Try to Hack Your Own Solution
Scanners are great, but thereโs no substitute for human ingenuity. After youโve fixed all the security problems you know about, try to find some more! Convert your testers into hackers.
With your teamโs security advocate, devise a plan for adversarial testing, or attacking your own solution and trying to steal its data.
Give your tester-hackers a running instance of the solution and let them loose with a mission to gain unauthorized access to customer or system data. Offer prizes for successful attacks.
Adversarial testing can turn up some surprising results. You might find yourself thinking, โI could have sworn we fixed that!โ or wondering how your teammates got so good at hacking. Just remember, being hacked by them is a lot better than the alternative.
In the next unit, we step through the submission process itself.
Resources
- Salesforce Developer Site: Introducing the Lightning Locker for Lightning Components
- Salesforce Site: Force.com Code Scanner Portal
- Salesforce Partner Security Portal
- Salesforce Site: Salesforce Code Analyzer
- External Site: Zed Attack Proxy (ZAP)
- Salesforce Developer Site:ย Security Developer Center
- Salesforce Developer Site: Scan Your Solution with Salesforce Code Analyzer
