# SBOM and vulnerability detection

Nais connects known vulnerabilities to your deployed workloads.
Use Nais Console or the CLI to inspect findings.

An **SBOM** lists the components in an image.
A **finding** means one of those components matches a known vulnerability.

## Where do I start?

```mermaid
graph TD
    Start["Where do I start?"] -->|"No SBOM yet"| SBOM["Generate an SBOM"]
    Start -->|"Inspect findings or find workloads affected by a CVE"| Clients["Console or CLI"]
    Start -->|"Fix vulnerabilities in my app"| MCP["Use Nais MCP"]

    click SBOM "/services/vulnerabilities/how-to/sbom/" "Set up SBOM generation"
    click Clients "/services/vulnerabilities/explanations/sbom-and-vulnerabilities/#console-cli-and-api" "Choose Console or CLI"
    click MCP "/services/vulnerabilities/explanations/sbom-and-vulnerabilities/#use-findings-with-your-coding-assistant" "Use findings with your coding assistant"
```

## From image build to Nais

- 📦 **Your build**

  ---

  An SBOM lists the components in your image.
    Your build signs it and stores the attestation in the registry.

  [Generate an SBOM](/services/vulnerabilities/how-to/sbom.md)
- 🔭 **Vulnerability detection**

  ---

  Nais checks those components against known vulnerability data.
    New data triggers rescanning without a new build.

  [Understand the findings](#understand-and-assess-findings)

- 🔧 **Console, CLI and API**

  ---

  Inspect deployed findings in Console or list them with `nais vulnerability`.
    Find every workload affected by a CVE with `nais vulnerability search <CVE> --my-teams`, or `-A` for all teams.
    Both clients use Nais API.

  [Open Console](https://console.nav.cloud.nais.io/) | [CLI documentation :octicons-link-external-16:](https://cli.nais.io) | [Nais API](/operate/console/api.md)
- 🧑‍💻 **Nais MCP**

  ---

  Ask your coding assistant to fix vulnerabilities in your app.
    It reads what can be fixed from Nais and updates your code for you to review.

  [Use Nais MCP](#use-findings-with-your-coding-assistant)

Results update asynchronously when images or vulnerability data change.

> **SBOM format and scan scope**
> The SBOM (software bill of materials) uses CycloneDX.
> Its signed attestation binds it to the image digest; Nais verifies it before scanning.

> Coverage includes Applications and Jobs, including scaled-to-zero applications and jobs between runs, but not platform workloads or injected sidecars.

## Understand and assess findings

- 📦 **Affected packages**

  ---

  See the package, vulnerability, severity and available fix.
    One vulnerability can affect several packages or workloads.
- 🔭 **Scan coverage**

  ---

  Distinguish completed scans from pending processing, missing SBOMs and failures.
    No findings does not necessarily mean a completed scan.

  [Understand coverage limits](#scan-coverage-is-not-a-clean-bill-of-health)
- 🔧 **Assessments and suppressions**

  ---

  Record your team's decision and the reason for a suppression in Console.
    Suppression does not fix the vulnerability.

> **One vulnerability, two workloads**
> Two workloads use the same image, which includes a library with a known vulnerability.
> Nais reports a finding in each workload. These are two affected workloads, not two different vulnerabilities.
> A finding includes the fixed version when the advisory provides one.
> A fixed version can be on a different release branch than yours, so check that it is compatible before you upgrade.
> No known fix does not mean the finding cannot be fixed: a newer base image or a replacement package may remove it.

A finding identifies an affected component; it does not by itself prove that vulnerable code is reachable or exploitable in your workload.

| Information | Meaning |
| --- | --- |
| Severity | Severity reported by the advisory source. |
| EPSS | FIRST's estimated probability of exploitation in the next 30 days. |
| KEV | Inclusion in CISA's Known Exploited Vulnerabilities catalog, not proof your workload is exploitable. |

Assessments and suppressions apply to a workload, environment, image repository, package and vulnerability.
They can survive package upgrades and image rebuilds within that scope; other workloads do not inherit them automatically.
Your team keeps its assessments valid as the application changes.

### Scan coverage is not a clean bill of health

> **No findings does not mean no vulnerabilities**
> An image may be unresolved, its SBOM missing, or its scan pending or failed.
> A completed scan can also report an error from a later rescan; the older findings may then remain.
> Even a completed scan only finds matches supported by the SBOM and known vulnerability data.

## Use findings with your coding assistant

With the [Nais CLI's MCP server :octicons-link-external-16:](https://github.com/nais/cli/blob/main/MCP.md) (`nais alpha mcp serve`) configured and your repository open, you can ask: **"Fix vulnerabilities in this app."**

```mermaid
sequenceDiagram
    accTitle: Fix vulnerabilities in your application with Nais MCP
    accDescr: Your coding assistant reads what is deployed and what can be fixed from Nais, updates dependencies in your repository and runs your tests. You review and deploy. The assistant then checks that the new image is running and scanned, and reads the updated findings.

    actor You
    participant Assistant as Coding assistant
    participant Nais as Nais API via MCP

    You->>Assistant: Fix vulnerabilities in this app
    Assistant->>Nais: Read deployed findings
    Nais-->>Assistant: Affected packages, installed and fixed versions, suppressions and scan coverage
    Assistant->>Assistant: Update dependencies and run tests in your repository
    Assistant-->>You: Changes to review
    Note over You,Assistant: You review and deploy the changes.
    You->>Assistant: Check the new deploy
    Assistant->>Nais: Check the new image digest
    Nais-->>Assistant: Image running and scanned, updated findings
    Assistant-->>You: Remaining findings to review
```

Through Nais MCP, your assistant sees what is deployed and what can be fixed: affected packages per image, installed versions, reported fix versions, findings without a known fix, suppressions and scan coverage.
It compares this with your repository, updates dependencies and runs your tests.
You review the changes and deploy.

After the deploy, the assistant checks that the new image is running and scanned, then reads the updated findings.
A successful check does not mean zero findings.

The MCP server only reads from Nais. Your assistant edits code in your repository, but nothing is deployed or suppressed without you.
