【问题标题】:Tenant ID in Azure DevOps Pipeline Script CensoredAzure DevOps Pipeline 脚本中的租户 ID 已审查
【发布时间】:2021-11-06 04:05:32
【问题描述】:

我有一个管道可以进入密钥库并将生成的字符串打印到 ADO 执行日志。部分字符串包含租户 ID,莫名其妙地被替换为“***”。

https://login.microsoftonline.com/***/oauth2/token

代码并不复杂:

$var = Get-AzKeyVaultSecret -VaultName $(vaultname) -Name $(secretname) -AsPlainText
Write-Host $var

撇开管道安全问题的固有问题不谈,我如何防止它被审查?

【问题讨论】:

    标签: powershell azure-devops azure-pipelines


    【解决方案1】:

    看起来您的其中一个秘密与您的 tentnat id 具有相同的值。在这种情况下,您无法克服这一点,因为秘密被掩盖,不会在日志中显示它们。但是,这仅用于日志记录,并且幕后 url 是正确的。

    请查收here

    echo "You can use macro replacement to get secrets, and they'll be masked in the log: $(secretSauce)"
    

    产生:

    You can use macro replacement to get secrets, and they'll be masked in the log: ***
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-11
      • 2019-11-19
      • 2019-12-15
      • 1970-01-01
      • 1970-01-01
      • 2020-05-16
      • 1970-01-01
      相关资源
      最近更新 更多