Oteemo / charts

Helm chart repository
https://oteemo.github.io/charts
MIT License
181 stars 232 forks source link

Sonarqube - change-admin-password-hook job should URL escape values #277

Closed DaniJG closed 3 years ago

DaniJG commented 3 years ago

The sonarqube chart allows the admin password to be updated through the account.adminPassword and account.currentAdminPassword parameters.

When these are specified, the change-admin-password-hook Job is deployed as a post-install helm hook, which uses curl to send a POST request to sonarqube:

/api/users/change_password?login=admin&previousPassword={{ default "admin" .Values.account.currentAdminPassword }}&password={{ default "admin" .Values.account.adminPassword }}

Current issue

The problem is that those values are not URL escaped. Instead they are directly added as-is to the URL of the POST request. With some randomly generated password that includes symbols (like #, %, etc), this is going to cause trouble and results in the wrong password value being set.

Expected

The job correctly URL escapes the 2 password parameters, for example using helm's urlquery function