Jenkins 在日志中隐藏秘密
我看到以下问题 虽然秘密/密码在詹金斯控制台日志中进行了编辑,但将输出重定向到文件会以纯文本形式打印秘密/密码,即使启用了掩码密码插件也是如此
重现步骤: 创建新的自由式作业并执行以下步骤
- 选择“将密码作为环境变量注入到构建中”
- 选择“全局密码”
- 选择“屏蔽密码参数”;
- 添加BuildStep“执行Shell”; 在 shell 中输入
env 2>&1 | tee "log.log"
- 保存配置
- 构建
- 工作空间
- 列表项
打开 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
- Select 'Inject passwords to the build as environment variables'
- Select 'Global passwords'
- Select 'Mask password parameters';
- Add BuildStep 'Execute Shell';
In the shell enter
env 2>&1 | tee "log.log"
- Save the config
- Build
- Workspace
- 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是没有。一旦您将输出重定向到文件,它就不再由 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.