This document describes how to view and filter dependency metadata that
Artifact Analysis detects with automatic scanning.

When you enable the scanning API to to identify vulnerabilities in container
images, Artifact Analysis also gathers information about the dependencies
and licenses used in your images.

You can use this metadata to understand the components of your container
images and remediate security issues.

Artifact Analysis provides dependency and license detection for OS packages
and [supported language packages](https://docs.cloud.google.com/artifact-analysis/docs/container-scanning-overview#feature-support) within container images
stored in stored in a Docker format Artifact Registry repository. For more
information, see [Container scanning overview](https://docs.cloud.google.com/artifact-analysis/docs/container-scanning-overview).

Like vulnerability information, license and dependency metadata is generated
each time you push an image to Artifact Registry, then stored in
Artifact Analysis.

<br />

Artifact Analysis continues to scan images and packages as long as they
have been pulled within the last 30 days. After 30 days, metadata for scanned
images and packages will no longer be updated, and the results will be stale.

Artifact Analysis archives metadata that has been stale for more than 90
days. This archived metadata can be evaluated only by using the API.
You can re-scan an image with stale or archived metadata by pulling that image.
Refreshing metadata can take up to 24 hours. Packages with stale or archived
metadata can't be rescanned.

## Before you begin

1. Have a Docker repository in Artifact Registry . See instructions on [generating SBOMs](https://docs.cloud.google.com/artifact-analysis/docs/generate-store-sboms).

<br />

### Required roles


To get the permissions that
you need to view SBOM data and filter results,

ask your administrator to grant you the
following IAM roles on the project:

- [Container Analysis Occurrences Viewer](https://docs.cloud.google.com/iam/docs/roles-permissions/containeranalysis#containeranalysis.occurrences.viewer) (`roles/containeranalysis.occurrences.viewer`)
- [Service Usage Consumer](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage#serviceusage.serviceUsageConsumer) (`roles/serviceusage.serviceUsageConsumer`)
- [Artifact Registry Reader](https://docs.cloud.google.com/iam/docs/roles-permissions/artifactregistry#artifactregistry.reader) (`roles/artifactregistry.reader`)


For more information about granting roles, see [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access).


You might also be able to get
the required permissions through [custom
roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles) or other [predefined
roles](https://docs.cloud.google.com/iam/docs/roles-overview#predefined).

## View licenses and dependencies in the Google Cloud console

1. Open the Artifact Registry **Repositories** page.

   [Open the Repositories page](https://console.cloud.google.com/artifacts)

   The page displays a list of your repositories.
2. In the repositories list, click a repository name.

   The **Repository details** page opens and displays a list of your images.
3. In the images list, click an image name.

   The page displays a list of your image digests.
4. In the image digest list, click a digest name.

   The page displays a row of tabs where the **Overview** tab is open, showing
   details such as format, location, repository, virtual size, and tags.
5. In the row of tabs, click the **Dependencies** tab.

   The dependencies tab opens and displays the following information:
   - SBOM section
   - Licenses section
   - A filterable list of dependencies

## SBOMs

If you generate or upload a software bill of materials (SBOM) with
Artifact Analysis, your SBOM details are displayed in this section. SBOMs
aren't generated automatically like license and dependency information. Learn
how to add SBOMs in [SBOM overview](https://docs.cloud.google.com/artifact-analysis/docs/generate-store-sboms).

### Licenses

The **Licenses** summary section displays a bar graph called **Most common
licenses**. This represents the types of licenses that appear most often in your
dependency information. When you hold the pointer over a bar in the graph, the
console displays the exact count for instances of that license type.

### Dependencies

The list of dependencies displays the contents of your image digest including:

- Package name
- Package version
- Package type
- License type

You can filter the list of dependencies by any of these categories.

## View licenses and dependencies in Cloud Build

If you're using Cloud Build, you can view image metadata in the
**Security insights** side panel within the Google Cloud console.

The **Security insights** side panel provides a high-level overview of build
security information for artifacts stored in Artifact Registry. To learn more
about the side panel and how you can use Cloud Build to help protect your
software supply chain, see
[View build security insights](https://docs.cloud.google.com/build/docs/view-build-security-insights).

## Limitations

Information about licenses and dependencies is only available with automatic
scanning. On-demand scanning does not support this feature.

## What's next

- [Generate a software bill of materials (SBOM)](https://docs.cloud.google.com/artifact-analysis/docs/generate-store-sboms) to support compliance requirements.
- [Investigate vulnerabilities](https://docs.cloud.google.com/artifact-analysis/docs/investigate-vulnerabilities) using common query patterns.
- [Create VEX statements](https://docs.cloud.google.com/artifact-analysis/docs/create-vex) to attest to the security posture of your images.