Need to create a custom rule for yaml configuration in sonar for maven project

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

I am using sonarqube 25.2.0 (zip) to create custom rules for our maven (java-spring) projects using “java-custom-rules-example” sample code. But this code scans only java files and now we have a scenario where we need to check for a yaml config file for eg: application.yaml and validate if it has a config value e.g:

http:
default:
connectionTimeout:1000.

So in order to achieve this how should i proceed? If we have to write custom code and use sensors please let me know how to do it any examples available? or any custom template available within sonar for yaml?

Hi,

Per the docs custom rules aren’t supported for YAML. So you would need to implement and run those rules outside of SonarQube and feed the results in, probably in the Generic Issues format.

 
HTH,
Ann