1k-validators-be icon indicating copy to clipboard operation
1k-validators-be copied to clipboard

Add Static Code Analysis tooling to CI pipeline

Open wpank opened this issue 4 years ago • 5 comments

As this will use the controller seeds to nominate, some precautions should be taken so that code can't exploit these. Adding in Static Code Analysis tooling as part of the CI pipeline can help mitigate this.

Some possible solutions:

@kirushik @dud1337 any thoughts on these?

wpank avatar Mar 13 '20 07:03 wpank

From our discussion, I can recommend trying both JSPrime and SonarJS (has a node.js module). Seeing what the load/timing from having both of them as CI is, and comparing if any is a strict subset of another.

dud1337 avatar Mar 13 '20 15:03 dud1337

The cheapest way would be to extend existing ESlint with security plugin. It's not very smart (since it is pretty local in its view of the code, being a linter on the first place) — but will get us at least something for very little effort.

JSPrime seems to be unmaintained; taking in account Dudley's preferences above, SonarJS it is then?

EDIT: eslint-plugin-sonarjs seems to be a very limited subset of all 140 rules of SonarJS and probably shouldn't be considered a viable option.

kirushik avatar Mar 13 '20 17:03 kirushik

Should we consider this closed with the addition of eslint-plugin-security in #33 or keep it open until we add SonarJS?

lsaether avatar Mar 16 '20 14:03 lsaether

@lsaether set of rules for eslint-plugin-security vs set of rules for SonarJS.

I suggest us keeping this issue open till we plug in SonarJS; without it, we might forget — and it seems eslint only provides some very basic subset of all the checks we might want to ahve around our codebase.

kirushik avatar Mar 16 '20 16:03 kirushik

static analysis definitely makes sense to have as some additional github action on top, scanning for known heuristic xploits and fraud patterns :) good idea +1

sascha1337 avatar Apr 08 '21 19:04 sascha1337