Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

[New Feature] Confidence level for the issues #19

Closed
MVrachev opened this issue Apr 5, 2019 · 4 comments
Closed

[New Feature] Confidence level for the issues #19

MVrachev opened this issue Apr 5, 2019 · 4 comments

Comments

@MVrachev
Copy link

MVrachev commented Apr 5, 2019

There are different issues - some are more concrete others are problems only in specific situations and easily can produce many false-positives.

Like tsr-detect-non-literal-fs-filename rule is a problem when there is a user input which is not checked. This is a narrow case from all possible uses of fs.open/fs.read/fs.write and can easily produce many false-positives.

Having a confidence level will give an understanding of how possible is a false-positive from a concrete rule.

Many static code analysis tools for security vulnerabilities like Bandit and Gosec are using "confidence" level in their output.

@MVrachev
Copy link
Author

Is it possible to do that or TSLint doesn't provide us confidence level?

@webschik
Copy link
Owner

webschik commented Apr 16, 2019

TSLint allows to configure a severity level (https://palantir.github.io/tslint/usage/configuration/), but currently, all rules from tslint-config-security have a severity error.

As a quick solution you may use

// tslint:disable-next-line tsr-detect-non-literal-fs-filename
fs.open(myTrustedVariable)

@MVrachev
Copy link
Author

When I say "confidence level" I mean how sure is the linter that what it gives you is a problem.
As an example in Bandit in a typical output you have:

image

@webschik
Copy link
Owner

TSLint doesn't provide API for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants