Verdaccio Audit Middleware

10.2.4 · active · verified Wed Apr 22

verdaccio-audit is a middleware plugin for Verdaccio, a lightweight private npm proxy registry. Its primary function is to bypass, modify, or control the default npm audit behavior when packages are retrieved through the Verdaccio instance. This empowers organizations to manage vulnerability scanning, enabling integration with internal security tools, ignoring specific advisories, or completely disabling external audit calls to `npmjs.com` for enhanced performance or privacy. The package is currently at version 10.2.4 and is an active component within the Verdaccio monorepo, which typically undergoes regular patch and minor updates across its various packages. A key differentiator of verdaccio-audit is its capability to provide granular control over the audit process directly within a private registry environment, offering a flexible alternative to relying solely on external `npm audit` services.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install the `verdaccio-audit` package and configure it within Verdaccio's `config.yaml` to disable external npmjs.com audit requests, providing a custom message.

yarn add verdaccio-audit
# OR npm install verdaccio-audit

# --- In your Verdaccio config.yaml (example path: ~/.verdaccio/config.yaml) ---

# Existing Verdaccio configurations...

# Example of auth settings (required for Verdaccio operation)
auth:
  htpasswd:
    file: ./htpasswd
    # Other htpasswd options

# Enable and configure the audit middleware plugin
middleware:
  audit:
    enabled: true
    # Set to 'false' to completely block external npmjs.com audit calls.
    # When set to 'false', Verdaccio will not proxy audit requests to npmjs.com.
    allow_external_audit: false
    # Optionally, provide a custom message shown when audit requests are blocked.
    message: "npm audit requests are managed internally or disabled by policy."
    # Set the logging level for the plugin (e.g., info, warn, error, debug)
    log_level: info

# Remaining Verdaccio configurations...

view raw JSON →