Report related locations for ballerina:13 and ballerina:14 findings
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 15
- Fork
- 12
- Merge medio
- 2g 10h
- PR unite (30g)
- 17
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ballerina-platform/static-code-analysis-tool
-
Area/Reports Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ballerina-platform/static-code-analysis-tool#152 ·
I maintainer di solito rispondono entro 1 giorno
-
Area/CLI Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ballerina-platform/static-code-analysis-tool#140 ·
I maintainer di solito rispondono entro 1 giorno
-
Support `bal scan --version`ApertaArea/CLI Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ballerina-platform/static-code-analysis-tool#139 ·
I maintainer di solito rispondono entro 1 giorno
-
Ballerina Scan Tool v0.11.1 Release ReadinessForse già presa @CharanaManawathilake l’ha presa 4 giorni fa. ApertaType/Task
ballerina-platform/static-code-analysis-tool#159 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Area/Configuration Type/New Feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
ballerina-platform/static-code-analysis-tool#155 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ballerina-platform/static-code-analysis-tool
Issue simili
-
Document and enforce pull request review guidelinesForse già presa @dashorst l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
hermes-queue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
chrisalunlloyd2-sudo/mindpalace#349 ·
I maintainer di solito rispondono entro 1 giorno
-
Retry-After parser accepts invalid delay-seconds valuesForse già presa @Dhruvraj-Rana l’ha presa oggi. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
open-telemetry/opentelemetry-java#9018 ·
I maintainer di solito rispondono entro 2 giorni
-
dropwizard-testing: DAOTest.inTransaction leaves the transaction open when an Error is thrownAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dropwizard/dropwizard#11410 ·
I maintainer di solito rispondono entro 1 giorno