Constantly and automatically inspect for vulnerable dependencies

    There is a number of tools available to help identify third-party packages in Node.js applications which have been identified as vulnerable by the community to mitigate the risk of introducing them into your project. These can be used periodically from CLI tools or included as part of your application’s build process.

    Table of Contents

    is a new cli tool introduced with NPM@6.

    Running will produce a report of security vulnerabilities with the affected package name, vulnerability severity and description, path, and other information, and, if available, commands to apply patches to resolve vulnerabilities.

    Snyk

    Snyk offers a feature-rich CLI, as well as GitHub integration. Snyk goes further with this and in addition to notifying vulnerabilities, also automatically creates new pull requests fixing vulnerabilities as patches are released for known vulnerabilities.

    Snyk’s feature rich website also allows for ad-hoc assessment of dependencies when provided with a GitHub repository or npm module url. You can also search for npm packages which have vulnerabilities directly.

    An example of the output of the Synk GitHub integration automatically created pull request:

    Read on: Snyk website

    Greenkeeper is a service which offers real-time dependency updates, which keeps an application more secure by always using the most up to date and patched dependency versions.

    Greenkeeper watches the npm dependencies specified in a repository’s file, and automatically creates a working branch with each dependency update. The repository CI suite is then run to reveal any breaking changes for the updated dependency version in the application. If CI fails due to the dependency update, a clear and concise issue is created in the repository to be auctioned, outlining the current and updated package versions, along with information and commit history of the updated version.

    An example of the output of the Greenkeeper GitHub integration automatically created pull request:

    Read on: Greenkeeper website

    Additional resources

    NodeSource Blog: Improving npm security