Sub topic 13
Security review and publishing on AppExchange
This chapter assumes you can already build and promote a package version, as covered in the earlier chapters. You should also have a Salesforce Partner Community login. Here you will see how a released version becomes a public AppExchange listing.
What security review is
Security review is Salesforce's audit of your app. Every managed package that is listed publicly on AppExchange must pass it. The review checks that your code and configuration protect customer data. Passing it does not need to happen before you build versions, but it does need to happen before you list.
What you submit
Review applies to a specific package version, so you must submit a released version. A beta version cannot be reviewed. Promote the version first:
sf package version promote --package [email protected] --target-dev-hub devhubAfter promotion, you cannot change that version. If the review finds problems, you fix the source and build a new version. You then promote the new version and submit it again.
Scan before you submit
Reviewers use automated scanners, and you should run them first.
- Salesforce Code Analyzer runs static analysis on your Apex, Lightning components, and other source. Use it on every commit.
- Source code scanner (Checkmarx-based) is run from the Partner Security Portal. It produces the report that the review expects.
- Web app scanning applies if your solution also calls out to an external web service you host. That part of your solution is reviewed too.
Common failures are missing CRUD and field-level security checks in Apex, SOQL or SOSL injection, cross-site scripting in Visualforce or Lightning, and hard-coded credentials. Fix every finding you can. Document the false positives so the reviewer can see why you dismissed them.
The publishing path
- Join the Salesforce Partner Program and sign in to the Partner Console.
- Create a listing: name, description, screenshots, a demo or trial, and pricing details.
- Open the Security Review wizard and submit your package version with the scan reports and a test environment. The environment needs working credentials and sample data so reviewers can exercise every feature.
- Respond to the findings. Reviews often take several rounds.
- After approval, link the reviewed package to the listing and publish it.
Gotchas
- Later versions in the same package are normally reviewed again only if you change functionality. Salesforce can still re-audit a listed app at any time. Keep scanning in CI.
- The package version you list must be the one that passed. Do not swap in an unreviewed build.
- Incomplete test environments are a frequent cause of delay. Test your own credentials before submitting.
Exercise
Your security review failed on a cross-site scripting finding in a released version 1.0.0-2. What do you do?
Show answer
Fix the source, build a new package version, run the scanners again, promote the new version, and resubmit it for review. The released version 1.0.0-2 cannot be edited.