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

@w3sec/w3security-to-html

v2.3.7

Published

Convert JSON output from `w3security test --json` into a static HTML report

Downloads

4

Readme

W3Security logo


W3Security JSON to HTML Mapper

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

How do I use it?

Install or clone

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

npm install w3security-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

| Short | Long | Description | | ----- | -------------------------- | ---------------------------------------------------------------------------------------------------------------- | | -t | --template | Template location for generating the html. Defaults to template/test-report.hbs | | -i | --input | Input path from where to read the json. Defaults to stdin | | -o | --output | Output of the resulting HTML. Example: -o w3security.html. Defaults to stdout | | -s | --summary | Generates an HTML with only the summary, instead of the details report. Defaults to details vulnerability report | | -d | --debug | Runs the CLI in debug mode | | -a | --actionable-remediation | Display actionable remediation info if available |

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

Generate the HTML report

W3Security JSON to HTML Mapper mapper works with the different W3Security 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 w3security-to-html:

    For W3Security Open Source

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

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

    For W3Security Code

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

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

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

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

    w3security iac test --json | w3security-to-html -o results-iac.html

    For W3Security Container

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

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

    The following methods/examples will utilize w3security test, however they will also work with the other product commands , as above.

  2. Using a temporary file:

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

    w3security test --json > results.json

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

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

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

  3. 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.

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

  4. Show actionable remediation:

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

    w3security-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.

License

License: Apache License, Version 2.0