FAQ-000484 - Custom Settings and Configuration Security / Post-Installation Configuration and Customer Setup

Current Status:VALID_RESPONSEErrorUnable to AnswerSuggests Case

Current FAQ

Question
What is the recommended approach for securely storing customer-provided credentials that are configured after installation?
Answer
The recommended approach for securely storing customer-provided credentials configured after installation is to use **protected custom settings** or **protected custom metadata**: - **Protected custom settings** are ideal for legacy implementations. - **Protected custom metadata** works well for modern use cases. Both options ensure sensitive data is not publicly accessible. Additionally, you can use **Named Credentials** for locally generated or per-organization secrets, but keep in mind that administrators can view these. Make sure to implement proper encryption and access controls, and avoid storing sensitive data in public custom settings, custom objects, or unencrypted fields.
Enhancing FAQ...

Enhancing FAQ with AI recommendations...

AI Recommended Enhancement

Related Security Rules (click to view)
AvoidHardcodedCredentialsInFieldDeclsAvoidHardcodedCredentialsInVarDeclsAvoidHardcodedCredentialsInVarAssignAvoidHardcodedCredentialsInHttpHeaderApexSuggestUsingNamedCredProtectSensitiveData
Question
What is the recommended approach for securely storing customer-provided credentials that are configured after installation?
Recommended Answer Update
Store customer-provided credentials configured after installation using **protected custom settings** or **protected custom metadata**: - **Protected custom settings** are ideal for legacy implementations - **Protected custom metadata** works well for modern use cases Both options ensure sensitive data isn't publicly accessible. You can also use **Named Credentials** for locally generated or per-organization secrets, but keep in mind that administrators can view these. Implement proper encryption and access controls, and avoid storing sensitive data in public custom settings, custom objects, or unencrypted fields.
Reasoning
The original FAQ content is technically accurate and covers the key security concepts well. I made minor improvements to enhance clarity and flow: 1. **Clarity improvements:** Changed "are not publicly accessible" to "isn't publicly accessible" for more conversational tone, and "Make sure to implement" to "Implement" for directness following the brand guidelines. 2. **Flow enhancement:** Removed "Additionally" to create smoother transitions between concepts. No outdated content was detected - the recommendations for protected custom settings, protected custom metadata, and Named Credentials remain current best practices. **Security Rules Selected:** - **AvoidHardcodedCredentialsInFieldDecls, AvoidHardcodedCredentialsInVarDecls, AvoidHardcodedCredentialsInVarAssign, AvoidHardcodedCredentialsInHttpHeader:** These rules directly relate to the FAQ's core message about avoiding hardcoded credentials. The FAQ specifically warns against "storing sensitive data in public custom settings, custom objects, or unencrypted fields" which aligns with these rules that detect hardcoded credentials in various code contexts. - **ApexSuggestUsingNamedCred:** This rule suggests using Named Credentials, which the FAQ explicitly mentions as an option for "locally generated or per-organization secrets." - **ProtectSensitiveData:** This rule broadly covers protecting sensitive information, which is the entire focus of this FAQ about securely storing "customer-provided credentials."
Reasoning References