vigievuln 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/lib/artifacts/component-scope.js +25 -2
- package/lib/artifacts/inventory-scope.js +2 -1
- package/lib/artifacts/report-inventory.js +5 -1
- package/lib/artifacts/report.js +19 -7
- package/lib/artifacts/retire.js +80 -0
- package/lib/artifacts/scan.js +18 -10
- package/lib/cli-image.js +5 -0
- package/lib/cve-report.js +26 -3
- package/lib/i18n.js +2 -0
- package/lib/image-references.js +21 -1
- package/lib/json-export.js +2 -2
- package/lib/report-notices.js +1 -1
- package/lib/retire.js +12 -10
- package/lib/source-image-scan.js +1 -0
- package/lib/system-inventory/collect.js +1 -1
- package/lib/system-inventory/distribution-sources.js +1 -1
- package/lib/system-inventory/nginx-advisories.js +26 -8
- package/package.json +1 -1
- package/vigievuln.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Release notes — VigieVuln
|
|
2
2
|
|
|
3
|
+
## [1.3.2] — 2026-11-20
|
|
4
|
+
|
|
5
|
+
- Group image CVEs by installation source and show declared image references first; omit unaffected image sub-dependencies from report inventories.
|
|
6
|
+
- Add optional `--image-retire` inspection of deployed JavaScript, excluding package stores, with offline reassessment and explicit coverage limits.
|
|
7
|
+
- Reduce report size with compact JSON and shared identical HTML CVE details, retaining vulnerability evidence and occurrences.
|
|
8
|
+
- Assess vendor NGINX packages on Alpine using retained maintainer metadata; refresh older inventories online.
|
|
9
|
+
- Respect branch-specific NGINX fixes and accept CVE identifiers with or without their prefix in the official feed.
|
|
10
|
+
- Warn when image references are not pinned by digest, including numeric version tags, in source and registry image scans.
|
|
11
|
+
|
|
3
12
|
## [1.3.1] — 2026-11-18
|
|
4
13
|
|
|
5
14
|
- Summarize NVD/EUVD record availability in one warning, separate from discovery coverage.
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[](https://github.com/9pings/VigieVuln/actions/workflows/ci.yml)
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
**VigieVuln 1.3.
|
|
13
|
+
**VigieVuln 1.3.2** is a polyglot dependency auditor for code audits.
|
|
14
14
|
|
|
15
15
|
It scans dependencies and **9 CMS/frameworks** in one pass without build tools, supports **air-gapped** workflows, detects private packages, binaries and certificates, and produces HTML, JSON and other reports.
|
|
16
16
|
|
|
@@ -19,13 +19,36 @@ function isNpmPackageDescriptor(value) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function imageComponentRole(dep={}) {
|
|
22
|
+
if(imageComponentSource(dep).category==='global')return 'direct';
|
|
22
23
|
if(dep.ecosystem==='system' || dep.ecosystem==='binary')return 'direct';
|
|
23
24
|
const source=dep.installEvidence?.source;
|
|
24
|
-
if(['pypi','composer','composer-php','ruby','nuget'].includes(source))return 'transitive';
|
|
25
|
+
if(['pypi','composer','composer-php','ruby','nuget','retire'].includes(source))return 'transitive';
|
|
25
26
|
if(dep.provenance==='binary-module')return dep.binaryEvidence?.original?.kind==='mod'?'direct':'transitive';
|
|
26
27
|
const paths=[dep.artifactPath,dep.installEvidence?.path,...(dep.manifestPaths||[])].filter(Boolean);
|
|
27
28
|
if(paths.some(p=>String(p).includes('!/') || parts(p).some(n=>stores.has(n)) || String(p).replace(/\\/g,'/').includes('usr/share/nodejs/')))return 'transitive';
|
|
28
29
|
return 'direct';
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
// Paths here are relative to the image, never the temporary extraction directory.
|
|
33
|
+
// A package store is not evidence of a global install unless its prefix is known.
|
|
34
|
+
function imageComponentSource(dep={}) {
|
|
35
|
+
const p=String(dep.artifactPath || dep.installEvidence?.path || dep.manifestPaths?.[0] || '').replace(/\\/g,'/').replace(/^\/+/, '');
|
|
36
|
+
const source=dep.installEvidence?.source;
|
|
37
|
+
const os=dep.ecosystem==='system' ? dep : dep.osPackageOwners?.[0];
|
|
38
|
+
if(os)return {category:'system',manager:os.manager || os.packageType || 'system'};
|
|
39
|
+
if(source==='retire' || dep.ecosystemType==='retire')return {category:'vendored',manager:'retirejs'};
|
|
40
|
+
const npm=/^((?:(?:usr(?:\/local)?|opt\/[^/]+)\/lib|(?:root|home\/[^/]+)\/(?:\.npm-global\/lib|\.nvm\/versions\/node\/[^/]+\/lib))\/node_modules)\/(?:@[^/]+\/)?[^/]+\/package\.json$/.exec(p);
|
|
41
|
+
if(dep.ecosystem==='npm' && npm)return {category:'global',manager:'npm',root:npm[1]};
|
|
42
|
+
const python=/^((?:usr(?:\/local)?\/lib(?:64)?\/python[^/]+|(?:root|home\/[^/]+)\/\.local\/lib\/python[^/]+)\/(?:site|dist)-packages)\//.exec(p);
|
|
43
|
+
if(dep.ecosystem==='pypi' && python)return {category:'global',manager:'python',root:python[1]};
|
|
44
|
+
const ruby=/^((?:usr(?:\/local)?\/(?:lib\/ruby\/gems|share\/gems)|var\/lib\/gems|(?:root|home\/[^/]+)\/\.gem\/ruby)(?:\/[^/]+)?)\/specifications\//.exec(p);
|
|
45
|
+
if(dep.ecosystem==='ruby' && ruby)return {category:'global',manager:'ruby',root:ruby[1]};
|
|
46
|
+
const composer=/^((?:root|home\/[^/]+)\/(?:\.composer|\.config\/composer))\/vendor\/composer\/installed\.(?:json|php)$/.exec(p);
|
|
47
|
+
if(dep.ecosystem==='composer' && composer)return {category:'global',manager:'composer',root:composer[1]};
|
|
48
|
+
if(p && !p.includes('!/') && isProjectDescriptor(p) && !p.startsWith('usr/share/nodejs/') &&
|
|
49
|
+
(['composer-project','pypi-project','maven-project'].includes(source) || dep.ecosystem==='npm' && /(?:^|\/)package\.json$/.test(p)))
|
|
50
|
+
return {category:'project',manager:dep.ecosystem,root:p.includes('/')?p.slice(0,p.lastIndexOf('/')):'.'};
|
|
51
|
+
return {category:'other',manager:dep.ecosystem || 'unknown'};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports={IMAGE_COMPONENT_SCOPE,isNpmPackageDescriptor,isProjectDescriptor,imageComponentRole,imageComponentSource};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// A saved inventory is validated before this transformation. Filtering an old
|
|
4
4
|
// snapshot cannot reconstruct descriptors that its collectors never observed.
|
|
5
|
-
const { IMAGE_COMPONENT_SCOPE, isNpmPackageDescriptor, imageComponentRole } = require('./component-scope');
|
|
5
|
+
const { IMAGE_COMPONENT_SCOPE, isNpmPackageDescriptor, imageComponentRole, imageComponentSource } = require('./component-scope');
|
|
6
6
|
const SCOPE_REASON = 'image-inventory-scope-outdated';
|
|
7
7
|
const SCOPE_MESSAGE = 'The saved image inventory predates the current component scope or contains package metadata fragments. Reacquire the image to establish its current inventory.';
|
|
8
8
|
|
|
@@ -26,6 +26,7 @@ function applyComponentScope(target, { checkPolicy = true } = {}) {
|
|
|
26
26
|
result.deps = (result.deps || []).filter(dep => {
|
|
27
27
|
if (isNpmFragment(dep)) { filtered = true; return false; }
|
|
28
28
|
dep.imageRole = imageComponentRole(dep);
|
|
29
|
+
dep.imageSource = imageComponentSource(dep);
|
|
29
30
|
dep.scope = dep.imageRole === 'transitive' ? 'transitive' : 'runtime';
|
|
30
31
|
return true;
|
|
31
32
|
});
|
|
@@ -13,7 +13,11 @@ function reportedComponents(artifact, matches = []) {
|
|
|
13
13
|
(match.dep?.artifactTargetId || match.artifactTargetId) === artifact.id &&
|
|
14
14
|
!match.cpeFiltered && (match.cve?.id || match.advisoryId)
|
|
15
15
|
).map(match => componentIdentity(match.dep || {})));
|
|
16
|
-
return (artifact.components || []).filter(dep =>
|
|
16
|
+
return (artifact.components || []).filter(dep => {
|
|
17
|
+
if(affected.has(componentIdentity(dep)))return true;
|
|
18
|
+
if(dep.imageRole==='transitive')return false;
|
|
19
|
+
return !needsAdvisory(dep);
|
|
20
|
+
});
|
|
17
21
|
}
|
|
18
22
|
function reportArtifacts(artifacts, matches) {
|
|
19
23
|
return artifacts.map(artifact => {
|
package/lib/artifacts/report.js
CHANGED
|
@@ -98,11 +98,26 @@ function renderImageCves(projectInfo = {}, matches = [], locale = 'en', helpers
|
|
|
98
98
|
if(!groups.length)return explanation+`<p>${noFindings} ${t('Reference-only images have not been scanned.','Les images uniquement déclarées n’ont pas été analysées.')}</p>`;
|
|
99
99
|
return explanation+groups.map(({artifact,matches:rows})=>{
|
|
100
100
|
const anchor=artifactAnchor(artifact.id),heading=`${esc(artifactTitle(artifact,artifacts))} (${rows.length})`;
|
|
101
|
-
const detail=rows.length && typeof render==='function' ?
|
|
101
|
+
const detail=rows.length && typeof render==='function' ? groupImageSources(rows,m=>m.dep,locale).map(group=>
|
|
102
|
+
`<details class="report-subsection" open data-image-source="${esc(group.category)}"><summary><h4>${esc(group.label)} (${group.items.length})</h4></summary><div>${render(group.items,{image:artifact})}</div></details>`).join('') : `<p>${noFindings}</p>`;
|
|
102
103
|
const content=`${renderImageSummary(artifact,locale)}<p class="image-section-nav"><a class="report-section-link" href="#${anchor}">${t('Image inventory and coverage','Inventaire et couverture de l’image')}<span aria-hidden="true">→</span></a></p>${detail}`;
|
|
103
104
|
return typeof minor==='function' ? minor(heading,content,{id:anchor+'-cves'}) : `<details class="report-subsection" open id="${anchor}-cves"><summary><h3>${heading}</h3></summary><div>${content}</div></details>`;
|
|
104
105
|
}).join('');
|
|
105
106
|
}
|
|
107
|
+
function groupImageSources(items,depOf,locale) {
|
|
108
|
+
const t=tr(locale),groups=new Map(),order=['system','global','project','vendored','other'];
|
|
109
|
+
const labels={system:t('System packages','Paquets système'),global:t('Global installations','Installations globales'),project:t('Applications with a root descriptor','Applications avec un descripteur racine'),vendored:t('Bundled JavaScript (RetireJS)','JavaScript embarqué (RetireJS)'),other:t('Other components and sub-dependencies','Autres composants et sous-dépendances')};
|
|
110
|
+
const managers={dpkg:'APT / dpkg',deb:'APT / dpkg',apk:'APK',rpm:'RPM',npm:'npm -g',python:'Python',ruby:'RubyGems',composer:'Composer'};
|
|
111
|
+
for(const item of items){
|
|
112
|
+
const dep=depOf(item),source=dep.imageSource || require('./component-scope').imageComponentSource(dep);
|
|
113
|
+
const category=order.includes(source.category)?source.category:'other';
|
|
114
|
+
const suffix=['system','global'].includes(category)?managers[source.manager] || source.manager:category==='project'?source.root:'';
|
|
115
|
+
const key=JSON.stringify([category,suffix]);
|
|
116
|
+
if(!groups.has(key))groups.set(key,{category,label:labels[category]+(suffix?' — '+suffix:''),items:[]});
|
|
117
|
+
groups.get(key).items.push(item);
|
|
118
|
+
}
|
|
119
|
+
return [...groups.values()].sort((a,b)=>order.indexOf(a.category)-order.indexOf(b.category)||a.label.localeCompare(b.label));
|
|
120
|
+
}
|
|
106
121
|
function stats(group) {
|
|
107
122
|
const matches=visible(group.matches),components=new Set(),advisories=new Set(),cves=new Set(),severity={critical:0,high:0,medium:0,low:0,unknown:0},updates=new Map();
|
|
108
123
|
for(const m of matches) {
|
|
@@ -174,10 +189,7 @@ function renderArtifactEvidence(projectInfo = {}, locale = 'en', matches = []) {
|
|
|
174
189
|
return `<tr><td><code>${esc(c.namespace?c.namespace+'/'+c.name:c.name||c.artifactId||c.coord||'')}</code><br>${esc(c.packageType||c.ecosystem||'')}${c._fromFinding?`<br><small>${t('From finding; not present in inventory','Issu d’un résultat ; absent de l’inventaire')}</small>`:''}</td><td>${esc(c.version||'—')}</td><td>${fixes.map(esc).join('<br>')||'—'}</td><td>${links||'—'}</td><td>${esc(c.architecture||'—')}</td><td>${esc(c.artifactPath||'—')}</td><td>${esc((c.osPackageOwners||[]).map(o=>`${o.name}@${o.version}`).join(', ')||'—')}</td></tr>`;
|
|
175
190
|
}).join('');
|
|
176
191
|
const table=items=>items.length?`<table class="image-inventory"><thead><tr><th>${t('Component','Composant')}</th><th>${t('Installed','Installé')}</th><th>${t('Candidate corrections','Corrections proposées')}</th><th>${t('Advisories','Avis')}</th><th>Arch</th><th>${t('Location','Emplacement')}</th><th>${t('OS package owner','Paquet système propriétaire')}</th></tr></thead><tbody>${componentRows(items)}</tbody></table>`:`<p>${t('No components observed.','Aucun composant observé.')}</p>`;
|
|
177
|
-
const
|
|
178
|
-
const componentSections=`<h5>${t('Direct image components','Composants directs de l’image')} (${direct.length})</h5>${table(direct)}`+
|
|
179
|
-
`<h5>${t('Image sub-dependencies','Sous-dépendances de l’image')} (${subdeps.length})</h5>${table(subdeps)}`+
|
|
180
|
-
(unclassified.length?`<h5>${t('Unclassified image components','Composants de l’image non classés')} (${unclassified.length})</h5>${table(unclassified)}`:'');
|
|
192
|
+
const componentSections=groupImageSources(inventory,c=>c,locale).map(group=>`<h5>${esc(group.label)} (${group.items.length})</h5>${table(group.items)}`).join('');
|
|
181
193
|
const totals=[[t('Components','Composants'),Number(a.componentCount ?? a.components?.length ?? 0)],[t('Affected packages','Paquets affectés'),s.components],[t('Advisories','Avis'),s.advisories],[t('Unique CVEs','CVE distinctes'),s.cves]];
|
|
182
194
|
const totalsTable=`<table class="image-totals"><thead><tr>${totals.map(([label])=>`<th scope="col">${label}</th>`).join('')}</tr></thead><tbody><tr>${totals.map(([,value])=>`<td class="image-total-value">${value}</td>`).join('')}</tr><tr><td colspan="4"><span class="image-severity-label">${t('CVE row severities','Sévérités des lignes CVE')}</span>${renderSeverityCounts(s.severity,locale)}</td></tr></tbody>${group.matches.length?`<tfoot><tr><td colspan="4"><a class="report-section-link" href="#${anchor}-cves">${t('View vulnerability details','Voir les vulnérabilités')}<span aria-hidden="true">→</span></a></td></tr></tfoot>`:''}</table>`;
|
|
183
195
|
const noCve=visible(group.matches).filter(m=>m.dep?.ecosystem==='system' && !linkedCves(m.cve).length);
|
|
@@ -192,8 +204,8 @@ function renderArtifactEvidence(projectInfo = {}, locale = 'en', matches = []) {
|
|
|
192
204
|
totalsTable+
|
|
193
205
|
imageAction+
|
|
194
206
|
(rows?`<details open><summary>${t('Coverage checks','Contrôles de couverture')}</summary><table><thead><tr><th>${t('Capability','Capacité')}</th><th>${t('Source','Source')}</th><th>${t('Execution','Exécution')}</th><th>${t('Result / limitation','Résultat / limite')}</th></tr></thead><tbody>${rows}</tbody></table></details>`:`<p>${t('Coverage information unavailable.','Informations de couverture indisponibles.')}</p>`)+
|
|
195
|
-
renderAdvisoryObservations(a,locale)+nonCveAdvisories+`<details class="report-subsection"><summary><h4>${t('Component inventory and candidate corrections','Inventaire des composants et corrections proposées')} (${inventory.length})</h4></summary><p>${t('
|
|
207
|
+
renderAdvisoryObservations(a,locale)+nonCveAdvisories+`<details class="report-subsection"><summary><h4>${t('Component inventory and candidate corrections','Inventaire des composants et corrections proposées')} (${inventory.length})</h4></summary><p>${t('Direct applications are listed with or without findings; sub-dependencies, system packages and native binaries are detailed only when associated with an advisory. Roles describe the image inventory, not project dependency scope.','Les applications directes sont listées avec ou sans résultat ; les sous-dépendances, paquets système et binaires natifs sont détaillés uniquement lorsqu’un avis leur est associé. Les rôles décrivent l’inventaire de l’image et non la portée des dépendances du projet.')}</p><p>${t('Candidate versions come from individual advisories. Verify them in the replacement image; they do not establish that a particular image tag or digest is corrected.','Les versions proposées proviennent d’avis individuels. Vérifiez-les dans l’image de remplacement ; elles ne prouvent pas qu’un tag ou une empreinte d’image est corrigé.')}</p>${componentSections}</details></div></details>`;
|
|
196
208
|
}).join('');
|
|
197
|
-
return referenceNotice+overview+(groups.length?`<p>${t('A raw finding is an advisory affecting a component. An advisory can link several CVEs; the CVE section groups linked CVE identifiers while advisories without linked CVEs remain below.','Un résultat brut correspond à un avis affectant un composant. Un avis peut être lié à plusieurs CVE ; la section CVE regroupe les identifiants liés et les avis sans CVE liée restent ci-dessous.')}</p>`:'')+cards
|
|
209
|
+
return renderReferences(projectInfo,artifacts,locale)+referenceNotice+overview+(groups.length?`<p>${t('A raw finding is an advisory affecting a component. An advisory can link several CVEs; the CVE section groups linked CVE identifiers while advisories without linked CVEs remain below.','Un résultat brut correspond à un avis affectant un composant. Un avis peut être lié à plusieurs CVE ; la section CVE regroupe les identifiants liés et les avis sans CVE liée restent ci-dessous.')}</p>`:'')+cards;
|
|
198
210
|
}
|
|
199
211
|
module.exports={artifactAnchor,artifactTitle,artifactGroups,renderImageCves,renderArtifactEvidence};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Inspect image bytes only. Do not execute the image's JavaScript or follow its
|
|
3
|
+
// symlinks. Persist identities, then reassess them with the current signature DB.
|
|
4
|
+
const fs=require('node:fs'),path=require('node:path'),crypto=require('node:crypto');
|
|
5
|
+
const retire=require('retire/lib/retire');
|
|
6
|
+
const POLICY='image-retire/1';
|
|
7
|
+
const EXCLUDED=new Set(['node_modules','bower_components','jspm_packages','vendor','site-packages','dist-packages','__pypackages__','.git','.npm','.yarn','.pnpm-store','.cache','.m2','.gradle','.nuget']);
|
|
8
|
+
async function repository(options){
|
|
9
|
+
const helper=require('../retire');
|
|
10
|
+
const refreshed=await helper.warmRetireSignatures({...options,force:options.forceUpdate});
|
|
11
|
+
const entry=helper.cachedSignatureEntry(options.cacheDir);
|
|
12
|
+
if(!entry || !refreshed.ok && !options.offline && require('../providers').hasHostedProxy())throw Error(refreshed.error || 'RetireJS signatures are unavailable');
|
|
13
|
+
const repo=JSON.parse(retire.replaceVersion(entry.value));
|
|
14
|
+
if(!repo || typeof repo!=='object' || Array.isArray(repo))throw Error('Invalid RetireJS signatures');
|
|
15
|
+
for(const [name,record] of Object.entries(repo))if(name.startsWith('$'))delete repo[name];else if(!record?.extractors)throw Error('Invalid RetireJS extractor');
|
|
16
|
+
return {repo,signaturesAt:new Date(entry.fetchedAt).toISOString(),refreshError:refreshed.ok?null:refreshed.error || 'RetireJS signatures could not be refreshed'};
|
|
17
|
+
}
|
|
18
|
+
const warning=(error,capability='inventory')=>({type:'dependency-coverage',capability,reason:'image-retire-incomplete',message:error.message});
|
|
19
|
+
async function collectImageJs(root,options={},ownedPaths=[]){
|
|
20
|
+
const deps=[],warnings=[],coverage={collector:'image-retire',capability:'inventory',execution:'completed',result:'indeterminate',files:0,excludedDirectories:[...EXCLUDED],policy:POLICY};
|
|
21
|
+
const owned=new Set(ownedPaths.map(p=>path.posix.normalize('/'+String(p).replace(/\\/g,'/').replace(/^\/+/,''))));
|
|
22
|
+
coverage.excludedOwnedFiles=0;
|
|
23
|
+
let signatures;
|
|
24
|
+
try{signatures=await repository(options);coverage.signaturesAt=signatures.signaturesAt;if(signatures.refreshError)warnings.push(warning(Error(signatures.refreshError)));}
|
|
25
|
+
catch(error){return {deps,warnings:[warning(error)],coverage:{...coverage,execution:'not-run',reason:error.message}};}
|
|
26
|
+
const maxFile=options.maxImageJsFileBytes ?? 16*1024*1024,maxBytes=options.maxImageJsBytes ?? 128*1024*1024,maxFiles=options.maxImageJsFiles ?? 10000;
|
|
27
|
+
let bytes=0,stopped=false;const stack=[root];
|
|
28
|
+
while(stack.length && !stopped){
|
|
29
|
+
options.signal?.throwIfAborted();
|
|
30
|
+
const dir=stack.pop();let entries;
|
|
31
|
+
try{entries=fs.readdirSync(dir,{withFileTypes:true});}catch(error){warnings.push(warning(error));continue;}
|
|
32
|
+
for(const entry of entries){
|
|
33
|
+
const fp=path.join(dir,entry.name),rel=path.relative(root,fp).split(path.sep).join('/');
|
|
34
|
+
if(entry.isDirectory()){
|
|
35
|
+
if(!EXCLUDED.has(entry.name) && !['proc','sys','dev','usr/share/nodejs'].includes(rel))stack.push(fp);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if(!entry.isFile() || !/\.(?:js|mjs|cjs)$/i.test(entry.name))continue;
|
|
39
|
+
// OS-owned libraries may be backported without changing their embedded
|
|
40
|
+
// upstream version. Their distribution advisories remain authoritative.
|
|
41
|
+
if(owned.has('/'+rel)){coverage.excludedOwnedFiles++;continue;}
|
|
42
|
+
try{
|
|
43
|
+
const size=fs.statSync(fp).size;
|
|
44
|
+
if(size>maxFile){warnings.push(warning(Error(`RetireJS file exceeds ${maxFile} bytes: ${rel}`)));continue;}
|
|
45
|
+
if(++coverage.files>maxFiles || bytes+size>maxBytes){warnings.push(warning(Error('RetireJS image scan resource limit reached')));stopped=true;break;}
|
|
46
|
+
bytes+=size;
|
|
47
|
+
let results=retire.scanFileName(rel,signatures.repo);
|
|
48
|
+
if(!results.length)results=retire.scanFileContent(fs.readFileSync(fp),signatures.repo,{sha1:text=>crypto.createHash('sha1').update(text).digest('hex')});
|
|
49
|
+
for(const result of results){
|
|
50
|
+
if(!result.component || !result.version)continue;
|
|
51
|
+
const dep=require('../dep-record').makeDepRecord({ecosystem:'npm',name:result.component,version:result.version,manifestPath:rel,provenance:'vendored',scope:'vendored'});
|
|
52
|
+
dep.coordKey=`retire:${rel}:${result.component}@${result.version}`;
|
|
53
|
+
dep.ecosystemType='retire';dep.installEvidence={source:'retire',path:rel,detection:result.detection};deps.push(dep);
|
|
54
|
+
}
|
|
55
|
+
}catch(error){warnings.push(warning(Error(`${rel}: ${error.message}`)));}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
coverage.bytes=bytes;coverage.count=deps.length;if(warnings.length)coverage.execution='partial';
|
|
59
|
+
return {deps,warnings,coverage};
|
|
60
|
+
}
|
|
61
|
+
async function assessImageJs(target,options={}){
|
|
62
|
+
const coverage={artifactTargetId:target.id,capability:'advisories',collector:'image-retire',execution:'completed',result:'no-match'};
|
|
63
|
+
if(!options.imageRetire)return {matches:[],warnings:[],coverage:{...coverage,execution:'not-applicable',result:'not-consulted',expected:false}};
|
|
64
|
+
const collected=target.coverage.find(c=>c.collector==='image-retire' && c.capability==='inventory');
|
|
65
|
+
if(!collected || collected.policy!==POLICY)return {matches:[],warnings:[warning(Error('RetireJS image inventory is unavailable; reacquire image contents with --image-retire.'))],coverage:{...coverage,execution:'not-run',result:'indeterminate'}};
|
|
66
|
+
try{
|
|
67
|
+
const {repo,signaturesAt,refreshError}=await repository(options),matches=[],missing=[];
|
|
68
|
+
for(const dep of target.deps.filter(d=>d.installEvidence?.source==='retire' && !d.osPackageOwners?.length)){
|
|
69
|
+
if(!repo[dep.name]){missing.push(dep.name);continue;}
|
|
70
|
+
const raw=[{file:dep.artifactPath,results:retire.check(dep.name,dep.version,repo)}];
|
|
71
|
+
matches.push(...require('../retire').normaliseRetireResults(raw).map(m=>({...m,dep})));
|
|
72
|
+
}
|
|
73
|
+
const incomplete=collected.execution!=='completed'||missing.length>0||!!refreshError;
|
|
74
|
+
const warnings=[];
|
|
75
|
+
if(missing.length)warnings.push(warning(Error(`RetireJS no longer identifies: ${[...new Set(missing)].join(', ')}`),'advisories'));
|
|
76
|
+
if(refreshError)warnings.push(warning(Error(refreshError),'advisories'));
|
|
77
|
+
return {matches,warnings,coverage:{...coverage,signaturesAt,execution:incomplete?'partial':'completed',result:matches.length?'affected':incomplete?'indeterminate':'no-match'}};
|
|
78
|
+
}catch(error){return {matches:[],warnings:[warning(error,'advisories')],coverage:{...coverage,execution:'not-run',result:'indeterminate',reason:error.message}};}
|
|
79
|
+
}
|
|
80
|
+
module.exports={POLICY,EXCLUDED,collectImageJs,assessImageJs};
|
package/lib/artifacts/scan.js
CHANGED
|
@@ -4,7 +4,7 @@ const fs = require('node:fs');
|
|
|
4
4
|
const path = require('node:path');
|
|
5
5
|
const crypto = require('node:crypto');
|
|
6
6
|
const { makeDepRecord } = require('../dep-record');
|
|
7
|
-
const {IMAGE_COMPONENT_SCOPE,imageComponentRole} = require('./component-scope');
|
|
7
|
+
const {IMAGE_COMPONENT_SCOPE,imageComponentRole,imageComponentSource} = require('./component-scope');
|
|
8
8
|
const { openArtifact } = require('./index');
|
|
9
9
|
const { collectInstalledApplications } = require('./applications');
|
|
10
10
|
const { collectSystemInventory, assessSystemInventory, syncSystemAdvisories } = require('../system-inventory');
|
|
@@ -50,10 +50,11 @@ function systemDep(pkg, targetId, distribution) {
|
|
|
50
50
|
async function inventoryTarget(target, options = {}) {
|
|
51
51
|
const system = await collectSystemInventory(target.root, options);
|
|
52
52
|
const applications = await collectInstalledApplications(target.root, options);
|
|
53
|
+
const imageJs = options.imageRetire ? await require('./retire').collectImageJs(target.root,options,system.packages.flatMap(p=>p.ownedPaths || [])) : null;
|
|
53
54
|
const binaries = await require('../codecs/binary.codec').collect(target.root, { ...options, defaultExcludes: false, srcRoot: target.root });
|
|
54
55
|
const order = (a, b) => JSON.stringify([a.ecosystem, a.manager, a.namespace, a.name, a.version, a.architecture, a.manifestPath, a.manifestPaths]).localeCompare(JSON.stringify([b.ecosystem, b.manager, b.namespace, b.name, b.version, b.architecture, b.manifestPath, b.manifestPaths]));
|
|
55
56
|
const packages = portable(system.packages, target.root).map(p => ({ ...p, ...(p.ownedPaths ? { ownedPaths: [...p.ownedPaths].sort() } : {}) })).sort(order);
|
|
56
|
-
const appDeps = portable([...applications.deps.values(), ...binaries.deps.values()], target.root).sort(order);
|
|
57
|
+
const appDeps = portable([...applications.deps.values(), ...binaries.deps.values(), ...(imageJs?.deps || [])], target.root).sort(order);
|
|
57
58
|
const id = target.kind === 'rootfs' && target.metadata.format === 'directory'
|
|
58
59
|
? `rootfs-inventory:sha256:${sha(JSON.stringify({ distribution: system.distribution, packages, deps: appDeps }))}` : target.id;
|
|
59
60
|
const owners = new Map();
|
|
@@ -79,10 +80,11 @@ async function inventoryTarget(target, options = {}) {
|
|
|
79
80
|
const owned = evidence && !aggregate ? owners.get(pathKey(evidence)) : null;
|
|
80
81
|
return qualify(owned?.length ? { ...d, osPackageOwners: owned } : d, id);
|
|
81
82
|
})];
|
|
82
|
-
for(const dep of deps){dep.imageRole=imageComponentRole(dep);dep.scope=dep.imageRole==='transitive'?'transitive':'runtime';}
|
|
83
|
-
const warnings = portable(normalizeWarnings([...(system.warnings || []), ...applications.warnings, ...binaries.warnings,
|
|
83
|
+
for(const dep of deps){dep.imageRole=imageComponentRole(dep);dep.imageSource=imageComponentSource(dep);dep.scope=dep.imageRole==='transitive'?'transitive':'runtime';}
|
|
84
|
+
const warnings = portable(normalizeWarnings([...(system.warnings || []), ...applications.warnings, ...binaries.warnings, ...(imageJs?.warnings || []),
|
|
84
85
|
...(target.metadata.warnings || [])]), target.root);
|
|
85
86
|
const coverage = coverageRecords(system.coverage, id, 'inventory');
|
|
87
|
+
if(imageJs)coverage.push({...imageJs.coverage,artifactTargetId:id});
|
|
86
88
|
coverage.push({ artifactTargetId: id, capability: 'inventory', collector: 'installed-applications',
|
|
87
89
|
execution: applications.warnings.length ? 'partial' : 'completed', result: 'indeterminate', count: applications.deps.size });
|
|
88
90
|
coverage.push({ artifactTargetId: id, capability: 'inventory', collector: 'native-binaries',
|
|
@@ -166,7 +168,7 @@ async function acquireInventories(input, options = {}) {
|
|
|
166
168
|
if (cache) cache.put('image-inventory', cacheKey, createSnapshot(targets));
|
|
167
169
|
return targets;
|
|
168
170
|
};
|
|
169
|
-
if (cache && !options.forceUpdate && !require('../cache-policy').shouldForceUpdate()) {
|
|
171
|
+
if (cache && !options.imageRetire && !options.forceUpdate && !require('../cache-policy').shouldForceUpdate()) {
|
|
170
172
|
let targets;
|
|
171
173
|
try {
|
|
172
174
|
const saved = cache.get('image-inventory', cacheKey) || cache.get('image-inventory', legacyCacheKey);
|
|
@@ -175,7 +177,9 @@ async function acquireInventories(input, options = {}) {
|
|
|
175
177
|
const digest = targets?.[0]?.metadata?.acquisition?.indexDigest;
|
|
176
178
|
// Publisher SBOMs can be updated independently of the image digest.
|
|
177
179
|
const scoped = targets?.map(require('./inventory-scope').applyComponentScope);
|
|
178
|
-
|
|
180
|
+
// Older APK inventories discarded the maintainer needed to identify vendor NGINX.
|
|
181
|
+
const vendorMetadataComplete=scoped?.every(t=>(t.packages||[]).every(p=>p.manager!=='apk'||p.sourceName!=='nginx'||p.packageMetadata));
|
|
182
|
+
if (digest && vendorMetadataComplete && scoped.every(t => t.evidence === 'content-inventory' && t.metadata?.componentScope === require('./component-scope').IMAGE_COMPONENT_SCOPE && !t.warnings.some(w => w.reason === require('./inventory-scope').SCOPE_REASON) && t.metadata?.acquisition?.indexDigest === digest)) {
|
|
179
183
|
const current = ref.reference.includes(':') ? ref.reference : await require('../image-registry').fetchRegistryDigest(input,
|
|
180
184
|
{...options, fetcher:options.registryFetcher || options.fetcher, limits:options.registryLimits});
|
|
181
185
|
if (current === digest) return scoped.map(target => ({...target, evidence:'cached-inventory', originalEvidence:target.originalEvidence || target.evidence}));
|
|
@@ -184,7 +188,7 @@ async function acquireInventories(input, options = {}) {
|
|
|
184
188
|
let registry = null, opened = null, sbomAttempt = null;
|
|
185
189
|
try {
|
|
186
190
|
if (options.registry) {
|
|
187
|
-
if (options.preferSbom) {
|
|
191
|
+
if (options.preferSbom && !options.imageRetire) {
|
|
188
192
|
try {
|
|
189
193
|
const discovered = await require('../image-registry').fetchRegistrySboms(input, { ...options, fetcher: options.registryFetcher || options.fetcher, limits: options.registryLimits });
|
|
190
194
|
// Never drop image platforms when only a subset has publisher metadata.
|
|
@@ -239,7 +243,7 @@ async function assessInventories(targets, options = {}) {
|
|
|
239
243
|
}
|
|
240
244
|
const resolvedDeps = new Map(), cveMatches = [], warnings = [], artifacts = [], warmed = new Set();
|
|
241
245
|
const nativeDeps=new Map();
|
|
242
|
-
for(const target of targets)for(const dep of target.deps||[])if(dep.ecosystem!=='binary' && (!dep.osPackageOwners?.length || dep.binaryEvidence))nativeDeps.set(dep.coordKey,dep);
|
|
246
|
+
for(const target of targets)for(const dep of target.deps||[])if(dep.ecosystem!=='binary' && dep.installEvidence?.source!=='retire' && (!dep.osPackageOwners?.length || dep.binaryEvidence))nativeDeps.set(dep.coordKey,dep);
|
|
243
247
|
let native={matches:[],unknown:[],coverage:{status:'not-applicable'}},nativePreparation={sources:[],coverage:[],warnings:[]};
|
|
244
248
|
if(nativeDeps.size){
|
|
245
249
|
const nativeOptions={...options};
|
|
@@ -314,8 +318,12 @@ async function assessInventories(targets, options = {}) {
|
|
|
314
318
|
coverage.push(...coverageRecords(distribution.coverage,target.id,'advisories'));
|
|
315
319
|
targetWarnings.push(...normalizeWarnings(distribution.warnings,'advisories'));
|
|
316
320
|
for(const match of distribution.matches){const dep=systemDep(match.dep,target.id,target.distribution);cveMatches.push({...match,dep:resolvedDeps.get(dep.coordKey)||dep});}
|
|
321
|
+
const imageJsAssessment=await require('./retire').assessImageJs(target,options);
|
|
322
|
+
cveMatches.push(...imageJsAssessment.matches);
|
|
323
|
+
coverage.push(imageJsAssessment.coverage);
|
|
324
|
+
targetWarnings.push(...imageJsAssessment.warnings);
|
|
317
325
|
options.onArtifactProgress?.({stage:'Application advisories'});
|
|
318
|
-
const appDeps = new Map(target.deps.filter(d => d.ecosystem !== 'system' && d.ecosystem !== 'binary' && (!d.osPackageOwners?.length || !!d.binaryEvidence)).map(d => [d.coordKey, d]));
|
|
326
|
+
const appDeps = new Map(target.deps.filter(d => d.ecosystem !== 'system' && d.ecosystem !== 'binary' && d.installEvidence?.source !== 'retire' && (!d.osPackageOwners?.length || !!d.binaryEvidence)).map(d => [d.coordKey, d]));
|
|
319
327
|
if (appDeps.size && options.osv === false) {
|
|
320
328
|
coverage.push({ artifactTargetId: target.id, capability:'advisories',collector:'osv-application',execution:'not-applicable',result:'not-consulted',expected:false,reason:'OSV is excluded by source configuration.' });
|
|
321
329
|
} else if (appDeps.size) {
|
|
@@ -366,7 +374,7 @@ async function assessInventories(targets, options = {}) {
|
|
|
366
374
|
originalEvidence: target.originalEvidence, distribution: target.distribution, inventoryAt: target.inventoryAt,
|
|
367
375
|
componentCount: target.deps.length, coverage, advisoryObservations:distribution.observations, components: target.deps.map(d => ({ ecosystem: d.ecosystem, packageType: d.packageType,
|
|
368
376
|
namespace: d.namespace, name: d.name, version: d.version, sourceName:d.sourceName || null, sourceVersion:d.sourceVersion || null, packageOrigin:d.packageOrigin || null, architecture: d.architecture, artifactPath: d.artifactPath,
|
|
369
|
-
provenance: d.provenance, imageRole:d.imageRole || null, coordKey: d.coordKey, binaryEvidence:d.binaryEvidence, osPackageOwners: d.osPackageOwners || [],
|
|
377
|
+
provenance: d.provenance, imageRole:d.imageRole || null, imageSource:d.imageSource || imageComponentSource(d), installEvidence:d.installEvidence, manager:d.manager, coordKey: d.coordKey, binaryEvidence:d.binaryEvidence, osPackageOwners: d.osPackageOwners || [],
|
|
370
378
|
purl: require('../purl').purlFor(d) })) });
|
|
371
379
|
}
|
|
372
380
|
const combined=require('../merge-sources').mergeBySource(cveMatches,native.matches);
|
package/lib/cli-image.js
CHANGED
|
@@ -62,6 +62,8 @@ function makeCommand() {
|
|
|
62
62
|
.option('--allow-insecure-http', 'allow HTTP to the configured advisory proxy for this invocation')
|
|
63
63
|
.option('--registry', 'obtain input directly from an OCI registry; offline uses a prepared cached inventory')
|
|
64
64
|
.option('--platform <os/arch[/variant]>', 'select an image platform; otherwise inspect all available platforms')
|
|
65
|
+
.option('--no-image-retire', 'disable RetireJS inspection of image contents')
|
|
66
|
+
.option('--image-retire', 'scan bundled JavaScript in image contents with RetireJS (excludes package stores)', false)
|
|
65
67
|
.option('--prefer-sbom', 'prefer publisher SBOMs when associated with the selected images; signatures remain unverified')
|
|
66
68
|
.option('--registry-auth <file>', 'JSON credentials {username,password,token,authOrigins}; never invokes credential helpers')
|
|
67
69
|
.option('--insecure', 'allow HTTP registry endpoints explicitly')
|
|
@@ -156,6 +158,9 @@ async function run(args, injected = {}) {
|
|
|
156
158
|
}
|
|
157
159
|
if (opts.exportInventory) await writeSnapshot(opts.exportInventory, targets);
|
|
158
160
|
const result = await assessInventories(targets, options);
|
|
161
|
+
result.warnings.push(...require('./image-references').unpinnedImageWarnings([
|
|
162
|
+
...imageReferences,...(options.registry?[{reference:input}]:[]),
|
|
163
|
+
]));
|
|
159
164
|
if (opts.prepareCache) {
|
|
160
165
|
const gaps = incompleteCapabilities(result, ['advisories', 'sources']);
|
|
161
166
|
if (gaps.length) console.warn('⚠ Prepared cache has incomplete advisory or source coverage; review the scan notices.');
|
package/lib/cve-report.js
CHANGED
|
@@ -1092,6 +1092,17 @@ function formatCwesVerbose(cwes) {
|
|
|
1092
1092
|
}).join("")}</ul>`;
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
|
+
let detailPool = null;
|
|
1096
|
+
function sharedDetailPanel(m, opts) {
|
|
1097
|
+
const html = renderDetailPanel(m, opts);
|
|
1098
|
+
if (!detailPool) return html;
|
|
1099
|
+
const existing = detailPool.get(html);
|
|
1100
|
+
if (existing) return `<div data-detail-ref="${existing}"><a href="#${existing}">${esc(m.cve.id)}</a></div>`;
|
|
1101
|
+
const id = `shared-cve-detail-${detailPool.size + 1}`;
|
|
1102
|
+
detailPool.set(html, id);
|
|
1103
|
+
return `<div id="${id}">${html}</div>`;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1095
1106
|
function renderCveRow(m, opts = {}) {
|
|
1096
1107
|
const { withAction } = opts;
|
|
1097
1108
|
const advisoryId = String(m.cve.id || "");
|
|
@@ -1122,7 +1133,7 @@ function renderCveRow(m, opts = {}) {
|
|
|
1122
1133
|
<td>${source}</td>
|
|
1123
1134
|
${actionCell}
|
|
1124
1135
|
</tr>
|
|
1125
|
-
<tr class="detail-row"><td colspan="${colspan}">${
|
|
1136
|
+
<tr class="detail-row"><td colspan="${colspan}">${sharedDetailPanel(m, opts)}</td></tr>`;
|
|
1126
1137
|
}
|
|
1127
1138
|
|
|
1128
1139
|
function renderActionCell(m) {
|
|
@@ -2010,6 +2021,7 @@ function numberedSubsections(chapter, entries) {
|
|
|
2010
2021
|
}
|
|
2011
2022
|
|
|
2012
2023
|
const WARNING_HEADINGS = {
|
|
2024
|
+
"image-unpinned": { icon: "⚠️", title: "Image references without a digest" },
|
|
2013
2025
|
"cve-enrichment-summary": { icon: "ℹ️", title: "CVE records" },
|
|
2014
2026
|
"image-scan-failed": { icon: "⚠️", title: "Image analysis blocked" },
|
|
2015
2027
|
"image-source-unavailable": { icon: "⚠️", title: "Unavailable from public sources" },
|
|
@@ -2345,6 +2357,7 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2345
2357
|
}
|
|
2346
2358
|
|
|
2347
2359
|
function warningMessage(w) {
|
|
2360
|
+
if (w.type === "image-unpinned") return esc(t(require('./image-references').UNPINNED_IMAGE_MESSAGE));
|
|
2348
2361
|
if (w.type === "image-source-unavailable") return esc(t("Some images or their advisory data are unavailable from public sources. See the affected images and reasons below."));
|
|
2349
2362
|
if (w.type === "cve-enrichment-summary") return esc(require('./cve-record-coverage').formatCveRecordWarning(w, RENDER_CTX.locale));
|
|
2350
2363
|
if (w.type === "commercial-build") {
|
|
@@ -3507,10 +3520,20 @@ function browserI18nScript() {
|
|
|
3507
3520
|
function generateHtmlReport(payload) {
|
|
3508
3521
|
// The body is built FIRST: buildBody is what declares the report's language, and the
|
|
3509
3522
|
// <title> and the lang attribute both need it to be set already.
|
|
3510
|
-
|
|
3523
|
+
let body;
|
|
3524
|
+
// Share only byte-identical panels: applicability, paths, fixes and image
|
|
3525
|
+
// identity must all agree. The browser restores them before copy/print hooks.
|
|
3526
|
+
detailPool = new Map();
|
|
3527
|
+
try { body = injectColgroups(buildBody(payload)); }
|
|
3528
|
+
finally { detailPool = null; }
|
|
3511
3529
|
return `<!doctype html>
|
|
3512
3530
|
<html lang="${esc(RENDER_CTX.locale)}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${t("VigieVuln Report")}</title><style>${CSS}</style></head>
|
|
3513
|
-
<body>${body}
|
|
3531
|
+
<body>${body}<script>
|
|
3532
|
+
document.querySelectorAll('[data-detail-ref]').forEach(function(panel) {
|
|
3533
|
+
var source = document.getElementById(panel.getAttribute('data-detail-ref'));
|
|
3534
|
+
if (source) panel.innerHTML = source.innerHTML;
|
|
3535
|
+
});
|
|
3536
|
+
</script>${browserI18nScript()}${TOGGLE_SCRIPT}${COPY_SCRIPT}${CHART_COPY_SCRIPT}<script>
|
|
3514
3537
|
(${localizeReportTimes.toString()})();
|
|
3515
3538
|
</script></body></html>`;
|
|
3516
3539
|
}
|
package/lib/i18n.js
CHANGED
|
@@ -466,6 +466,8 @@ const fr = {
|
|
|
466
466
|
"Scanned dependency descriptors": "Descripteurs de dépendances analysés",
|
|
467
467
|
"Ignored directories": "Répertoires ignorés",
|
|
468
468
|
"Methodology, data sources & limitations": "Méthodologie, sources de données et limites",
|
|
469
|
+
"Image references without a digest": "Références d’images sans digest",
|
|
470
|
+
"Image references without a digest use mutable tags, including version tags and implicit latest. Their content can change between the scan, build and deployment. Pin each reference with @sha256:<digest>; the digest observed during a scan does not pin the declaration.": "Les références d’images sans digest utilisent des tags modifiables, y compris les tags de version et latest implicite. Leur contenu peut changer entre le scan, la construction et le déploiement. Fixez chaque référence avec @sha256:<digest> ; le digest observé pendant un scan ne fixe pas la déclaration.",
|
|
469
471
|
"Image analysis blocked": "Analyse d’image bloquée",
|
|
470
472
|
"Warnings & scan-completeness": "Avertissements et complétude du scan",
|
|
471
473
|
"Cached source data used; dates indicate the saved response and may need refreshing.": "Données de sources en cache utilisées ; les dates indiquent les réponses conservées, qui peuvent nécessiter une actualisation.",
|
package/lib/image-references.js
CHANGED
|
@@ -200,4 +200,24 @@ function referenceWarnings(references) {
|
|
|
200
200
|
(reference.role === 'base' ? ' A Dockerfile base is not evidence of the final built image.' : '') }));
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
// Pinning is a property of the declaration, never of the digest resolved during
|
|
204
|
+
// a scan. Even numeric version tags can be reassigned by a registry publisher.
|
|
205
|
+
const UNPINNED_IMAGE_MESSAGE='Image references without a digest use mutable tags, including version tags and implicit latest. Their content can change between the scan, build and deployment. Pin each reference with @sha256:<digest>; the digest observed during a scan does not pin the declaration.';
|
|
206
|
+
function unpinnedImageWarnings(references=[]) {
|
|
207
|
+
const items=[],seen=new Set();
|
|
208
|
+
for(const ref of references){
|
|
209
|
+
if(ref.localBuild || ref.classification==='local-build' || !ref.reference)continue;
|
|
210
|
+
// Invalid or unresolved references cannot establish whether a pin is valid.
|
|
211
|
+
let parsed;try{parsed=require('./image-registry').parseReference(ref.reference);}catch{continue;}
|
|
212
|
+
if(parsed.reference.includes(':'))continue;
|
|
213
|
+
const key=JSON.stringify([ref.reference,ref.path,ref.line,ref.location]);if(seen.has(key))continue;seen.add(key);
|
|
214
|
+
const location=ref.path ? `${ref.path}${ref.line?':'+ref.line:''}${ref.location?' ('+ref.location+')':''}` : null;
|
|
215
|
+
items.push({id:ref.reference,reference:ref.reference,declared:ref.declared||ref.reference,
|
|
216
|
+
...(ref.path?{manifestPaths:[ref.path]}:{}),...(ref.line?{line:ref.line}:{}),...(ref.location?{location:ref.location}:{}),
|
|
217
|
+
...(location?{detail:location}:{})});
|
|
218
|
+
}
|
|
219
|
+
return items.length ? [{type:'image-unpinned',reason:'mutable-image-reference',severity:'warning',affectsCompleteness:false,
|
|
220
|
+
count:items.length,items,message:UNPINNED_IMAGE_MESSAGE,_groupedDiagnostics:true}] : [];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
module.exports = { unpinnedImageWarnings, UNPINNED_IMAGE_MESSAGE, discoverImageReferences, referenceWarnings, bindImageDefinitions, dockerfileReferences, yamlReferences, resolveVariables, classifyImageReference, DEFAULT_EXTRACTORS };
|
package/lib/json-export.js
CHANGED
|
@@ -86,7 +86,7 @@ function depBrief(dep) {
|
|
|
86
86
|
installEvidence: dep.installEvidence || null,
|
|
87
87
|
sbomEvidence: dep.sbomEvidence || null,
|
|
88
88
|
artifactTargetId: dep.artifactTargetId || null,
|
|
89
|
-
...(dep.artifactTargetId ? {imageRole:dep.imageRole || null} : {}),
|
|
89
|
+
...(dep.artifactTargetId ? {imageRole:dep.imageRole || null,imageSource:require('./artifacts/component-scope').imageComponentSource(dep)} : {}),
|
|
90
90
|
artifactPath: dep.artifactPath || null,
|
|
91
91
|
packageType: dep.packageType || null,
|
|
92
92
|
manager: dep.manager || null,
|
|
@@ -290,7 +290,7 @@ function buildFindings(payload = {}) {
|
|
|
290
290
|
|
|
291
291
|
function writeFindings(payload, outputPath) {
|
|
292
292
|
const doc = buildFindings(payload);
|
|
293
|
-
fs.writeFileSync(outputPath, JSON.stringify(doc
|
|
293
|
+
fs.writeFileSync(outputPath, JSON.stringify(doc) + "\n");
|
|
294
294
|
return doc;
|
|
295
295
|
}
|
|
296
296
|
|
package/lib/report-notices.js
CHANGED
|
@@ -23,7 +23,7 @@ function partitionReportNotices(values=[]){
|
|
|
23
23
|
// identified by their explicit image identity or image-specific type.
|
|
24
24
|
function warningScope(item) {
|
|
25
25
|
if(item?.type==='cve-enrichment-summary')return 'global';
|
|
26
|
-
if(item?.artifactTargetId || item?.artifactTargetIds?.length || item?.type==='image-source-unavailable' || item?.type==='image-scan-failed')return 'image';
|
|
26
|
+
if(item?.artifactTargetId || item?.artifactTargetIds?.length || item?.type==='image-unpinned' || item?.type==='image-source-unavailable' || item?.type==='image-scan-failed')return 'image';
|
|
27
27
|
return 'project';
|
|
28
28
|
}
|
|
29
29
|
// Group causes for presentation, retaining every distinct location and detail.
|
package/lib/retire.js
CHANGED
|
@@ -77,11 +77,11 @@ function writeCache(srcDir, body) {
|
|
|
77
77
|
{ _schema: RETIRE_CACHE_SCHEMA, _fetchedAt: Date.now(), body });
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
function cachedSignatureEntry(){
|
|
81
|
-
try{return require('./cache-repository').createCacheRepository(path.dirname(RETIRE_SIG_DIR)).get('auxiliary','retire-signatures')||null}
|
|
80
|
+
function cachedSignatureEntry(cacheDir){
|
|
81
|
+
try{return require('./cache-repository').createCacheRepository(cacheDir || path.dirname(RETIRE_SIG_DIR)).get('auxiliary','retire-signatures')||null}
|
|
82
82
|
catch{return null}
|
|
83
83
|
}
|
|
84
|
-
function cachedSignatures(){return cachedSignatureEntry()?.value || null}
|
|
84
|
+
function cachedSignatures(cacheDir){return cachedSignatureEntry(cacheDir)?.value || null}
|
|
85
85
|
|
|
86
86
|
function findRetireBin() {
|
|
87
87
|
const local = path.join(__dirname, "..", "node_modules", ".bin", "retire");
|
|
@@ -134,11 +134,11 @@ function findRetireLauncher() {
|
|
|
134
134
|
*/
|
|
135
135
|
async function warmRetireSignatures(opts = {}) {
|
|
136
136
|
const { verbose, force, offline } = opts;
|
|
137
|
-
const present = !!cachedSignatures();
|
|
137
|
+
const present = !!cachedSignatures(opts.cacheDir);
|
|
138
138
|
if (offline) return present ? { ok: true, cached: true }
|
|
139
139
|
: { ok: false, error: "offline: no local retire signatures" };
|
|
140
140
|
const hostedOnline = require("./providers").hasHostedProxy();
|
|
141
|
-
if (!force && !hostedOnline && present && require('./cache-policy').fresh(cachedSignatureEntry()?.fetchedAt)) {
|
|
141
|
+
if (!force && !hostedOnline && present && require('./cache-policy').fresh(cachedSignatureEntry(opts.cacheDir)?.fetchedAt)) {
|
|
142
142
|
if (verbose) console.log(`retire: signatures already present (${RETIRE_SIG_FILE})`);
|
|
143
143
|
return { ok: true, cached: true };
|
|
144
144
|
}
|
|
@@ -149,7 +149,7 @@ async function warmRetireSignatures(opts = {}) {
|
|
|
149
149
|
const text = await res.text();
|
|
150
150
|
const repo = JSON.parse(text);
|
|
151
151
|
if (!repo || typeof repo !== "object" || Array.isArray(repo)) throw new Error("invalid retire signatures");
|
|
152
|
-
require('./cache-repository').createCacheRepository(path.dirname(RETIRE_SIG_DIR)).put('auxiliary','retire-signatures',text);
|
|
152
|
+
require('./cache-repository').createCacheRepository(opts.cacheDir || path.dirname(RETIRE_SIG_DIR)).put('auxiliary','retire-signatures',text);
|
|
153
153
|
if (verbose) console.log('retire: signatures warmed into SQLite cache');
|
|
154
154
|
return { ok: true };
|
|
155
155
|
} catch (e) {
|
|
@@ -160,10 +160,11 @@ async function warmRetireSignatures(opts = {}) {
|
|
|
160
160
|
|
|
161
161
|
// Hosted online: always consult the proxy (including its stale/source-health signal).
|
|
162
162
|
// Offline: only report local availability, even with --force and a configured proxy.
|
|
163
|
-
async function ensureSignatures(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
async function ensureSignatures(opts = {}) {
|
|
164
|
+
const { offline } = opts;
|
|
165
|
+
if (offline) return !!cachedSignatures(opts.cacheDir);
|
|
166
|
+
const r = await warmRetireSignatures(opts);
|
|
167
|
+
return !!r.ok || (!require('./providers').hasHostedProxy() && !!cachedSignatures(opts.cacheDir));
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
// Directories retire never needs to walk. Mirrors the per-walker default SKIP sets
|
|
@@ -524,6 +525,7 @@ module.exports = {
|
|
|
524
525
|
findRetireLauncher,
|
|
525
526
|
chooseRetireLauncher,
|
|
526
527
|
warmRetireSignatures,
|
|
528
|
+
cachedSignatureEntry,
|
|
527
529
|
ensureSignatures,
|
|
528
530
|
buildRetireArgs,
|
|
529
531
|
buildRetireIgnorePatterns,
|
package/lib/source-image-scan.js
CHANGED
|
@@ -13,6 +13,7 @@ function eligible(ref){return ref?.scanEligible!==false && (!ref?.classification
|
|
|
13
13
|
async function scanSourceImages(input,options={}){
|
|
14
14
|
const references=(input||[]).map(ref=>({...ref,boundArtifactIds:[]})),warnings=[],notices=[],empty={artifacts:[],matches:[],resolvedDeps:new Map(),warnings,notices,references};
|
|
15
15
|
if(options.images===false)return empty;
|
|
16
|
+
warnings.push(...require('./image-references').unpinnedImageWarnings(references));
|
|
16
17
|
const groups=new Map();
|
|
17
18
|
for(const ref of references){
|
|
18
19
|
if(!eligible(ref)){ref.scanStatus='not-scannable';ref.imageScan={status:'not-scannable',reasonCode:ref.classification||'unresolved',message:ref.blockReason||'The image declaration cannot be resolved to a registry image.',artifactIds:[]};continue;}
|
|
@@ -53,7 +53,7 @@ const apk={id:'apk', async collect(root,opts={}) {
|
|
|
53
53
|
if(!stanza.trim())continue;const f=fields(stanza); if(!f.P || !f.V){warnings.push('Malformed APK installed record');continue;}
|
|
54
54
|
let dir='';const ownedPaths=[];
|
|
55
55
|
for(const line of stanza.split(/\r?\n/)){if(line.startsWith('F:'))dir=line.slice(2);else if(line.startsWith('R:')){const name=line.slice(2),fp='/'+[dir,name].filter(Boolean).join('/');if(!fp.split('/').includes('..'))ownedPaths.push(fp);}}
|
|
56
|
-
packages.push(base(f.P,f.V,f.A,'apk',p,{sourceName:f.o || f.P,sourceVersion:f.V,ownedPaths}));
|
|
56
|
+
packages.push(base(f.P,f.V,f.A,'apk',p,{sourceName:f.o || f.P,sourceVersion:f.V,ownedPaths,packageMetadata:{maintainer:f.m||null,homepage:f.U||null}}));
|
|
57
57
|
}
|
|
58
58
|
return {packages,coverage:{collector:'apk',status:warnings.length?'incomplete':'complete',count:packages.length},warnings};
|
|
59
59
|
}};
|
|
@@ -3,7 +3,7 @@ const {createCacheRepository}=require('../cache-repository');
|
|
|
3
3
|
// Each adapter owns its scope, comparisons and evidence. Failed consultations
|
|
4
4
|
// never prevent the independent adapters or OSV from returning their results.
|
|
5
5
|
const adapters=[
|
|
6
|
-
{id:'nginx-vendor-advisories',supports:(d,inventory)=>inventory?.packages?.some(
|
|
6
|
+
{id:'nginx-vendor-advisories',supports:(d,inventory)=>inventory?.packages?.some(require('./nginx-advisories').isNginxPackage),identifyPackageOrigin:(pkg,options)=>require('./nginx-advisories').nginxPackageOrigin(pkg,options),async assess(inventory,options){return require('./nginx-advisories').assessNginxAdvisories(inventory.packages,options);}},
|
|
7
7
|
{id:'debian-security-tracker-history',supports:d=>d?.id==='debian',async assess(inventory,options){
|
|
8
8
|
const source=require('./historical-debian');
|
|
9
9
|
try{source.checkDistribution(inventory.distribution);}catch{return {matches:[],observations:[],warnings:[],coverage:[{source:this.id,execution:'not-applicable',result:'indeterminate',reason:'Exact Debian release codename is unavailable.'}]};}
|
|
@@ -4,19 +4,36 @@
|
|
|
4
4
|
const crypto=require('node:crypto');
|
|
5
5
|
const {createCacheRepository}=require('../cache-repository');
|
|
6
6
|
const {getCacheDir}=require('../cache-directory');
|
|
7
|
+
const PARSER_VERSION=2;
|
|
7
8
|
const SOURCE='nginx-vendor-advisories',URL='https://raw.githubusercontent.com/nginx/nginx.org/master/xml/en/security_advisories.xml',PAGE='https://nginx.org/en/security_advisories.html';
|
|
8
9
|
function ver(s){const m=/^(\d+)\.(\d+)\.(\d+)$/.exec(String(s));return m?m.slice(1).map(Number):null;}
|
|
9
10
|
function cmp(a,b){for(let i=0;i<3;i++)if(a[i]!==b[i])return a[i]-b[i];return 0;}
|
|
10
11
|
function inRange(version,text){const v=ver(version);if(!v)return null;const pieces=String(text||'').split(',').map(s=>s.trim());let unknown=false;for(const piece of pieces){if(piece==='all')return true;const m=/^(\d+\.\d+\.\d+)(?:-(\d+\.\d+\.\d+))?$/.exec(piece);if(!m){unknown=true;continue;}const low=ver(m[1]),high=ver(m[2]||m[1]);if(cmp(v,low)>=0&&cmp(v,high)<=0)return true;}return unknown?null:false;}
|
|
11
|
-
function
|
|
12
|
+
function isNginxPackage(p){return ['dpkg','apk'].includes(p?.manager)&&p.sourceName==='nginx';}
|
|
13
|
+
function fixedInBranch(version,text){
|
|
14
|
+
const current=ver(version);if(!current)return false;
|
|
15
|
+
// Stable fixes are exceptions to the broad vulnerable range, not fixes for
|
|
16
|
+
// a later mainline branch (e.g. 1.30.7 does not fix 1.31.8).
|
|
17
|
+
return String(text||'').split(',').some(piece=>{
|
|
18
|
+
const match=/^(\d+\.\d+\.\d+)\+$/.exec(piece.trim()),fixed=match&&ver(match[1]);
|
|
19
|
+
return fixed&&fixed[0]===current[0]&&fixed[1]===current[1]&&cmp(current,fixed)>=0;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function vendor(p,domains){
|
|
23
|
+
const meta=p.packageMetadata||{},origin=String(meta.origin||'').trim().toLowerCase(),maintainer=String(meta.maintainer||'');
|
|
24
|
+
const email=/<[^<>@\s]+@([^<>\s]+)>\s*$/.exec(maintainer)?.[1]?.toLowerCase();
|
|
25
|
+
// APK origin is a source package name, unlike the dpkg vendor Origin field.
|
|
26
|
+
const vendorOrigin=p.manager==='dpkg'&&(origin==='nginx'||origin==='nginx, inc.');
|
|
27
|
+
return vendorOrigin||!!email&&domains.includes(email)?{status:'third-party',source:vendorOrigin?'dpkg-origin':`${p.manager}-maintainer`,declared:vendorOrigin?meta.origin:meta.maintainer,signatureVerified:false}:null;
|
|
28
|
+
}
|
|
12
29
|
async function parseNginxAdvisories(input,{maxBytes=4*1024*1024}={}){
|
|
13
30
|
const bytes=Buffer.isBuffer(input)?input:Buffer.from(String(input));if(!bytes.length||bytes.length>maxBytes)throw Error('NGINX advisory XML exceeds size limit or is empty');let text=bytes.toString('utf8');
|
|
14
31
|
if(/<!ENTITY\b/i.test(text)||/<!DOCTYPE\s+[^>]*\[/i.test(text))throw Error('NGINX advisory XML contains entity declarations');
|
|
15
32
|
text=text.replace(/<!DOCTYPE\s+article\s+SYSTEM\s+["']\.\.\/\.\.\/dtd\/article\.dtd["']\s*>/i,'');if(/<!DOCTYPE\b/i.test(text))throw Error('unsupported NGINX XML doctype');
|
|
16
33
|
const doc=await require('xml2js').parseStringPromise(text,{strict:true}),sections=doc?.article?.section;if(!Array.isArray(sections))throw Error('invalid NGINX advisory XML');
|
|
17
34
|
const items=sections.flatMap(s=>s.security||[]).flatMap(s=>s.item||[]);if(!items.length)throw Error('NGINX advisory XML has no records');
|
|
18
|
-
const records=[];for(const item of items){const a=item.$||{},
|
|
19
|
-
if(!records.length)throw Error('NGINX advisory XML has no identified records');return {records,sha256:crypto.createHash('sha256').update(bytes).digest('hex')};
|
|
35
|
+
const records=[];for(const item of items){const a=item.$||{},cve=/^(?:CVE-)?(\d{4}-\d{4,})$/.exec(a.cve||''),id=cve?`CVE-${cve[1]}`:null;if(!id)continue;if(typeof a.name!=='string'||typeof a.vulnerable!=='string')throw Error('invalid NGINX advisory record');records.push({id,title:a.name,severity:a.severity||null,vulnerable:a.vulnerable,good:a.good||null,sourceDetails:{attributes:a,content:Object.fromEntries(Object.entries(item).filter(([key])=>key!=='$'))},advisory:typeof a.advisory==='string'&&/^https:\/\//.test(a.advisory)?a.advisory:PAGE});}
|
|
36
|
+
if(!records.length)throw Error('NGINX advisory XML has no identified records');return {records,parserVersion:PARSER_VERSION,sha256:crypto.createHash('sha256').update(bytes).digest('hex')};
|
|
20
37
|
}
|
|
21
38
|
async function syncNginxAdvisories(options={}){
|
|
22
39
|
if(options.offline)throw Error('cannot refresh NGINX advisories offline');const timeout=AbortSignal.timeout(options.timeoutMs??30000),signal=options.signal?AbortSignal.any([options.signal,timeout]):timeout;const res=await require('../providers').getResource('nginx','advisories',{}, {fetcher:options.fetcher,signal,streaming:true,noStore:true});if(!res.ok){await res.body?.cancel();throw Error(`NGINX advisory HTTP ${res.status}`);}let size=0,chunks=[];for await(const chunk of res.body){size+=chunk.length;if(size>(options.maxBytes??4*1024*1024))throw Error('NGINX advisory XML exceeds size limit');chunks.push(Buffer.from(chunk));}const parsed=await parseNginxAdvisories(Buffer.concat(chunks),options),now=Date.now(),stamp=Date.parse(res.headers.get('x-fad-proxy-fetched-at')||''),proxy=require('../providers').hasProxyRoute(),valid=Number.isFinite(stamp)&&stamp>0&&stamp<=now;
|
|
@@ -24,16 +41,17 @@ async function syncNginxAdvisories(options={}){
|
|
|
24
41
|
}
|
|
25
42
|
async function assessNginxAdvisories(packages,options={}){
|
|
26
43
|
const matches=[],observations=[],warnings=[],repo=options.cacheRepository||createCacheRepository(options.cacheDir||getCacheDir()),domains=options.allowedMaintainerDomains||['nginx.org','nginx.com','f5.com'];if(!Array.isArray(domains)||domains.some(d=>typeof d!=='string'||!/^[a-z0-9.-]+$/.test(d)))throw Error('invalid NGINX maintainer domains');
|
|
27
|
-
const candidates=(packages||[]).filter(
|
|
44
|
+
const candidates=(packages||[]).filter(isNginxPackage),cached=repo.get('catalogue','nginx-advisories')?.value,ttl=options.ttlMs??86400000;if(!Number.isSafeInteger(ttl)||ttl<=0)throw Error('invalid NGINX advisory TTL');let snapshot=Array.isArray(cached?.records)&&/^[a-f0-9]{64}$/.test(cached.sha256||'')&&Number.isFinite(cached.observedAt)?cached:null;
|
|
28
45
|
if(!candidates.length)return {matches,observations,coverage:[{source:SOURCE,execution:'not-applicable',result:'not-applicable'}],warnings};
|
|
29
|
-
if(!options.offline&&(!snapshot||snapshot.stale||Date.now()-snapshot.observedAt>=ttl||Date.now()<snapshot.observedAt)){try{snapshot=await syncNginxAdvisories(options);}catch(error){warnings.push({type:'source-unavailable',source:SOURCE,message:`NGINX advisories: ${error.message}`});}}
|
|
46
|
+
if(!options.offline&&(!snapshot||snapshot.parserVersion!==PARSER_VERSION||snapshot.stale||Date.now()-snapshot.observedAt>=ttl||Date.now()<snapshot.observedAt)){try{snapshot=await syncNginxAdvisories(options);}catch(error){warnings.push({type:'source-unavailable',source:SOURCE,message:`NGINX advisories: ${error.message}`});}}
|
|
30
47
|
if(!snapshot){if(options.offline)warnings.push({type:'source-unavailable',source:SOURCE,message:'NGINX vendor advisory snapshot is not cached.'});return {matches,observations,coverage:[{source:SOURCE,execution:'partial',result:'indeterminate',reason:'NGINX vendor advisory snapshot unavailable.'}],warnings};}
|
|
31
|
-
|
|
48
|
+
if(snapshot.parserVersion!==PARSER_VERSION)warnings.push({type:'source-unavailable',source:SOURCE,message:'Cached NGINX advisories use an older parser; refresh the catalogue online to restore complete advisory parsing.'});
|
|
49
|
+
for(const p of candidates){const identity=p.packageOrigin?.status==='ambiguous'?null:vendor(p,domains),upstream=/^(\d+\.\d+\.\d+)(?:-[A-Za-z0-9.+~]+)?$/.exec(p.sourceVersion||'')?.[1];for(const record of snapshot.records){const affected=inRange(upstream,record.vulnerable);if(affected===false||fixedInBranch(upstream,record.good))continue;const evidence={sourceURL:URL,sha256:snapshot.sha256,observedAt:snapshot.observedAt,advisoryURL:record.advisory,upstreamVersion:upstream||null,versionRange:record.vulnerable,fixedVersions:record.good,vendorSeverity:record.severity,packageOrigin:identity,signatureVerified:false,configurationApplicability:'unknown',sourceDetails:record.sourceDetails||null};
|
|
32
50
|
if(!identity||affected===null){observations.push({dep:p,cveId:record.id,status:'unknown',reason:!identity?'Vendor package origin is not established.':'Upstream version range cannot be evaluated.',evidence});continue;}
|
|
33
51
|
const current=ver(upstream),fix=(record.good||'').split(',').map(s=>s.trim()).map(s=>/^(\d+\.\d+\.\d+)\+$/.exec(s)?.[1]).filter(Boolean).filter(s=>{const v=ver(s);return v[0]===current[0]&&v[1]===current[1]&&cmp(v,current)>0;}).sort((a,b)=>cmp(ver(a),ver(b)))[0]||null;
|
|
34
52
|
matches.push({dep:{...p,packageOrigin:identity},source:SOURCE,advisoryId:record.id,cve:{id:record.id,summary:record.title,description:record.title,severity:'UNKNOWN',fixVersion:fix,advisorySource:record.advisory,vendorEvidence:evidence}});
|
|
35
53
|
}}
|
|
36
54
|
return {matches,observations,coverage:[{source:SOURCE,execution:snapshot.stale||warnings.length?'partial':'completed',result:'consulted',scope:'upstream-nginx-version',fetchedAt:snapshot.observedAt,sha256:snapshot.sha256,reason:'Version applicability is assessed from vendor declarations; runtime configuration and package signature remain unverified.'}],warnings};
|
|
37
55
|
}
|
|
38
|
-
function nginxPackageOrigin(pkg,options={}){if(pkg
|
|
39
|
-
module.exports={SOURCE,URL,nginxPackageOrigin,parseNginxAdvisories,syncNginxAdvisories,assessNginxAdvisories};
|
|
56
|
+
function nginxPackageOrigin(pkg,options={}){if(!isNginxPackage(pkg))return null;return vendor(pkg,options.allowedMaintainerDomains||['nginx.org','nginx.com','f5.com']);}
|
|
57
|
+
module.exports={SOURCE,URL,isNginxPackage,nginxPackageOrigin,parseNginxAdvisories,syncNginxAdvisories,assessNginxAdvisories};
|
package/package.json
CHANGED
package/vigievuln.js
CHANGED
|
@@ -587,6 +587,8 @@ program
|
|
|
587
587
|
.option("--no-go", "skip the Go codec")
|
|
588
588
|
.option("--no-ruby", "skip the Ruby (Bundler) codec")
|
|
589
589
|
.option("--no-binaries", "skip scanning committed native binaries (.dll/.exe/.so/.dylib)")
|
|
590
|
+
.option("--no-image-retire", "disable RetireJS inspection of image contents")
|
|
591
|
+
.option("--image-retire", "scan bundled JavaScript in image contents with RetireJS (excludes package stores)", false)
|
|
590
592
|
.option("--images", "enable image analysis in source-tree scans (off by default)", false)
|
|
591
593
|
.option("--no-images", "skip image declaration discovery and image analysis in source-tree scans")
|
|
592
594
|
.option("--image-platform <os/arch[/variant]>", "image platform when no platform is declared", "linux/amd64")
|
|
@@ -621,7 +623,7 @@ if (!process.argv.includes("--help-all")) {
|
|
|
621
623
|
const { foldedFlags } = require("./lib/cli-groups");
|
|
622
624
|
const { ADMIN_FLAGS, REPORTS } = require("./lib/cli-groups");
|
|
623
625
|
const folded = new Set([...foldedFlags(), ...ADMIN_FLAGS, ...REPORTS.map(r => `--report-${r}`),
|
|
624
|
-
"--images", "--image-platform", "--reuse-stable-advisories", "--no-reuse-stable-advisories", "--stable-advisory-age-days", "--proxy-rate-limit-wait-ms",
|
|
626
|
+
"--images", "--image-retire", "--no-image-retire", "--image-platform", "--reuse-stable-advisories", "--no-reuse-stable-advisories", "--stable-advisory-age-days", "--proxy-rate-limit-wait-ms",
|
|
625
627
|
"--source", "--list-app-plugins", "--scan-context", "--private-component", "--public-component", "--wordfence-live", "--wordfence-feed", "--drupal-advisories", "--wordfence-feed-url", "--drupal-advisories-live", "--prestashop-advisories", "--prestashop-advisories-live", "--typo3-advisories", "--typo3-advisories-live", "--spip-advisories", "--spip-advisories-live", "--wp-checksums", "--wp-checksums-live", "--wp-checksums-locale", "--max-advisory-age", "--fail-on-incomplete", "--proxy-cache-token", "--advisory-query-ttl", "--prepare-offline", "--output"]);
|
|
626
628
|
for (const opt of program.options) if (folded.has(opt.long)) opt.hidden = true;
|
|
627
629
|
} else {
|