

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Managing Secrets
incomplete
2: Injecting Secrets at Runtime
incomplete
3: Protecting Secrets
incomplete
4: Build Artifacts and Deployment Hygiene
incomplete
5: Limiting Build Context
incomplete
6: Source Code and Config Leaks
incomplete
7: Public File Leaks
incomplete
8: Server-Side Request Forgery
incomplete
9: Defending Against SSRF
incomplete
10: Open Redirects
incomplete
11: Risks of Dependencies
incomplete
12: Auditing Dependencies
incomplete
13: Dependency Maintenance
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
The npm audit command compares the dependency tree in package-lock.json with published security advisories:
npm audit
A clean report is useful: it means no advisory known to the audit service currently matches the locked tree... but it is not proof that the dependencies are safe.
You can also set a threshold for the audit command so that it only fails on "high" or "critical" findings:
{
"scripts": {
"audit:security": "npm audit --audit-level=high"
}
}
This still reports lower-priority findings, but only "high" and "critical" ones cause a nonzero exit status.
When an audit finds a vulnerability, read the dependency path, advisory, available fix, and possible breaking changes before updating.
npm audit fix --force can cross major versions, so don't run it without aggressively testing the updates.
Auditing is a good idea, but it can't find unpublished vulnerabilities, malicious behavior without an advisory, unmaintained design, or risky code outside the locked npm tree, so don't assume a clean report means your app is secure. It's just one of many tools to help you manage risk.
Bearly Secure has no reusable dependency-audit policy. Add a named security audit without changing the dependency tree.
Run and submit the CLI tests from the project root.