小编Mri*_*wat的帖子

检测硬编码密码

我一直在尝试检测源代码文件中的硬编码密码.

目前,我正在检查变量赋值和比较标识符,其子字符串与password,pswd匹配.

但它导致了许多误报,例如在这种情况下(从配置文件中读取密码)

String PASSWORD_KEY = "server.password";
String password = prop.getProperty(PASSWORD_KEY);
Run Code Online (Sandbox Code Playgroud)

我可以标出一些子字符串,如Key,location,path,我可以跳过错误生成但除此之外,我想不出更好的方法.

所有建议表示赞赏.

java security passwords hardcoded sonarqube

6
推荐指数
1
解决办法
1264
查看次数

标签 统计

hardcoded ×1

java ×1

passwords ×1

security ×1

sonarqube ×1