Does SonarQube or SonarCloud support scanning secrets (passwords, tokens, certificates, etc)?

Does SonarQube or SonarCloud support scanning secrets (passwords, tokens, certificates, etc)?

Hi,

Maybe. :wink:

Could you be a little more explicit on what you’re looking for?

 
Ann

Yes. We are looking for a service that will identify if code contains secrets (passwords, keys, certificates, etc) mainly as part of CI/CD. It needs to support multiple languages and be configurable for new rules.

Hi,

there are already some rules for Credentials, look here https://yoursonarhost/coding_rules?q=Credentials

Regards,
Gilbert

1 Like

Awesome. Is that available in Sonar Cloud?

Hi,

see available rules here = https://rules.sonarsource.com/

Regards,
Gilbert

On SonarQube or SonarCloud, you can use the rule S2068.

As stated in the documentation, << it’s recommended to customize the configuration of this rule with additional credential words such as “oauthToken”, “secret”, … >> because by default the rule will look only for “password” strings.

Can we add custom regex patterns instead of exact string match. What is the best way to find AWS Secret Keys ?

Hi,
nice, but how would you apply rules such as https://rules.sonarsource.com/java/RSPEC-2068 for JSON?

Currently I see 19 rules in our sq configuration for JSON, but none is checking for hard-coded passwords…

Kind regards