如何在Jenkins控制台中隐藏WebLogic密码 [英] How to hide weblogic password in jenkins console

查看:268
本文介绍了如何在Jenkins控制台中隐藏WebLogic密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Jenkins 1.5的Weblogic Deployer插件通过Weblogic服务器中的Jenkins部署战争.来源,目标和凭据通过default.xml文件进行管理.

<weblogic-target>
        <name>WeblogicServer</name>
        <host>localhost</host>
        <port>9001</port>
        <login>JenkinsUser</login>
        <password>deploy</password>
        <authMode>BY_LOGIN</authMode>
    </weblogic-target>

但是在Jenkins的控制台输出中,密码显示为纯文本.我们已经安装了Mask Password插件&配置了它,但这无济于事.

有人可以提出任何关于隐藏此密码以免出现在Jenkins控制台输出中的想法吗?

解决方案

终于知道了! Weblogic Deployer插件2.3版及更高版本具有内置的隐藏密码功能.它使用Weblogic的密码加密功能.我只需要像这样修改default.xml:

<weblogic-target>
            <name>WeblogicServer</name>
            <host>localhost</host>
            <port>9001</port>
            <login>JenkinsUser</login>
            <password>deploy</password>
            <authMode>BY_KEY</authMode>
            <userconfigfile>C:\users\MyUser\Desktop\userconfig</userconfigfile>
            <userkeyfile>C:\users\MyUser\Desktop\userkey</userkeyfile>
 </weblogic-target>

userconfigfile& userkeyfile是可以从WLST脚本或cmd生成的属性密钥文件对.为了大家的方便,请提供以下命令:

转到您的weblogic服务器安装文件夹-> bin,在该文件夹中打开cmd&输入setWLSEnv + enter.

java weblogic.Admin -adminurl t3://localhost:9001 -userid userid -password password -userconfigfile您指定的存储文件路径" -userkeyfile您指定的文件存储路径"-STOREUSERCONFIG

它将要求确认,请按Y&.输入,将创建一对文件.您可以通过以下命令验证该配对是否有效:

java weblogic.Admin -adminurl t3://localhost:9001 -userconfigfile在上一步中存储confing文件的本地路径" -userkeyfile在上一步中存储密钥文件的本地路径" -GETSTATE

如果显示正在运行",则文件工作正常!

We are using Weblogic Deployer Plugin for Jenkins 1.5 to deploy wars via Jenkins in Weblogic servers. The source, target & credentials are managed through default.xml file.

<weblogic-target>
        <name>WeblogicServer</name>
        <host>localhost</host>
        <port>9001</port>
        <login>JenkinsUser</login>
        <password>deploy</password>
        <authMode>BY_LOGIN</authMode>
    </weblogic-target>

But in the console output of Jenkins, the password is being shown as plaintext. We have installed Mask Password plugin & configured it, but this is of no help.

Can someone put forward any idea about hiding this password from appearing in the Jenkins console output?

解决方案

Finally got it! Weblogic Deployer Plugin version 2.3 onwards has built in capability of hiding password. It uses Weblogic's password encryption functionality. I had to just modify the default.xml like this:

<weblogic-target>
            <name>WeblogicServer</name>
            <host>localhost</host>
            <port>9001</port>
            <login>JenkinsUser</login>
            <password>deploy</password>
            <authMode>BY_KEY</authMode>
            <userconfigfile>C:\users\MyUser\Desktop\userconfig</userconfigfile>
            <userkeyfile>C:\users\MyUser\Desktop\userkey</userkeyfile>
 </weblogic-target>

The userconfigfile & userkeyfile are a properties-key file pair which can be generated from either WLST script or cmd. For everyone's convenience am providing the commands below:

Go to your weblogic server installation folder --> bin, open cmd inside that folder & type setWLSEnv + enter.

java weblogic.Admin -adminurl t3://localhost:9001 -userid userid -password password -userconfigfile "Your designated path to store the file" -userkeyfile "Your designated path to store the file" -STOREUSERCONFIG

It will ask for confirmation, press Y & enter, the pair of files will be created. you can validate if this pair works by the following command:

java weblogic.Admin -adminurl t3://localhost:9001 -userconfigfile "Local path where you stored the confing file in previous step" -userkeyfile "Local path where you stored the key file in previous step" -GETSTATE

If it shows RUNNING then the file is working fine!

这篇关于如何在Jenkins控制台中隐藏WebLogic密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆