pnpm audit
Vérifie les problèmes de sécurité connus avec les paquets installés.
If security issues are found, try to update your dependencies via pnpm update.
If a simple update does not fix all the issues, use overrides to force
versions that are not vulnerable. For instance, if lodash@<2.1.0 is vulnerable,
use this overrides to force lodash@^2.1.0:
overrides:
"lodash@<2.1.0": "^2.1.0"
Or alternatively, run pnpm audit --fix.
If you want to tolerate some vulnerabilities as they don't affect your project, you may use the auditConfig.ignoreCves setting.
Options#
--audit-level <severity>#
- Type: low, moderate, high, critical
- Default: low
Only print advisories with severity greater than or equal to <severity>.
This can also be set via auditLevel in pnpm-workspace.yaml.
--fix#
Add overrides to the package.json file in order to force non-vulnerable versions of the dependencies.
--json#
Générer le rapport d'audit au format JSON.
--dev, -D#
Audite uniquement les dépendances de dev.
--prod, -P#
Audite uniquement les dépendances de production.
--no-optional#
Don't audit optionalDependencies.
--ignore-registry-errors#
Si le registre répond avec un code d'état non-200, le processus doit sortir avec 0. Le processus n'échouera donc que si le registre répond effectivement avec succès aux vulnérabilités trouvées.
--ignore-unfixable#
Added in: v10.11.0
Ignore all CVEs with no resolution.
--ignore <vulnerability>#
Added in: v10.11.0
Ignore a vulnerability by CVE.
Configuration#
auditConfig#
auditConfig.ignoreCves#
A list of CVE IDs that will be ignored by the pnpm audit command.
auditConfig:
ignoreCves:
- CVE-2022-36313
auditConfig.ignoreGhsas#
A list of GHSA Codes that will be ignored by the pnpm audit command.
auditConfig:
ignoreGhsas:
- GHSA-42xw-2xvc-qx8m
- GHSA-4w2v-q235-vp99
- GHSA-cph5-m8f7-6c5x
- GHSA-vh95-rmgr-6w4m