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

Current Status:VALID_RESPONSEErrorUnable to AnswerSuggests Case

Current FAQ

Question
How can I allow customers to configure my application's settings if they must be stored in a 'Protected' custom setting or metadata type?
Answer
To allow customers to configure your application's settings stored in "Protected" custom settings or metadata types, you can: 1. **Build a Custom UI**: Use Visualforce, Aura, or Lightning Web Components (LWC) to create a user-friendly interface where customers can input the required settings. 2. **Secure Data Handling**: Pass the input from the custom UI to an Apex class within the managed package for secure storage in the protected custom settings or metadata. 3. **Use Named Credentials**: These can package metadata and configuration, while allowing customers to set up the actual credentials after installation. This approach ensures both security and configurability for your application's settings.
Enhancing FAQ...

Enhancing FAQ with AI recommendations...

AI Recommended Enhancement

Related Security Rules (click to view)
ApexCRUDViolationApexSharingViolationsApexSuggestUsingNamedCredAvoidHardcodedCredentialsInFieldDeclsAvoidHardcodedCredentialsInVarAssignAvoidHardcodedCredentialsInVarDecls
Question
How can I allow customers to configure my application's settings if they must be stored in a 'Protected' custom setting or metadata type?
Recommended Answer Update
To allow customers to configure your application's settings stored in "Protected" custom settings or metadata types, you can: 1. **Build a Custom UI**: Use Visualforce, Aura, or Lightning Web Components (LWC) to create a user-friendly interface where customers can input the required settings. 2. **Secure Data Handling**: Pass the input from the custom UI to an Apex class within the managed package for secure storage in the protected custom settings or metadata. Ensure your Apex code properly validates user permissions before allowing configuration changes. 3. **Use Named Credentials**: These can package metadata and configuration, while allowing customers to set up the actual credentials after installation. This approach ensures both security and configurability for your application's settings.
Reasoning
The FAQ provides solid guidance but can be improved with a minor addition about permission validation. The answer mentions 'secure data handling' but doesn't specify the security considerations when allowing customers to modify protected settings. Adding explicit mention of permission validation strengthens the security guidance without changing the structure or adding new points. Regarding security rules selected: - ApexCRUDViolation: Relates to the FAQ's discussion of 'secure storage in the protected custom settings or metadata' as this involves DML operations that should enforce proper CRUD permissions - ApexSharingViolations: Connects to allowing 'customers to configure' settings, which involves user access controls and sharing rules enforcement - ApexSuggestUsingNamedCred: Directly mentioned in point 3 where the FAQ explicitly recommends 'Use Named Credentials' - AvoidHardcodedCredentialsInFieldDecls/VarAssign/VarDecls: All relate to the 'credentials after installation' mentioned in point 3, as the FAQ discusses credential management and storage approaches
Reasoning References
Recommended Related Articles