The main issue with this FAQ is that step 2 mentions including authentication credentials without emphasizing secure credential management practices. While the existing content is accurate, it could inadvertently encourage insecure practices like hardcoding credentials. The recommended update adds guidance to use Named Credentials for secure credential storage, which aligns with Salesforce security best practices. This addition clarifies HOW to properly handle credentials without removing any existing information.
Regarding the selected security rules:
- ApexSuggestUsingNamedCred: Directly relates to the FAQ's mention of "authentication credentials required for accessing the API" - this rule recommends using Named Credentials instead of hardcoded credentials for external API calls
- AvoidHardcodedCredentialsInFieldDecls: Relates to the credential management aspect discussed in step 2, as developers might store API credentials in field declarations
- AvoidHardcodedCredentialsInVarAssign: Connects to step 2's authentication credentials, as developers might assign API credentials to variables
- AvoidHardcodedCredentialsInVarDecls: Applies to the authentication scheme credentials mentioned in the FAQ, as these might be declared as hardcoded variables
- AvoidHardcodedCredentialsInHttpHeader: Directly relevant to the OAuth and complex authentication schemes mentioned in the question, as these often involve HTTP headers with credentials