Jenkins 在日志中隐藏秘密

发布于 2025-01-13 12:43:37 字数 425 浏览 3 评论 0原文

我看到以下问题 虽然秘密/密码在詹金斯控制台日志中进行了编辑,但将输出重定向到文件会以纯文本形式打印秘密/密码,即使启用了掩码密码插件也是如此

重现步骤: 创建新的自由式作业并执行以下步骤

  1. 选择“将密码作为环境变量注入到构建中”
  2. 选择“全局密码”
  3. 选择“屏蔽密码参数”;
  4. 添加BuildStep“执行Shell”; 在 shell 中输入
env 2>&1 | tee "log.log"
  1. 保存配置
  2. 构建
  3. 工作空间
  4. 列表项

打开 log.log,您将看到以纯文本打印的密码

是否有任何方法可以隐藏重定向输出中的密码/秘密?

I am seeing the following issues
While secrets/passwords are redacted in jenkins console log, redirecting output to a file prints teh secrets / passwords in plain text even with mask passwords plugin enabled

Steps to reproduce:
Create new freestyle job and do teh following steps

  1. Select 'Inject passwords to the build as environment variables'
  2. Select 'Global passwords'
  3. Select 'Mask password parameters';
  4. Add BuildStep 'Execute Shell';
    In the shell enter
env 2>&1 | tee "log.log"
  1. Save the config
  2. Build
  3. Workspace
  4. List item

open log.log and you will see the passwords printed in plain text

Is there any way to hide passwords / secrets from redirected output?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

韵柒 2025-01-20 12:43:37

不幸的是没有。一旦您将输出重定向到文件,它就不再由 Jenkins 管理,并且您已经提供了自己的秘密混淆。

Unfortunately no. Once you redirect output to a file it's no longer managed by Jenkins and you have provide your own secret obfuscation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文