Report related locations for ballerina:13 and ballerina:14 findings
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
Start with the Scanner API's Reporter.reportIssue and the Issue class, then trace SecretValueResolver and SecretChecker for the secret rules ballerina:13 and ballerina:14. The resolver must record each declaration it passes through, and the SARIF, JSON and HTML reporters need to emit them. Done means a fixture like fixture shows its declaration as a related location in all three reports.
索引モデルが issue の本文から書いたものです。
説明
Problem
ballerina:13 and ballerina:14 trace a secret's value back to where it is written, and report the finding where the value is used. That's how SonarSource S6437 and CodeQL report hard-coded credentials too. The trace is thrown away once the rule is chosen, so the finding doesn't say where the value comes from:
string fixture = "fixed-secret";
connect(password = fixture); // ballerina:14
login(secret = fixture); // ballerina:14
The JSON and SARIF reports give only the use site and the rule's general description. To triage connect(password = fixture), the reader has to work out that fixture is a variable holding a fixed value and find where it is declared. The same applies to a configurable's literal default, which is reported as ballerina:13 at every use.
Proposed Solution
Scanner API: related locations on an issue.
- Add a
Reporter.reportIssueoverload that also takes a list of related locations. - Add an
Issueaccessor that returns them. It is empty for issues reported without any. - This is additive, so existing analyzers and library rules are unaffected.
Secret rules: record the origin. SecretValueResolver already follows the value through variables, constants, configurable defaults and mapping fields. It would collect the declaration of each one on the way, and SecretChecker would report them as the issue's related locations. Along a chain such as a → b → "literal", every declaration is recorded.
Reports
- SARIF: emit the related locations as
relatedLocations, with a message such as "The fixed value is defined here". - JSON: add them to each issue.
- HTML: list them on the issue.
"location": {"filePath": "main.bal", "startLine": 2, "snippet": "fixture"},
"relatedLocations": [{"filePath": "main.bal", "startLine": 1, "snippet": "fixture"}]
Alternatives
- Report
ballerina:14once at the declaration, instead of at each use. This breaks consistency withballerina:13and with how other SAST tools report credential sinks, and it hides how many places use the value. - Name the variable in the message only, without a location. Readers still have to find the declaration, and SARIF viewers can't link to it.
Version
0.13.0
- 主要言語
- Java
- スター
- 15
- フォーク
- 12
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ballerina-platform/static-code-analysis-tool のほかの issue
-
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/CLI Type/Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ballerina-platform/static-code-analysis-tool#139 ·
メンテナーはふだん 1 日以内に返信
-
Ballerina Scan Tool v0.11.1 Release Readiness対応中かも @CharanaManawathilake が 4 日前に担当しました。 オープンType/Task
ballerina-platform/static-code-analysis-tool#159 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Area/Configuration Type/New Feature
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
ballerina-platform/static-code-analysis-tool#155 ·
メンテナーはふだん 1 日以内に返信
ballerina-platform/static-code-analysis-tool の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
commons-app/apps-android-commons#7275 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
liberation-data/drivine4j#682 ·
メンテナーはふだん 1 日以内に返信
-
Document and enforce pull request review guidelines対応中かも @dashorst が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
hermes-queue
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
chrisalunlloyd2-sudo/mindpalace#349 ·
メンテナーはふだん 1 日以内に返信