Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK-4621: Added info about configuration of the NPM checker #2228

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ template: howto-guide-template
redirect_from:
---

This checker identifies and reports security vulnerabilities in the npm dependencies.
This checker identifies and reports security vulnerabilities in npm dependencies.

## Problem description

Frontend packages play an integral role in building modern web applications. Since these packages are created by different developers and teams, they can inadvertently include vulnerabilities that could be exploited by malicious actors to compromise the security and functionality of an application.
Because frontend packages are created by different developers and teams, they can include vulnerabilities that can be exploited by malicious actors to compromise the security and functionality of an application.

The npm vulnerabilities checker addresses this concern by actively scanning and identifying potential vulnerabilities in frontend packages. It accomplishes this by comparing the versions of packages used in a project against a continuously updated database of known vulnerabilities. When a package with a known vulnerability is detected, the checker alerts developers, provides information about the nature of the vulnerability, the potential risks it poses, and any recommended actions to help mitigate the threat.
The npm vulnerabilities checker addresses this concern by actively scanning and identifying potential vulnerabilities in frontend packages. It accomplishes this by comparing the versions of packages used in a project against a continuously updated database of known vulnerabilities. When a package with a known vulnerability is detected, the checker gives an alert, provides information about the nature of the vulnerability, potential risks, and the recommended actions to help mitigate the threat.

By using the npm vulnerabilities checker with the Evaluator, developers can safeguard their applications against security breaches and ensure that they are using the latest and most secure versions of frontend packages. This approach helps maintain the integrity of web applications and provides developers with the necessary information to make informed decisions about the packages they include in their projects.
By using the npm vulnerabilities checker with the Evaluator, you can safeguard your applications against security breaches and ensure that you are using the latest and secure versions of frontend packages.

## Example of an evaluator error message

Expand All @@ -37,6 +37,23 @@ Message: [high] Cross-realm object access in Webpack 5
Read more: https://docs.spryker.com/docs/scos/dev/guidelines/keeping-a-project-upgradable/upgradability-guidelines/npm-checker.html
```

## Configuration

There are four levels of security vulnerabilities:
* Low
* Moderate
* High
* Critical

By default, the npm checker evaluates the code against the high and critical levels. To define the levels to be checked, create or update `tooling.yml` in the project's root directory. Here's an exemplary configuration for evaluating against all vulnerability errors:
```yaml
evaluator:
checkerConfiguration:
- checker: NPM_CHECKER
var:
ALLOWED_SEVERITY_LEVELS: [low, moderate, high, critical]
```

## Resolve the error

To resolve the issue, update the npm dependencies with known vulnerabilities to the versions where the vulnerability issues are fixed.
To resolve the issue, update the npm dependencies with vulnerabilities to the versions with the vulnerability issues fixed.