How to Audit Installed Packages for Known Vulnerabilities

Even with the OS itself patched, individual application dependencies (libraries, frameworks) can have known vulnerabilities. This guide covers auditing your installed software for known security issues.

Why This Goes Beyond OS-Level Patching

OS package updates (see Debian Security Advisories or Ubuntu equivalents) cover system packages, but application-level dependencies (npm packages, Python libraries, application frameworks) have their own separate vulnerability landscape needing separate attention.

Auditing System Packages

sudo apt list --upgradable

Shows packages with available updates, though doesn't specifically flag which updates are security-relevant versus general improvements — cross-reference with security advisories for that context.

Using a Dedicated Vulnerability Scanner (Lynis)

sudo apt install lynis -y
sudo lynis audit system

Performs a broad security audit including checking for outdated/vulnerable software, providing a comprehensive report with specific recommendations.

Auditing Node.js Dependencies

npm audit
npm audit fix

Checks your project's package.json dependencies against known vulnerability databases, and can automatically fix issues where a compatible patched version exists.

Auditing Python Dependencies

pip install pip-audit --break-system-packages
pip-audit

Auditing PHP/Composer Dependencies

composer audit

Auditing Docker Images

docker scout cves your-image:tag

Or use a dedicated container scanning tool to check base images and installed packages within containers for known vulnerabilities.

Setting Up Automated Dependency Scanning in CI/CD

Integrate dependency auditing into your CI/CD pipeline (see How to Build a Simple CI/CD Pipeline with GitHub Actions) so vulnerabilities are caught before deployment, not discovered after the fact in production.

Prioritizing Findings

Not every flagged vulnerability warrants immediate action — consider: is the vulnerable code path actually reachable/used in your application, what's the severity, and is a patched version genuinely available and compatible with your setup.

Handling Vulnerabilities Without an Available Fix

Sometimes a vulnerability is identified but no patched version exists yet — consider whether you can avoid the vulnerable code path, apply a workaround, or whether the risk is acceptable given your specific usage pattern, while monitoring for an eventual fix.

Establishing a Regular Audit Cadence

Run dependency audits regularly (ideally automated as part of CI/CD, plus periodic manual review) rather than only once at initial deployment — new vulnerabilities in existing dependencies are discovered continuously.

Common Errors

Audit tool reports many vulnerabilities in transitive dependencies you don't directly control — focus first on vulnerabilities with available fixes and genuine severity; some transitive dependency issues may need to wait for upstream maintainers to update their own dependencies.

Continue Reading

Browse more articles in Server Security & Hardening.

  • vulnerability audit packages, npm audit, dependency vulnerability scanning, lynis security audit
  • 0 Bu dökümanı faydalı bulan kullanıcılar:
Bu cevap yeterince yardımcı oldu mu?

İlgili diğer dökümanlar

SSH Hardening: Change the Port, Disable Root Login & Use SSH Keys (Ubuntu & Debian)

SSH is the front door to your VPS — and by default it listens on a well-known port, often...

How to Install and Configure Fail2Ban on Ubuntu & Debian (Complete Guide)

Fail2Ban monitors your server's log files and automatically blocks (bans) IP addresses that show...

How to Configure UFW Firewall on a Linux VPS (Ubuntu & Debian)

UFW (Uncomplicated Firewall) is the standard firewall front-end on Ubuntu and Debian. A correctly...

How to Enable Two-Factor Authentication (2FA) for SSH on a Linux VPS

Two-Factor Authentication (2FA) adds a second layer of protection to SSH: even if your password...

VPS Security Checklist for Beginners: 12 Essential Steps

Every new VPS is deployed with default settings that are convenient but not secure. This...