Basically we have developed on Sonar_exporter for scraping sonar metrics such as projects,QualityProfiles,QualityGates, Resource information to prometheus using Python code.
We are using several Web-apis to get the sonar metrics using python.
So sequence api is like,
we do login first through authentication api
2 then perform operation using projects/QPs/QGs webapis
at last logs out
above instruction executes in circle and to scrape data to prometheus.
But it is found that username and password are getting printed in log line when authentication api hits to sonarqube. it is not masking that part.
any idea why it is not working , because it may leads to security breach and we have to implement sonar qube exporter for out use case.
Iāve just tried to simulate this a little via my browser (too lazy to write a script) and Iām not seeing credentials in my access logs. Can you provide more details? When you say
What exactly do you mean?
BTW, GitHub search has just helped me find this line in a file named TomcatAccessLog.java in the SonarQube repo:
And Iāve matched this pattern up to what Iām seeing in my own localhost logs, so I think Iāve found the right thing. Could you identify, please, where in this pattern youāre seeing the problematic values?
Based on the Tomcat docs I it loos like the 2nd parameter is āremote logical usernameā but according to those same docs, it
(always returns ā-ā)
So that shouldnāt be a problem.
Then the third parameter is āRemote user that was authenticated (if any), else ā-āā. Is that the problem?
no. as already stated this is not the right way to go and is not supported. the login endpoint is only used for the frontend of sonarqube and should not be used for scripting purposes against the api.
you can call any endpoint that requires authentication in a similar way as in the example that i shared with you.