pnpm audit
Перевіряє наявність відомих проблем безпеки у встановлених пакунках.
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.
Якщо ви хочете проігнорувати деякі вразливості, оскільки вони не впливають на ваш проєкт, ви можете використати параметр auditConfig.ignoreCves.
Параметри
--audit-level <severity>
- Type: low, moderate, high, critical
- Default: low
Only print advisories with severity greater than or equal to <severity>.
Це також можна встановити за допомогою auditLevel у pnpm-workspace.yaml.
--fix
Add overrides to the package.json file in order to force non-vulnerable versions of the dependencies.
--json
Виводить на екран результат перевірки у форматі JSON.
--dev, -D
Перевіряє лише dev залежності.
--prod, -P
Перевіряє лише production залежності.
--no-optional
Don't audit optionalDependencies.
--ignore-registry-errors
Якщо реєстр повертає код статусу, відмінний від 200, процес повинен завершитися з 0. Таким чином, процес завершиться невдачею лише у випадку, якщо реєстр успішно відповість і знайде вразливості.
--ignore-unfixable
Додано у: v10.11.0
Ігнорувати всі CVE, які не було виправлено.
--ignore <vulnerability>
Додано у: v10.11.0
Ігнорувати вразливість за номером CVE.
Налаштування
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