Set-VstsTaskVariable Writes Secret Variable Value to Log
See original GitHub issueWhen using the following code in my custom task, the value of the Secret variable is written to the logs.
Set-VstsTaskVariable -Name test_pass -Value <password> -Secret;
The output is as follows:
##vso[task.setvariable variable=test_pass;issecret=True]<password>
I would expect the output to be something like this
##vso[task.setvariable variable=test_pass;issecret=True]
This might only happen when using the documentation instructions for Testing and Debugging, I have not tested on our live production system. (https://github.com/Microsoft/vsts-task-lib/blob/master/powershell/Docs/TestingAndDebugging.md)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Set secret variables - Azure Pipelines | Microsoft Learn
setvariable logging command to set variables in PowerShell and Bash scripts. This is the least secure way to work with secret variables but...
Read more >Secret variables sometimes leaking in logs. #9633 - GitHub
Variables marked as secrets are not always obfuscated in log output. Based on my experimentation it has to do with the presence of...
Read more >How to set secret environment variable with logging ...
As the logging command usage mentions: When issecret is set to true, the value of the variable will be saved as secret and...
Read more >How to expose secret variables in Azure DevOps - WinOpsDBA
First, we will create two variables as part of our release pipeline. Variable name, Variable value. plain_text_variable, plaintextvariable.
Read more >When you REALLY want to see your Azure DevOps Secret ...
Helpfully kept out of the logs by Azure DevOps hence the *** so what to do? I thought - I know what I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@damccorm - This was fixed in https://github.com/microsoft/azure-pipelines-agent/pull/2659 of the agent and will be included in 2.164.0
This is probably related to https://github.com/microsoft/azure-pipelines-task-lib/issues/589 which I believe @jtpetty was taking a look at. Because of our escaping rules, this variable is getting modified as of #543. @jtpetty we should probably react on the agent side and just be a little more aggressive in what we mask.