ballerina:13 reports boolean strings, auth scheme names and qualified secret names
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- security, testing-qa
调研方向
Start with the ballerina:13 rule implementation and its tests, especially the tests for #109 and the ballerina/http cases mentioned in the issue. Check how it recognizes boolean strings, authentication scheme values, and secret-like target names. Add coverage for the listed examples and confirm they are no longer reported while other hard-coded secrets still are.
由索引模型根据 Issue 内容生成。
描述
Description
Rule ballerina:13 (Hard-coded secrets) reports string values that are not secrets, because the name of the target contains a secret-like word. #109 fixed boolean values, values built from configurables, and protocol keywords such as access_token. These forms are still reported:
import ballerina/http;
// 1. A boolean as a string, for the CORS `Access-Control-Allow-Credentials` header value
function assertCors(http:Response response, string credentials) {
}
// 2. A variable whose name only qualifies the secret word
function proxyStatus(http:Request req) returns string {
string hasAuthHeader = "No Proxy";
if req.hasHeader("Proxy-Authorization") {
hasAuthHeader = "Proxy";
}
return hasAuthHeader;
}
// 3. An authentication scheme name with no credential
function incompleteHeaders() returns [string, map<string>] {
string incompleteBasicAuth = "Basic";
return [incompleteBasicAuth, {"authorization": "Basic "}];
}
public function main() {
assertCors(new, "true");
}
"true", "No Proxy", "Proxy", "Basic" and "Basic " are reported.
Found in ballerina/http test packages.
Suggested Improvement
- Don't report
"true"and"false", as #109 already does for boolean values. - Don't report a value that is only an authentication scheme name (
Basic,Bearer,Digest, with or without the trailing space), in the same way as the protocol keywords in #109. - Don't treat a name as secret-named when the secret word is qualified by a boolean prefix such as
has,isoruse(hasAuthHeader).
Version
0.13.0
- 主要语言
- Java
- 星标
- 15
- 派生
- 12
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ballerina-platform/static-code-analysis-tool 的其他 Issue
-
Platform plugin output is written to standard output and breaks redirected JSON/SARIF results可能已有人在做 @TharmiganK 于 1 天前认领。 未关闭Area/CLI Type/Bug
难度 2/5 1-3 小时 新手友好度 72/100
ballerina-platform/static-code-analysis-tool#167 ·
维护者通常 1 天内回复
-
Module file paths in the JSON report are only file names可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭Area/Reports Type/Bug
难度 2/5 1-3 小时 新手友好度 72/100
ballerina-platform/static-code-analysis-tool#152 ·
维护者通常 1 天内回复
-
Area/CLI Type/Improvement
难度 2/5 1-3 小时 新手友好度 68/100
ballerina-platform/static-code-analysis-tool#140 ·
维护者通常 1 天内回复
-
Area/Rules Type/Bug
难度 3/5 1-2 天 新手友好度 68/100
ballerina-platform/static-code-analysis-tool#179 ·
维护者通常 1 天内回复
-
Area/Rules Type/Bug
难度 3/5 1-2 天 新手友好度 65/100
ballerina-platform/static-code-analysis-tool#177 ·
维护者通常 1 天内回复
查看 ballerina-platform/static-code-analysis-tool 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
wultra/powerauth-tests#980 ·
-
account bug communication lecture
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
line/centraldogma#1397 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
cryptomator/hub#515 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
vert-x3/vertx-mail-client#268 ·