# Connection String and Notifications SonarCloud

**URL:** <https://community.sonarsource.com/t/connection-string-and-notifications-sonarcloud/58709>\
**Category:** SonarQube Cloud\
**Tags:** csharp, security, dotnet\
**Created:** [February 21, 2022, 4:25pm UTC](https://community.sonarsource.com/t/connection-string-and-notifications-sonarcloud/58709 "2022-02-21T16:25:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel232526](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@Daniel232526](https://community.sonarsource.com/u/Daniel232526)\
**Post date:** [February 21, 2022, 4:25pm UTC](https://community.sonarsource.com/t/connection-string-and-notifications-sonarcloud/58709/1 "2022-02-21T16:25:46Z")

</div>

- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Languages of the repository: Spanish
- Error observed:  
I have a C# project in which one of the developers uploaded the burned connection string directly into the appsettings file as follows:  
\</\>  
“ConnectionStrings”: {  
“Connection”: “Server=tcp:mt.db.windows.net,1433;Initial Catalog=Conect;Persist Security Info=False;User ID=example;Password=123456;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False ;ConnectionTimeout=30;”  
“pers”: “”  
}  
\</\>  
My question is why the SonarCloud analysis is not detecting this problem, the rule is activated and has always worked well, however this security point has not been detected by SonarCloud, is there a reason for this problem?

My second question is if SonarCloud has the option to notify the administrator when a quality gate fails in a general way in any of the projects of the organization  
I know that it can be configured within each project, but I would like to do it in a general way for everyone, is this possible?

---

<div class="post-metadata">

**Author:** ![Alexandre\_Gigleux](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alexandre_gigleux/32/26_2.png) [@Alexandre\_Gigleux](https://community.sonarsource.com/u/Alexandre_Gigleux)\
**Post date:** [February 23, 2022, 10:56am UTC](https://community.sonarsource.com/t/connection-string-and-notifications-sonarcloud/58709/4 "2022-02-23T10:56:48Z")

</div>

Hello,

SonarCloud has (almost) no analyzer to detect problem in JSON files. We can analyze CloudFormation files provided as JSON files but that’s the only exception.

I’ve got the feeling that when you talk about “appsettings” it’s actually about “appsettings.json” file and so there is no way SonarCloud can detect something on it today.

Can you clarify what you mean by “the rule is activated”? Which rule?

Thanks  
Alex

PS: it’s better to create another thread for your notification question, so that the two questions can be handled by different persons

---

<div class="post-metadata">

**Author:** ![Alexandre\_Gigleux](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alexandre_gigleux/32/26_2.png) [@Alexandre\_Gigleux](https://community.sonarsource.com/u/Alexandre_Gigleux)\
**Post date:** [February 23, 2022, 12:31pm UTC](https://community.sonarsource.com/t/connection-string-and-notifications-sonarcloud/58709/7 "2022-02-23T12:31:50Z")

</div>

Erratum: I forgot that we did [that](https://github.com/SonarSource/sonar-dotnet/issues/4298) in 2021 to support the case of appsettings.json for the C# rules [S2115](https://rules.sonarsource.com/csharp/RSPEC-2115) =\> it should work and detect your hard-coded password.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Gigleux](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alexandre_gigleux/32/26_2.png) [@Alexandre\_Gigleux](https://community.sonarsource.com/u/Alexandre_Gigleux)\
**Post date:** [February 23, 2022, 3:54pm UTC](https://community.sonarsource.com/t/connection-string-and-notifications-sonarcloud/58709/8 "2022-02-23T15:54:55Z")

</div>

After more investigations, S2115 will only raised if the “Password” property is empty.  
I created [#5427](https://github.com/SonarSource/sonar-dotnet/issues/5427) to have the rule [S2068](https://rules.sonarsource.com/csharp/RSPEC-2068) covering the case of appsettings.json files.
