已开启
fix(security): 移除示例代码中硬编码的真实凭证和内外网IP #102
fix(security): 移除示例代码中硬编码的真实凭证和内外网IP #102
已开启
sunshuang1866创建于 7月31日
sunshuang1866
sunshuang1866
7月31日

背景

漏洞排查发现 examples 仓库内多处示例代码硬编码了真实环境的数据库/SSH凭证及内外网IP地址,属于敏感信息泄漏:

  • openGauss_cloud_monitor/.../shell/ShellTest.java:硬编码远程主机 IP、root 用户名及真实 SSH 密码
  • openGauss_cloud_monitor/.../jdbc/jdbcTest.java:硬编码 JDBC 连接串(含 IP)、用户名及密码
  • OpenGaussPrivilegeScan/src/main/resources/application.properties:硬编码内网库地址、用户名及密码(注释中还含另一公网IP)
  • opengausss_orz/database.ini:硬编码内网库地址及 openGauss 默认管理员弱口令

修改内容

将上述文件中的真实凭证与IP统一替换为无实际意义的占位符:

  • 用户名 -> user
  • 密码 -> password123
  • IP 地址 -> 127.0.0.1
  • ShellTest.java 中附带的本地路径一并替换为 C:\Users\user\Desktop

不影响示例代码的可读性和演示逻辑,仅消除真实环境信息泄漏风险。

likedislike
合并受阻
sunshuang1866sunshuang1866
7月31日 创建了 pull request,commit 0a8c30cd
opengauss_botopengauss_bot成员
7月31日 添加了label:sig/Infra
opengauss_bot
opengauss_bot成员
7月31日 评论:

Welcome To openGauss Community

Hey @sunshuang1866 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: Infra ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @ailoooong, @gzbang, @libiao2024, @zhangxubo .

likedislike
opengauss_botopengauss_bot成员
7月31日 添加了label:opengauss-cla/no
totaj
totaj成员
7月31日 评论:

/lgtm
/approve

likedislike
opengauss_botopengauss_bot成员
7月31日 添加了label:approvedlgtm-totaj
opengauss_bot
opengauss_bot成员
7月31日 评论:

Review Code Feedback

  • The label lgtm-totaj, approved was added to this pull request. It means that totaj reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
sunshuang1866
sunshuang1866
7月31日 评论:

/check-cla

likedislike
opengauss_botopengauss_bot成员
7月31日 删除了label:opengauss-cla/no
opengauss_botopengauss_bot成员
7月31日 添加了label:opengauss-cla/yes
opengauss_bot
opengauss_bot成员
7月31日 评论:

CLA Signature Pass

sunshuang1866, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
sunshuang1866sunshuang1866
7月31日 修改了pull request 的描述