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

Current Status:VALID_RESPONSEErrorUnable to AnswerSuggests Case

Current FAQ

Question
What is the secure, recommended way for a user to modify data stored in protected custom settings?
Answer
The secure, recommended way for a user to modify data stored in protected custom settings is to: 1. **Build a Custom User Interface**: Use Visualforce, Aura, or Lightning Web Components (LWC) to create an interface for capturing user input. 2. **Process Data Securely in Apex**: Pass the input to an Apex class within the managed package for secure processing and storage. 3. **Implement Security Checks**: Ensure proper CRUD/FLS checks and sharing rules in the Apex code to restrict access and modifications to authorized users only. 4. **Avoid Displaying Sensitive Data**: Do not display sensitive data back to the user in the interface. 5. **Sanitize User Input**: Validate and sanitize all user input to prevent security risks like injection attacks. This approach ensures secure handling of modifications to protected custom settings.
Enhancing FAQ...

Enhancing FAQ with AI recommendations...

AI Recommended Enhancement

Related Security Rules (click to view)
ApexCRUDViolationApexSharingViolationsApexSOQLInjectionApexXSSFromURLParamVfCsrf
Question
What is the secure, recommended way for a user to modify data stored in protected custom settings?
Recommended Answer Update
The secure, recommended way for a user to modify data stored in protected custom settings is to: 1. **Build a Custom User Interface**: Use Visualforce, Aura, or Lightning Web Components (LWC) to create an interface for capturing user input. 2. **Process Data Securely in Apex**: Pass the input to an Apex class within the managed package for secure processing and storage. 3. **Implement Security Checks**: Ensure proper CRUD/FLS checks and sharing rules in the Apex code to restrict access and modifications to authorized users only. 4. **Avoid Displaying Sensitive Data**: Don't display sensitive data back to the user in the interface. 5. **Sanitize User Input**: Validate and sanitize all user input to prevent security risks like injection attacks. This approach ensures secure handling of modifications to protected custom settings.
Reasoning
The original answer was already comprehensive and well-structured, requiring only minor language refinements for clarity and tone consistency. The main change was simplifying 'Do not display' to 'Don't display' to match the conversational tone guidelines. All security practices mentioned remain current and accurate. Regarding the selected security rules: - **ApexCRUDViolation**: Directly relates to point 3 which mentions 'proper CRUD/FLS checks' - this rule detects violations of CRUD (Create, Read, Update, Delete) permissions in Apex code - **ApexSharingViolations**: Also relates to point 3 which mentions 'sharing rules' - this rule identifies when Apex code bypasses organization-wide sharing settings - **ApexSOQLInjection**: Connects to point 5 about 'sanitize all user input to prevent security risks like injection attacks' - SOQL injection is a primary injection attack vector in Salesforce - **ApexXSSFromURLParam**: Relates to point 5's input validation guidance - this rule detects XSS vulnerabilities from URL parameters, which is relevant when building custom interfaces that accept user input - **VfCsrf**: Applies to point 1's mention of Visualforce interfaces - this rule detects CSRF vulnerabilities in Visualforce pages, which is crucial when creating custom user interfaces for modifying protected settings
Reasoning References
Recommended Related Articles