diff --git a/lib/report/util.js b/lib/report/util.js index ca65523..f320cf6 100644 --- a/lib/report/util.js +++ b/lib/report/util.js @@ -17,10 +17,10 @@ const SEVERITY_RMAP = [ 'CRITICAL' ] const W = [ - 40, // Module Name - 12, // Risk Score - 23, // License - 15 // Security + 30, // Module Name + 11, // Risk Score + 18, // License + 9 // Security ] const SEVERITY_COLOR = { diff --git a/tap-snapshots/test-details.js-TAP.test.js b/tap-snapshots/test-details.js-TAP.test.js index 3be7178..09314db 100644 --- a/tap-snapshots/test-details.js-TAP.test.js +++ b/tap-snapshots/test-details.js-TAP.test.js @@ -5,11 +5,11 @@ * Make sure to inspect the output below. Do not ignore changes! */ 'use strict' -exports[`test/details.js TAP details output matches snapshot > details-output 1`] = ` +exports[`test/details.js TAP details dir output matches snapshot > details-output-dir 1`] = ` -╔═════════════╗ -║ npm @ 6.8.0 ║ -╚═════════════╝ +╔═════════════════════════════════════╗ +║ chalk @ 2.4.2 (within mock-project) ║ +╚═════════════════════════════════════╝ ┌──────┬─────────────┐ │ |||| │ Medium Risk │ @@ -27,32 +27,34 @@ exports[`test/details.js TAP details output matches snapshot > details-output 1` └───┴─────────────────────────────┘ License Risk: -┌───┬────────────────────────────────────┐ -│ X │ Noncompliant license: Artistic-2.0 │ -└───┴────────────────────────────────────┘ +┌───┬─────┐ +│ ✓ │ MIT │ +└───┴─────┘ Module Risk: -┌───┬────────────────┐ -│ ✓ │ No Module Risk │ -└───┴────────────────┘ +┌──────┬──────────────────────────────────────────────────────────────────────┐ +│ Med  │ This package version has an unsafe regular expression at │ +│ │ templates.js:2:24. │ +└──────┴──────────────────────────────────────────────────────────────────────┘ Code Quality (does not affect risk score): -┌───┬────────────────────────────────────────────────────────────────────────────────────────────┐ -│ ! │ This package version's size on disk is 32.0 MB. │ -├───┼────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ! │ This package has 4,028 file(s). │ -├───┼────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ! │ This package has 900 dir(s). │ -└───┴────────────────────────────────────────────────────────────────────────────────────────────┘ +┌───┬──────────────────────────────────────────────────────────────────────┐ +│ ! │ This package version's size on disk is 48.0 kB. │ +└───┴──────────────────────────────────────────────────────────────────────┘ + +Required By (leftmost is directly in your package): +┌──────────────────────────────────────────────────────────────────────┐ +│ (Directly in your package) │ +└──────────────────────────────────────────────────────────────────────┘ ` -exports[`test/details.js TAP details dir output matches snapshot > details-output-dir 1`] = ` +exports[`test/details.js TAP details output matches snapshot > details-output 1`] = ` -╔═════════════════════════════════════╗ -║ chalk @ 2.4.2 (within mock-project) ║ -╚═════════════════════════════════════╝ +╔═════════════╗ +║ npm @ 6.8.0 ║ +╚═════════════╝ ┌──────┬─────────────┐ │ |||| │ Medium Risk │ @@ -70,24 +72,23 @@ exports[`test/details.js TAP details dir output matches snapshot > details-outpu └───┴─────────────────────────────┘ License Risk: -┌───┬─────┐ -│ ✓ │ MIT │ -└───┴─────┘ +┌───┬────────────────────────────────────┐ +│ X │ Noncompliant license: Artistic-2.0 │ +└───┴────────────────────────────────────┘ Module Risk: -┌──────┬────────────────────────────────────────────────────────────────────────────────────────────┐ -│ Med  │ This package version has an unsafe regular expression at templates.js:2:24. │ -└──────┴────────────────────────────────────────────────────────────────────────────────────────────┘ +┌───┬────────────────┐ +│ ✓ │ No Module Risk │ +└───┴────────────────┘ Code Quality (does not affect risk score): -┌───┬────────────────────────────────────────────────────────────────────────────────────────────┐ -│ ! │ This package version's size on disk is 48.0 kB. │ -└───┴────────────────────────────────────────────────────────────────────────────────────────────┘ - -Required By (leftmost is directly in your package): -┌────────────────────────────────────────────────────────────────────────────────────────────┐ -│ (Directly in your package) │ -└────────────────────────────────────────────────────────────────────────────────────────────┘ +┌───┬──────────────────────────────────────────────────────────────────────┐ +│ ! │ This package version's size on disk is 32.0 MB. │ +├───┼──────────────────────────────────────────────────────────────────────┤ +│ ! │ This package has 4,028 file(s). │ +├───┼──────────────────────────────────────────────────────────────────────┤ +│ ! │ This package has 900 dir(s). │ +└───┴──────────────────────────────────────────────────────────────────────┘ ` diff --git a/tap-snapshots/test-install.js-TAP.test.js b/tap-snapshots/test-install.js-TAP.test.js index 9db5824..1303768 100644 --- a/tap-snapshots/test-install.js-TAP.test.js +++ b/tap-snapshots/test-install.js-TAP.test.js @@ -44,13 +44,13 @@ exports[`test/install.js TAP install output matches snapshot > install-output 1` └───┴────────────────┘ Code Quality (does not affect risk score): -┌───┬────────────────────────────────────────────────────────────────────────────────────────────┐ -│ ! │ This package version's size on disk is 32.0 MB. │ -├───┼────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ! │ This package has 4,028 file(s). │ -├───┼────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ! │ This package has 900 dir(s). │ -└───┴────────────────────────────────────────────────────────────────────────────────────────────┘ +┌───┬──────────────────────────────────────────────────────────────────────┐ +│ ! │ This package version's size on disk is 32.0 MB. │ +├───┼──────────────────────────────────────────────────────────────────────┤ +│ ! │ This package has 4,028 file(s). │ +├───┼──────────────────────────────────────────────────────────────────────┤ +│ ! │ This package has 900 dir(s). │ +└───┴──────────────────────────────────────────────────────────────────────┘ |➔ Install this module? (y/N) diff --git a/tap-snapshots/test-proxied.js-TAP.test.js b/tap-snapshots/test-proxied.js-TAP.test.js index 0aaab15..656d47a 100644 --- a/tap-snapshots/test-proxied.js-TAP.test.js +++ b/tap-snapshots/test-proxied.js-TAP.test.js @@ -37,13 +37,13 @@ exports[`test/proxied.js TAP api requests respect ENV proxy settings > details-o └───┴────────────────┘ Code Quality (does not affect risk score): -┌───┬────────────────────────────────────────────────────────────────────────────────────────────┐ -│ ! │ This package version's size on disk is 32.0 MB. │ -├───┼────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ! │ This package has 4,028 file(s). │ -├───┼────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ! │ This package has 900 dir(s). │ -└───┴────────────────────────────────────────────────────────────────────────────────────────────┘ +┌───┬──────────────────────────────────────────────────────────────────────┐ +│ ! │ This package version's size on disk is 32.0 MB. │ +├───┼──────────────────────────────────────────────────────────────────────┤ +│ ! │ This package has 4,028 file(s). │ +├───┼──────────────────────────────────────────────────────────────────────┤ +│ ! │ This package has 900 dir(s). │ +└───┴──────────────────────────────────────────────────────────────────────┘ ` diff --git a/tap-snapshots/test-report.js-TAP.test.js b/tap-snapshots/test-report.js-TAP.test.js index 2b88ed7..ef98388 100644 --- a/tap-snapshots/test-report.js-TAP.test.js +++ b/tap-snapshots/test-report.js-TAP.test.js @@ -26,17 +26,17 @@ exports[`test/report.js TAP report --compliance output > report-output-complianc ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=compliance) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=compliance) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -61,17 +61,17 @@ exports[`test/report.js TAP report --filter=compliance output > report-output-co ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=compliance) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=compliance) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -97,16 +97,16 @@ exports[`test/report.js TAP report --filter=h output > report-output-high-securi ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=HIGH) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=HIGH) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -131,16 +131,16 @@ exports[`test/report.js TAP report --filter=high --security output > report-outp ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security,HIGH) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security,HIGH) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -166,16 +166,16 @@ exports[`test/report.js TAP report --filter=high output > report-output-high-sec ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=HIGH) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=HIGH) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -200,16 +200,16 @@ exports[`test/report.js TAP report --filter=high,security output > report-output ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security,HIGH) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security,HIGH) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -234,22 +234,22 @@ exports[`test/report.js TAP report --filter=l --security output > report-output- ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security,LOW) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security,LOW) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -274,22 +274,22 @@ exports[`test/report.js TAP report --filter=low --security output > report-outpu ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security,LOW) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security,LOW) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -314,17 +314,17 @@ exports[`test/report.js TAP report --filter=m --security output > report-output- ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security,MEDIUM) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security,MEDIUM) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -349,17 +349,17 @@ exports[`test/report.js TAP report --filter=medium --security output > report-ou ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security,MEDIUM) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security,MEDIUM) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -384,22 +384,22 @@ exports[`test/report.js TAP report --filter=security output > report-output-secu ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -424,22 +424,22 @@ exports[`test/report.js TAP report --security output > report-output-security 1` ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -464,17 +464,17 @@ exports[`test/report.js TAP report -c output > report-output-compliance 1`] = ` ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=compliance) -------------------------------------------------------------------------------------------------- -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=compliance) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -499,22 +499,22 @@ exports[`test/report.js TAP report -s output > report-output-security 1`] = ` ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Filtered Modules (--filter=security) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Filtered Modules (--filter=security) -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -537,55 +537,55 @@ exports[`test/report.js TAP report output matches snapshot > long-report-output ! 2 noncompliant modules found |➔ Run \`ncm report --filter=compliance\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Modules -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ -───────────────────────────────────────────────────────────────────────────────────────────────── +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ +───────────────────────────────────────────────────────────────────────────  Non-whitelisted Modules -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ uglify-js @ 2.8.29 │ |||| High │ ✓ BSD-2-Clause │ ✓ 0 │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -│ chalk @ 2.4.2 │ |||| Med  │ ✓ MIT │ ✓ 0 │ -│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ -│ minimist @ 0.0.10 │ |||| Med  │ ✓ MIT │ ✓ 0 │ -│ source-map @ 0.5.7 │ |||| Med  │ ✓ BSD-3-Clause │ ✓ 0 │ -│ yargs @ 3.10.0 │ |||| Med  │ ✓ MIT │ ✓ 0 │ -│ amdefine @ 1.0.1 │ |||| Low  │ ✓ BSD-3-Clause OR MIT │ ✓ 0 │ -│ async @ 1.5.2 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ balanced-match @ 0.3.0 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ cliui @ 2.1.0 │ |||| Low  │ ✓ ISC │ ✓ 0 │ -│ color-convert @ 1.9.3 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ concat-map @ 0.0.1 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ is-buffer @ 1.1.6 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ kind-of @ 3.2.2 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ optimist @ 0.6.1 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ source-map @ 0.4.4 │ |||| Low  │ ✓ BSD-3-Clause │ ✓ 0 │ -│ window-size @ 0.1.0 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ wordwrap @ 0.0.2 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ wordwrap @ 0.0.3 │ |||| Low  │ ✓ MIT │ ✓ 0 │ -│ align-text @ 0.1.4 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ ansi-styles @ 3.2.1 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ camelcase @ 1.2.1 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ center-align @ 0.1.3 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ color-name @ 1.1.3 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ decamelize @ 1.2.0 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ escape-string-regexp @ 1.0.5 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ has-flag @ 3.0.0 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ lazy-cache @ 1.0.4 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ longest @ 1.0.1 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ repeat-string @ 1.6.1 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ right-align @ 0.1.3 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ supports-color @ 5.5.0 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ uglify-to-browserify @ 1.0.2 │ |||| None │ ✓ MIT │ ✓ 0 │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ uglify-js @ 2.8.29 │ |||| High │ ✓ BSD-2-Clause │ ✓ 0 │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +│ chalk @ 2.4.2 │ |||| Med  │ ✓ MIT │ ✓ 0 │ +│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ +│ minimist @ 0.0.10 │ |||| Med  │ ✓ MIT │ ✓ 0 │ +│ source-map @ 0.5.7 │ |||| Med  │ ✓ BSD-3-Clause │ ✓ 0 │ +│ yargs @ 3.10.0 │ |||| Med  │ ✓ MIT │ ✓ 0 │ +│ amdefine @ 1.0.1 │ |||| Low  │ ✓ BSD-3-Clause O…│ ✓ 0 │ +│ async @ 1.5.2 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ balanced-match @ 0.3.0 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ cliui @ 2.1.0 │ |||| Low  │ ✓ ISC │ ✓ 0 │ +│ color-convert @ 1.9.3 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ concat-map @ 0.0.1 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ is-buffer @ 1.1.6 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ kind-of @ 3.2.2 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ optimist @ 0.6.1 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ source-map @ 0.4.4 │ |||| Low  │ ✓ BSD-3-Clause │ ✓ 0 │ +│ window-size @ 0.1.0 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ wordwrap @ 0.0.2 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ wordwrap @ 0.0.3 │ |||| Low  │ ✓ MIT │ ✓ 0 │ +│ align-text @ 0.1.4 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ ansi-styles @ 3.2.1 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ camelcase @ 1.2.1 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ center-align @ 0.1.3 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ color-name @ 1.1.3 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ decamelize @ 1.2.0 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ escape-string-regexp… @ 1.0.5 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ has-flag @ 3.0.0 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ lazy-cache @ 1.0.4 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ longest @ 1.0.1 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ repeat-string @ 1.6.1 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ right-align @ 0.1.3 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ supports-color @ 5.5.0 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ uglify-to-browserify… @ 1.0.2 │ |||| None │ ✓ MIT │ ✓ 0 │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -611,17 +611,17 @@ exports[`test/report.js TAP report output matches snapshot > report-output 1`] = ! 1 used modules whitelisted |➔ Run \`ncm whitelist --list\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Top 5: Highest Risk Modules -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ -│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ -│ uglify-js @ 2.8.29 │ |||| High │ ✓ BSD-2-Clause │ ✓ 0 │ -│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ -│ chalk @ 2.4.2 │ |||| Med  │ ✓ MIT │ ✓ 0 │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ handlebars @ 4.0.5 │ |||| High │ ✓ MIT │ X 1H │ +│ ms @ 0.7.1 │ |||| High │ X UNKNOWN │ X 1L │ +│ uglify-js @ 2.8.29 │ |||| High │ ✓ BSD-2-Clause │ ✓ 0 │ +│ brace-expansion @ 1.1.2 │ |||| Med  │ ✓ MIT │ X 1M │ +│ chalk @ 2.4.2 │ |||| Med  │ ✓ MIT │ ✓ 0 │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` @@ -643,15 +643,15 @@ exports[`test/report.js TAP report with poisoned project > long-report-poisoned- ! 1 noncompliant modules found |➔ Run \`ncm report --filter=compliance\` for a list -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Modules -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ -│ is-path-in-cwd… @ 0.0.0-UNKNOWN-VERSION │ │ │ │ -│ is-path-inside @ 2.1.0 │ |||| None │ ✓ MIT │ ✓ 0 │ -│ path-is-inside @ 1.0.2 │ |||| None │ ✓ (WTFPL OR MIT) │ ✓ 0 │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ left-pad @ 1.3.0 │ |||| Med  │ X WTFPL │ ✓ 0 │ +│ is-pa… @ 0.0.0-UNKNOWN-VERSION │ │ │ │ +│ is-path-inside @ 2.1.0 │ |||| None │ ✓ MIT │ ✓ 0 │ +│ path-is-inside @ 1.0.2 │ |||| None │ ✓ (WTFPL OR MIT) │ ✓ 0 │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ ` diff --git a/tap-snapshots/test-whitelist.js-TAP.test.js b/tap-snapshots/test-whitelist.js-TAP.test.js index c687c6c..9fd2f3f 100644 --- a/tap-snapshots/test-whitelist.js-TAP.test.js +++ b/tap-snapshots/test-whitelist.js-TAP.test.js @@ -23,45 +23,45 @@ exports[`test/whitelist.js TAP whitelist updates properly > list-added-output 1` ╚══════════════════════════════════════╝ 2 modules total -───────────────────────────────────────────────────────────────────────────────────────────────── +───────────────────────────────────────────────────────────────────────────  Whitelisted Modules -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -│ ansi-styles @ 3.2.1 │ |||| None │ ✓ MIT │ ✓ 0 │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +│ ansi-styles @ 3.2.1 │ |||| None │ ✓ MIT │ ✓ 0 │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ |➔ Run \`ncm whitelist --remove @\` to remove a package from the whitelist. ` -exports[`test/whitelist.js TAP whitelist updates properly > remove-output 1`] = ` +exports[`test/whitelist.js TAP whitelist updates properly > list-removed-output 1`] = ` ╔══════════════════════════════════════╗ ║ (From NCM_TOKEN) Whitelisted Modules ║ ╚══════════════════════════════════════╝ -✓ Package(s) removed successfully. +1 modules total +─────────────────────────────────────────────────────────────────────────── + Whitelisted Modules +--------------------------------------------------------------------------- + Module Name Risk License Security +┌────────────────────────────────┬───────────┬──────────────────┬─────────┐ +│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ +└────────────────────────────────┴───────────┴──────────────────┴─────────┘ +|➔ Run \`ncm whitelist --remove @\` to remove a package from the whitelist. ` -exports[`test/whitelist.js TAP whitelist updates properly > list-removed-output 1`] = ` +exports[`test/whitelist.js TAP whitelist updates properly > remove-output 1`] = ` ╔══════════════════════════════════════╗ ║ (From NCM_TOKEN) Whitelisted Modules ║ ╚══════════════════════════════════════╝ -1 modules total -───────────────────────────────────────────────────────────────────────────────────────────────── - Whitelisted Modules -------------------------------------------------------------------------------------------------- - Module Name Risk License Security -┌──────────────────────────────────────────┬────────────┬───────────────────────┬───────────────┐ -│ debug @ 2.2.0 │ |||| Med  │ ✓ MIT │ X 1L │ -└──────────────────────────────────────────┴────────────┴───────────────────────┴───────────────┘ -|➔ Run \`ncm whitelist --remove @\` to remove a package from the whitelist. +✓ Package(s) removed successfully. ` diff --git a/test/report.js b/test/report.js index c69af9a..708c5ba 100644 --- a/test/report.js +++ b/test/report.js @@ -313,7 +313,7 @@ TestRunner.test('report with poisoned project', (runner, t) => { t.matchSnapshot(stdout, 'long-report-poisoned-output') t.match(stdout, /poisoned-project Report/) t.match(stdout, /left-pad @ 1.3.0/) - t.match(stdout, /is-path-in-cwd… @ 0.0.0-UNKNOWN-VERSION/) + t.match(stdout, /is-pa… @ 0.0.0-UNKNOWN-VERSION/) t.end() }) })