Newer Version Available
Storing Sensitive Data Insecurely
Follow enterprise security standards when you export data from the Salesforce Platform
and when you store secret data in the platform.
Insecure sensitive data storage provides many avenues for hackers to pose threats. For example, an org administrator is the only person who is supposed to know the API key. Hackers can use an exposed key to communicate data over admin channels to remote endpoints.
Salesforce takes threats to data that originate in your solution seriously. A data breach or loss caused by a vulnerability in your solution jeopardizes your relationship with Salesforce.
Follow the enterprise standards in Storing Sensitive Data when:
- Exporting customer data from the Salesforce platform.
- Storing secrets such as cryptographic keys, session ids, or passwords in the Salesforce Platform.
Metadata Example
The metadata in this example represents a custom object. This custom object definition
isn’t secure because the <visibility> tag for the API
key field is set to Public. The field can be viewed in
plain
text.
1<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
2 <fields>
3 <fullName>apiKey__c</fullName>
4 <externalId>false</externalId>
5 <fieldManageability>DeveloperControlled</fieldManageability>
6 <label>apiKey</label>
7 <length>50</length>
8 <required>false</required>
9 <type>Text</type>
10 <unique>false</unique>
11 </fields>
12 <label>Phone Verify Setting</label>
13 <pluralLabel>Phone Verify Settings</pluralLabel>
14 <visibility>Public</visibility>
15</CustomObject>When storing a secret in a custom object, such as an API key, encrypt it. Store the encryption key separately in a protected custom setting or a protected custom metadata API field.