我有以下VSTS任务和输入:
{
"name": "ConnectedServiceName",
"type": "connectedService:Azure",
"label": "Azure Subscription",
"defaultValue": "",
"required": true,
"helpMarkDown": "Select the Azure subscription for the deployment. Only the supported Azure service connections are displayed and they are of the authentication type of Credentials or Service Principals."
},
和task.js
var path = require('path');
var tl = require('vso-task-lib');
var echo = new tl.ToolRunner(tl.which('KeyVaultSecretManager.exe', true));
var auth = tl.getEndpointAuthorization(tl.getInput("ConnectedServiceName", true));
echo.arg(tl.getEndpointUrl(tl.getInput("ConnectedServiceName", true)) + " " + (typeof auth.parameters.servicePrincipalId) + " " + auth.parameters.servicePrincipalId + " " + auth.parameters.servicePrincipalKey + " " + JSON.stringify(auth));
echo.exec({ failOnStdErr: false })
.then(function (code) {
tl.exit(code);
})
.fail(function (err) {
console.error(err.message);
tl.debug('taskRunner fail');
tl.exit(1);
})
我想知道如何得到实际值而不只是*******
,因为输出表明:
C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\TestKeyVaultSecretManager\0.1.10\KeyVaultSecretManager.exe https://management.core.windows.net/ string ******** ******** {parameters:{ servicePrincipalId: ********, servicePrincipalKey: ********, tenantId: ********}, scheme: ServicePrincipal}
Testing KeyVault https://management.core.windows.net/ string ******** ******** {parameters:{ servicePrincipalId: ********, servicePrincipalKey: ********, tenantId: ********}, scheme: ServicePrincipal}
答案 0 :(得分:0)
答案是,他们实际上以一种很好的方式实现了这一点,我被骗了。
之后,敏感数据隐藏在日志中。因此,实际传递给我的控制台应用程序的值会获得正确的值,但是当我再次写入日志时它们会再次被隐藏。
对输入参数字符串进行小的操作并打印出那些表明这一点。