powershell - Azure DevOps Pipeline 脚本中的租户 ID 已审查
问题描述
我有一个管道可以进入密钥库并将生成的字符串打印到 ADO 执行日志。部分字符串包含租户 ID,莫名其妙地被替换为“***”。
https://login.microsoftonline.com/***/oauth2/token
代码并不复杂:
$var = Get-AzKeyVaultSecret -VaultName $(vaultname) -Name $(secretname) -AsPlainText
Write-Host $var
撇开管道安全问题的固有问题不谈,我如何防止它被审查?
解决方案
看起来您的一个秘密与您的 tentnat id 具有相同的值。在这种情况下,您无法克服这一点,因为秘密被掩盖,不会在日志中显示它们。但是,这仅用于日志记录,并且幕后 url 是正确的。
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: ***
推荐阅读
- angular - 我有角度的 cookieservice 问题
- rest - 带有正文 VS POST 的 GET 请求,用于检索大型资源
- java - id "" 未在 Android Studio 中的任何地方定义
- android - cmake - 为 iOS、模拟器和 Android 链接一个预编译库
- python - 气流:并行链接任务
- google-apps-script - 在对象中存储一个数组并将其传递给 Code.gs 函数。给出参考错误
- git - 如何从 git 历史记录和 git 对象中完全删除文件
- java - 为什么我的 java 代码一开始就这么早就结束了?
- firebase - 让我的 Firebase 应用程序专门触发微服务
- razor - 是否可以更改每个 Razor 组件的 RenderMode?