scorecard icon indicating copy to clipboard operation
scorecard copied to clipboard

On SAST check, evaluate is the project's language is supported by the SAST tools

Open diogoteles08 opened this issue 3 years ago • 12 comments

Is your feature request related to a problem? Please describe. The project is penalized on SAST check, but the project's language is not supported by any of the SAST tools that Scorecard consider.

Describe the solution you'd like When evaluating the SAST check, first analyze if the project language is supported by any of the the SAST tools Scorecard consider.

Describe alternatives you've considered Increase the number of SAST tools considered by Scorecard, but that would not take care of all scenarios.

Additional context I went through this issue while talking to rust-lang/rust about Scorecard adoption, you can check the discussion here.

This issue is indirectly related to #1726 and #2483

diogoteles08 avatar Dec 13 '22 14:12 diogoteles08

Please feel free to propose the SAST tools we should support, and which language they support. Not sure how long it would take to compile this list, but it would be very valuable. https://github.com/ossf/scorecard/pull/1487 is also relevant.

laurentsimon avatar Dec 13 '22 16:12 laurentsimon

I agree with @diogoteles08.

The same happens with Elixir, that neither CodeQL, SonarCloud nor LGTM support this programming language.

However, in the CI/CD of our Elixir projects in kommitters we use Dialyzer and Credo, but I am not sure if these tools can be fully considered as a SAST tool.

This is a common CI workflow: https://github.com/kommitters/kadena.ex/blob/010f18d213d45c47ca24102471918f4614a7f127/.github/workflows/ci.yml#L53-L60

miguelnietoa avatar Dec 23 '22 20:12 miguelnietoa

Another language in this scenario is Dart. Codeql does not support Dart and sonarcloud is still on plans to support it.

For this language, another path would be to support dart-analyze tool in the SAST check. @laurentsimon do you think it makes sense?

\cc @godofredoc

diogoteles08 avatar Mar 29 '23 21:03 diogoteles08

Another example is clang-tidy flutter/engine makes extensive use of it in all the supported platforms.

e.g. https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8785261744812716625/+/u/test:_lint_host_debug/stdout

godofredoc avatar Mar 29 '23 21:03 godofredoc

We're very very very interested in supporting more SAST tools, so +1 from me. Overtime we can clean up the code and improve the SAST check to be more ecosystem-aware if need be; and also to capture differences between the "type" of SAST (a linter like clang-tidy != static analysis tool). (Maybe we need a different check for linters altogether)

For CLI tools we need to parse workflow commands. That's also do-able but will need a bit more work.

Feel free to send PRs for SAST and cc me on it

laurentsimon avatar Mar 30 '23 01:03 laurentsimon

\cc @zanderso

godofredoc avatar Apr 12 '23 19:04 godofredoc

@laurentsimon even though clang tidy advertises itself as a linter tool it includes multiple memory validations, cast validations, pointer analysis, etc usually included in SAST tools (many of these are checked by CodeQL).

Full list of checks: https://clang.llvm.org/extra/clang-tidy/checks/list.html

godofredoc avatar Apr 12 '23 19:04 godofredoc

Thanks for the info. +1 on what you said. It uses only the AST iirc, but you're right it does a bit more than a "simple" linter.

laurentsimon avatar Apr 13 '23 19:04 laurentsimon

Stale issue message - this issue will be closed in 7 days

github-actions[bot] avatar Sep 18 '23 01:09 github-actions[bot]

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Nov 26 '23 01:11 github-actions[bot]

What about languages that already perform static analysis with strong guarantees like Rust, OCaml, Haskell? In those cases, a program simply doesn't compile if it has one of the classes of bug that the type system prevents. Those languages don't need an additional SAST tool because they already come with one. And that tool is actually part of the compiler, such that you don't need to run it in addition to the compiler. In particular, a program doesn't compile if the tool rejects the program. So I would extend the wording in the initial post of this issue:

Describe the solution you'd like When evaluating the SAST check, first analyze if the project language is supported by any of the the SAST tools Scorecard consider.

Or if the project language has a SAST tool built in the compiler and thus doesn't need an additional one.

ia0 avatar Aug 02 '24 14:08 ia0

This issue has been marked stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Oct 04 '24 02:10 github-actions[bot]