2.5.0 • Published 16 days ago

snyk-to-html v2.5.0

Weekly downloads
17,278
License
Apache-2.0
Repository
github
Last release
16 days ago

Snyk logo


Snyk JSON to HTML Mapper

The Snyk JSON to HTML Mapper takes the json outputted from snyk test --json and creates a local HTML file displaying the vulnerabilities discovered.

How do I use it?

Install or clone

First, Install the Snyk JSON to HTML Mapper using npm:

npm install snyk-to-html -g

Alternatively, you can clone the repo and run the script locally using:

npm install
npm run build
node ./dist/index.js

Options

ShortLongDescription
-t--templateTemplate location for generating the html. Defaults to template/test-report.hbs
-i--inputInput path from where to read the json. Defaults to stdin
-o--outputOutput of the resulting HTML. Example: -o snyk.html. Defaults to stdout
-s--summaryGenerates an HTML with only the summary, instead of the details report. Defaults to details vulnerability report
-d--debugRuns the CLI in debug mode
-a--actionable-remediationDisplay actionable remediation info if available

When in doubt, use snyk-to-html --help or snyk-to-html -h.

Generate the HTML report

Snyk JSON to HTML Mapper mapper works with the different Snyk Products. Change the directory to your package's root folder, then use one of the ways below to generate the HTML report, using the appropriate product's command

  1. Directly streaming the results to snyk-to-html:

    For Snyk Open Source

    Run the following line to create a file called results-opensource.html:

    snyk test --json | snyk-to-html -o results-opensource.html

    For Snyk Code

    Run the following line to create a file called results-code.html:

    snyk code test --json | snyk-to-html -o results-code.html

For Snyk Infrastructure as Code (IaC) Navigate to the subfolder with the related files.

  Run the following line to create a file called `results-iac.html`:

  `snyk iac test --json | snyk-to-html -o results-iac.html`

For Snyk Container

Run the following line to create a file called `results-container.html`:

  `snyk container test [image] --json | snyk-to-html -o results-container.html`

  The following methods/examples will utilize snyk test, however they will also work with the other product commands , as above.
  1. Using a temporary file:

    Generate JSON data by running snyk test and save the output to a file

    snyk test --json > results.json

    Pass the resulting JSON file to Snyk's JSON to HTML Mapper

    snyk-to-html -i results.json -o results.html

    Note input files should be valid JSON and use UTF-8 encoding.

  2. If you want a simpler version of the report to be shown, you can pass -s or --summary to only display the summary of the report.

    snyk-to-html -i results.json -o results.html -s

  3. Show actionable remediation:

    To display the actions you can take to remedy vulnerabilities, pass -a or --actionable-remediation.

    snyk-to-html -i results.json -o results.html -a

    The report orders remediations (upgrades and patches) by the number and severity of vulnerabilities it fixes. Use this to guide when selecting the order to upgrade and patch packages.

    Note we currently support remediation advice with the following package managers:

    • npm
    • yarn
    • rubygems
    • maven
    • gradle
    • sbt
    • pip

View the HTML report

Simply open your new file (results-[type].html as above) in a browser, and rejoice.

Getting support for snyk-to-html

Submit a ticket to Snyk support when you need help with snyk-to-html or Snyk in general. Note that Snyk support does not actively monitor GitHub Issues on any Snyk development project.

License

License: Apache License, Version 2.0

2.4.0

4 months ago

2.5.0

16 days ago

2.3.8

4 months ago

2.3.7

10 months ago

2.3.6

2 years ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.5

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.3.0

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.15.0

3 years ago

1.14.1

3 years ago

1.14.0

4 years ago

1.13.1

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.4

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.4

4 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago