From 37437d9eb843f5169c2baa132e9031b973d3086c Mon Sep 17 00:00:00 2001 From: naugtur Date: Fri, 9 Jul 2021 14:28:30 +0200 Subject: [PATCH] TODOs for severity filter --- src/check/auditChecker.js | 3 ++- src/resolve/actions.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/check/auditChecker.js b/src/check/auditChecker.js index 41ef4f4..c56b38b 100644 --- a/src/check/auditChecker.js +++ b/src/check/auditChecker.js @@ -1,5 +1,5 @@ const { getResolution, RESOLUTIONS } = require('audit-resolve-core'); - +// TODO: get rules from the file via core (I'd have to check if they're properly exposed now) module.exports = { /** @@ -13,6 +13,7 @@ module.exports = { let unresolved = false; item.resolutions = item.paths.map(path => { const resolution = getResolution({ id: item.id, path }) + // TODO: add a check: if the item is ignored and its severity is too high, return as unresolved anyway if (resolution) { if (resolution === RESOLUTIONS.FIX) { // should have been fixed! diff --git a/src/resolve/actions.js b/src/resolve/actions.js index a36f4e4..d215373 100644 --- a/src/resolve/actions.js +++ b/src/resolve/actions.js @@ -2,6 +2,8 @@ const pkgFacade = require('../pkgFacade') // const investigate = require('../investigate'); const view = require('../views/decisions') const { RESOLUTIONS, saveResolution } = require('audit-resolve-core') +// TODO: get rules from the file via core (I'd have to check if they're properly exposed now) + const ONE_WEEK_LATER = Date.now() + 7 * 24 * 60 * 60 * 1000 const TWO_WEEKS_LATER = Date.now() + 14 * 24 * 60 * 60 * 1000 const MONTH_LATER = Date.now() + 30 * 24 * 60 * 60 * 1000 @@ -30,12 +32,15 @@ const strategies = { ] }, W: function ignoreWeek({ vuln }) { + // TODO: call a function verifying severity agains the rule, print a warning. return saveResolution(getIdentifiers(vuln), { resolution: RESOLUTIONS.IGNORE, expiresAt: ONE_WEEK_LATER }); }, M: function ignoreMonth({ vuln }) { + // TODO: call a function verifying severity agains the rule, print a warning. return saveResolution(getIdentifiers(vuln), { resolution: RESOLUTIONS.IGNORE, expiresAt: MONTH_LATER }); }, '!': function ignoreForever({ vuln }) { + // TODO: call a function verifying severity agains the rule, print a warning. return saveResolution(getIdentifiers(vuln), { resolution: RESOLUTIONS.IGNORE, expiresAt: NEVER }); }, r: function remindLater({ vuln }) {