Obfuscated passwords in TeamCity

Obfuscate the password in the TeamCity UI

When a TeamCity build step needs to use a password, there is a way to obfuscate it.

  1. In the TeamCity web interface navigate to the project,
  2. On the project page open the Parameters page,
  3. Click the Add new parameter button,
  4. Enter the name of the parameter, the password value, and click the Edit button to set the special settings,
  5. Set the Display to Hidden, and the Type to Password to hide the value from the user interface. Click the Save button on this window and the on the parent window to save the parameter.
  6. To use the parameter in a build step, surround it with % signs.

Display the obfuscated password in the TeamCity UI.

To display the value of the password in the TeamCity UI again

  1. Select the attribute in the list
  2. Click the Edit button
  3. Set the type to Text and click the Save button
  4. On the Edit Parameter window click the Save button
  5. The password will be displayed in the parameter list.

Join the Conversation


    1. Thank you, Kay for your comment, I have updated the title and the post to better describe the security level.

  1. Something I think it’s badly done in TeamCity when it comes to password masking
    Say you have the password ‘home-town’ and then you are connecting to a site say home-town.exmple.net, in the output you would see ‘*********.example.net’, which makes it easier to figure out passwords.

    To get a password in plain text, just run an inline script in it’s own build step, split the password in two and echo them out on their own lines.

Leave a comment

Your email address will not be published. Required fields are marked *