npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jitesoft/audit-for-gitlab

v4.0.1

Published

Minimal application to convert npm audit report into gitlab-ci vulnerability report format.

Downloads

227

Readme

Audit for GitLab

This is a small script to add a npm audit GitLab dependency scanner.
It generates a JSON audit via npm and converts it to the format that gitlab expects as dep scan report.

In case a vulnerability equal or higher to moderate is found, it will exit with exit code 1, i.e., fail.
While generating the report, it will also output number of vulnerabilities found (and types) in stdout.

Observe:
The scanner will currently only work with npmjs versions which makes use of audit report v2.
GitLab report specification supported is 15.0.2

Usage

Easiest way to use the scanner is to add it as a include in your .gitlab-ci.yml file, such as:

include:
  - https://gitlab.com/jitesoft/open-source/javascript/audit-for-gitlab/raw/master/scan.yml

This will run the scanning on your project on all events as long as it is disabled via env variables.

If you wish to customize it a bit more, you can extend or write your own:

npm-audit_dependency_scanning:
  image: registry.gitlab.com/jitesoft/open-source/javascript/audit-for-gitlab:1
  script:
    - audit-for-gitlab
  artifacts:
    reports:
      dependency_scanning: gl-dependency-scanning-report.json

If you wish to just use the scanner in one of your current scripts, the easiest way to do this, is to just install it via NPM:

npm i --global @jitesoft/audit-for-gitlab
cd /my/project/dir
audit-for-gitlab
cat gl-dependency-scanning-report.json

Dockerfile

The dockerfile is rebuilt on each new version of the scanner released, each build is released for ARM64 and AMD64.

Env variables

The following env variables can be used to configure the behaviour of the application slightly:

SECURE_LOG_LEVEL - Will change the log level to report more or less output.
Available levels are: fatal, error, warn, info, debugthough only debug, info and fatal are used in the application.
The debug level is basically only used for debugging purposes and development. info is default.

SCAN_EXIT_CODE - Will force a specific exit code in case of a moderate, high or critical vulnerability is found.
In case this is not set, exit code 1 will be used in the cases above, else 0.