To design external app integrations that ensure security review approval, follow these guidelines:
1. **Secure Data Handling**:
- Store sensitive data like API keys and OAuth tokens securely using protected custom settings, custom metadata types, or named credentials.
- Avoid exposing sensitive information in the user interface or passing it in URLs.
2. **Authentication and Authorization**:
- Use HTTPS for all callback URLs to secure communication.
- Implement proper authentication mechanisms, such as OAuth, and request only the minimum necessary permissions.
3. **CRUD/FLS Enforcement**:
- Enforce Create, Read, Update, Delete (CRUD) and Field-Level Security (FLS) checks for all custom objects.
- Use "WITH USER_MODE" for SOQL queries and "AccessLevel.USER_MODE" for Database methods to automatically enforce user permissions.
4. **Static Resources**:
- Include all static resources, like JavaScript files, within the managed package.
- Avoid dynamically loading external resources unless absolutely necessary.
5. **External Callouts**:
- Ensure all endpoints use HTTPS and are within the scope of the security review.
- Provide credentials and security scan reports (e.g., Chimera or ZAP) for these endpoints.
6. **Testing and Documentation**:
- Perform thorough manual and automated security testing throughout development.
- Document any false positives and provide detailed solution documentation, including security policies.
7. **Custom Settings for Configuration**:
- Use custom settings, custom metadata types, or named credentials to allow secure and flexible configuration for URLs or credentials.
By adhering to these practices, your integration design will align with Salesforce's security review requirements.