Obfuscate sensitive data in logs

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • 5.14.0.1
    • Component/s: None
    • None

      When creating global, project or plan specific variables, provide a way to mark then as sensitive. When marked as such, obfuscate the values in the logs.

      I have a Visual Studio Solution which publishes NuGet packages to a NuGet repository. In order to achieve that, my build steps call the appropriate NuGet command with a key, that is suppose to be "secret" to a selective few folks. However, the key appears in the logs, which means that anyone with access to logs can use it to publish their own packages. This causes some issues for compliance etc. Its even worse for projects that are open source and any anonymous user has access to the logs.

      So lets assume my API key is 6c7b0000-0000-0000-0000-611090000000. Instead of this being shown in the logs

      project.txt
      The command ""C:\Users\bamboo\bamboo-home\xml-data\build-dir\CAC-CMB-JOB1\build\\NuGet.exe" push "" -ApiKey "6c7b0000-0000-0000-0000-611090000000"" exited with code 1.
      

      It would display

      project.txt
      The command ""C:\Users\bamboo\bamboo-home\xml-data\build-dir\CAC-CMB-JOB1\build\\NuGet.exe" push "" -ApiKey "##########"" exited with code 1.
      

      For security reasons the masked variable should not match the length of the actual sensitive data. Always create it with a fixed length (say 10 characters). Someone can infer which value was used by the length.

      Someone may argue that its best to create a Bamboo task to do the work; and ensure sensitive data is not in the log, I'd argue that for the sake of maintenance and portability, such tasks may always be defined in a build script.

              Assignee:
              Unassigned
              Reporter:
              bloudraak
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: