Vulnerability Archive Generation Guide

A step-by-step guide to generating a vulnerability archive in your local environment.

Vulnerability Archive Generation Guide

This guide outlines the steps to generate a vulnerability archive in your local environment.

Requirements

Existing Vulnerabilities

To generate vulnerabilities locally, follow the instructions in the Developer Setup Guide.

Generating an Archive

The vulnerability archive feature is gated behind the vulnerability_archive feature flag. Follow these steps to enable and use it:

Enable the Feature Flag

Open your terminal and run the following command to enable the feature in the Rails console:\

echo "Feature.enable(:vulnerability_archival)" | rails c

Locate the Project ID

Navigate to your project’s homepage. Click the vertical dot menu (⋮) and expand it to reveal the project ID. Copy this ID for the next step.

Open the Rails Console

In your terminal, start the Rails console by running:

rails c

Generate the Archive

Execute the following command in the Rails console, replacing <project_id> with the ID you copied:

Vulnerabilities::Archival::ArchiveService.execute(Project.find(<project_id>), Date.today + 1.day)

This command will:

  • Delete all vulnerabilities up to the current date.
  • Create a new archive containing those vulnerabilities.

View the Archive

Once the archive is generated, you can view it by navigating to:

Secure > Security Configuration > Vulnerability Management from the left navigation bar.