Skip to content

Commit c04eb9d

Browse files
guntripCopilot
andauthored
[EDI] Configuring automatic dependency submission for your repository (#59868)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 131a52b commit c04eb9d

File tree

3 files changed

+105
-91
lines changed

3 files changed

+105
-91
lines changed

content/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/configuring-automatic-dependency-submission-for-your-repository.md

Lines changed: 2 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ topics:
1515
contentType: how-tos
1616
---
1717

18-
Automatic dependency submission is a method of submitting data to the dependency graph. It allows you to automatically resolve and submit indirect dependencies that are not captured by static analysis. For more information, see [AUTOTITLE](/code-security/concepts/supply-chain-security/dependency-graph-data).
19-
2018
## Prerequisites
2119

2220
Dependency graph must be enabled for the repository for you to enable automatic dependency submission.
@@ -58,97 +56,10 @@ Once enabled, automatic dependency submission jobs will run on the self-hosted r
5856

5957
>[!NOTE] For Maven or Gradle projects that use self-hosted runners with private Maven registries, you need to modify the Maven server settings file to allow the dependency submission workflows to connect to the registries. For more information about the Maven server settings file, see [Security and Deployment Settings](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#transitive-dependencies) in the Maven documentation.
6058
61-
### Configuring network access for self-hosted runners
62-
63-
If your self-hosted runners operate behind a firewall with restricted outbound internet access, you must add certain URLs to the allowlist for automatic dependency submission. The required URLs depend on the ecosystems your repositories use.
64-
65-
#### Required URLs for all ecosystems
66-
67-
These URLs are required for all automatic dependency submission workflows:
68-
69-
* `https://github.com`—Required for accessing {% data variables.product.github %} and downloading actions.
70-
* `https://api.github.com`—Required for {% data variables.product.github %} API access.
71-
* `https://*.githubusercontent.com`—Required for downloading action source code and releases (including `raw.githubusercontent.com`, `github-releases.githubusercontent.com`, and `objects.githubusercontent.com`).
72-
73-
#### Ecosystem-specific URLs
74-
75-
Depending on the ecosystems you use, you may need to allowlist additional URLs.
76-
77-
##### Go
78-
79-
* `https://go.dev`—For downloading the Go toolchain.
80-
* `https://golang.org`—Alternate domain for Go downloads.
81-
* `https://proxy.golang.org`—Official Go module proxy for downloading Go modules during dependency detection.
82-
83-
> [!NOTE]
84-
> The `actions/go-versions` repository is accessed via `https://raw.githubusercontent.com`, which is already covered in the general requirements.
85-
86-
##### Java (Maven and Gradle)
87-
88-
* `https://repo.maven.apache.org`—Maven Central repository for downloading dependencies.
89-
* `https://api.adoptium.net`—For downloading Adoptium/Temurin JDK distributions (default distribution used by `actions/setup-java`).
90-
91-
If you use a different JDK distribution, you may also need:
92-
* `https://aka.ms` and `https://download.microsoft.com`—For Microsoft Build of OpenJDK (note: `aka.ms` is also used for .NET downloads).
93-
* `https://download.oracle.com`—For Oracle JDK.
94-
* `https://api.azul.com`—For Azul Zulu OpenJDK.
95-
96-
##### .NET (C#, F#, Visual Basic)
97-
98-
* `https://aka.ms`—Microsoft URL shortener that redirects to .NET download locations.
99-
* `https://builds.dotnet.microsoft.com`—Primary feed for .NET SDK and runtime downloads.
100-
* `https://ci.dot.net`—Secondary feed for .NET builds.
101-
102-
> [!NOTE]
103-
> The `microsoft/component-detection` tool used by .NET autosubmission is downloaded from {% data variables.product.github %} releases, which is already covered in the general requirements (`https://github.com` and `https://*.githubusercontent.com`).
104-
105-
##### Python
106-
107-
* `https://python.org`—For downloading Python interpreters.
108-
109-
> [!NOTE]
110-
> The `actions/python-versions` repository and `microsoft/component-detection` releases are accessed via URLs already covered in the general requirements (`https://*.githubusercontent.com` and `https://github.com`).
111-
112-
## Using {% data variables.product.company_short %}-hosted {% data variables.actions.hosted_runners %} for automatic dependency submission
113-
114-
{% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %} users can use {% data variables.actions.hosted_runners %} to run automatic dependency submissions jobs.
115-
116-
1. Provision a larger runner at the organization level with the name `dependency-submission`. For more information, see [Adding a {% data variables.actions.hosted_runner %} to an organization](/actions/using-github-hosted-runners/about-larger-runners/managing-larger-runners#adding-a-larger-runner-to-an-organization).
117-
1. Give your repository access to the runner. For more information, see [Allowing repositories to access {% data variables.actions.hosted_runners %}](/actions/using-github-hosted-runners/about-larger-runners/managing-larger-runners#allowing-repositories-to-access-larger-runners).
118-
1. Under "Dependency graph", click the dropdown menu next to “Automatic dependency submission”, then select **Enabled for labeled runners**.
119-
120-
## Troubleshooting automatic dependency submission
121-
122-
Automatic dependency submission makes a best effort to cache package downloads between runs using the [Cache](https://github.com/marketplace/actions/cache) action to speed up workflows. For self-hosted runners, you may want to manage this cache within your own infrastructure. To do this, you can disable the built-in caching by setting an environment variable of `GH_DEPENDENCY_SUBMISSION_SKIP_CACHE` to `true`. For more information, see [AUTOTITLE](/actions/learn-github-actions/variables).
123-
124-
### Manifest deduplication
125-
126-
{% data reusables.dependency-graph.deduplication %}
127-
128-
## Package ecosystem-specific information
129-
130-
### Maven projects
131-
132-
For Maven projects, automatic dependency submission runs an open source fork of the [Maven Dependency Tree Dependency Submission](https://github.com/marketplace/actions/maven-dependency-tree-dependency-submission). The fork allows {% data variables.product.github %} to stay in sync with the upstream repository plus maintain some changes that are only applicable to automatic submission. The fork's source is available at [advanced-security/maven-dependency-submission-action](https://github.com/advanced-security/maven-dependency-submission-action).
133-
134-
If your repository's dependencies seem inaccurate, check that the timestamp of the last dependency graph build matches the last change to your `pom.xml` file. The timestamp is visible on the table of alerts in the repository's {% data variables.product.prodname_dependabot_alerts %} tab. Pushing a commit which updates `pom.xml` will trigger a new run of the Dependency Tree Submission action and force a rebuild of that repository's dependency graph.
135-
136-
### Gradle projects
137-
138-
For Gradle projects, automatic dependency submission runs a fork of the open source Gradle actions from [gradle/actions](https://github.com/gradle/actions). The fork is available at [actions/gradle-build-tools-actions](https://github.com/actions/gradle-build-tools-actions). You can view the results of the autosubmission action under your repository's **Actions** tab. Each run will be labeled "Automatic Dependency Submission (Gradle)" and its output will contain the JSON payload which the action submitted to the API.
139-
140-
### .NET projects
141-
142-
The .NET autosubmission action uses the open source [component-detection](https://github.com/microsoft/component-detection/) project as the engine for its dependency detection. It supports .NET 8.x, 9.x, and 10.x. .NET autosubmission runs if the repository's `dependabot.yml` defines `nuget` as a [`package-ecosystem`](/code-security/dependabot/working-with-dependabot/dependabot-options-reference#package-ecosystem-) or when there is a supported manifest file in the root directory of the repository. Supported manifest files include `.sln`, `.csproj`, `packages.config`, `.vbproj`, `.vcxproj`, and `.fsproj`.
143-
144-
### Python projects
145-
146-
Python uses the open source [component-detection](https://github.com/microsoft/component-detection/) project as its underlying graph generation engine. The autosubmission action for Python will only run if there is a `requirements.txt` file in the root directory of the repository. Python autosubmission does not currently support private packages; packages referenced in `requirements.txt` which are not publicly available will cause the autosubmission action to fail.
147-
148-
> [!NOTE]
149-
> This action uses [actions/setup-python](https://github.com/actions/setup-python) to install Python. You must include a .python-version file in your repository to specify the Python version to be installed.
59+
For network allowlist URLs, larger runner configuration, troubleshooting details, and package ecosystem-specific information, see [AUTOTITLE](/code-security/reference/supply-chain-security/automatic-dependency-submission).
15060

15161
## Further reading
15262

63+
* [AUTOTITLE](/code-security/reference/supply-chain-security/automatic-dependency-submission)
15364
* [AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-supply-chain-security)
15465
* [AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api)
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Automatic dependency submission
3+
intro: Network access requirements, troubleshooting, and ecosystem-specific behavior for automatic dependency submission.
4+
versions:
5+
feature: maven-transitive-dependencies
6+
topics:
7+
- Dependency graph
8+
- Dependencies
9+
- Repositories
10+
contentType: reference
11+
---
12+
13+
## Configure network access for self-hosted runners
14+
15+
If your self-hosted runners operate behind a firewall with restricted outbound internet access, you must add certain URLs to the allowlist for automatic dependency submission. The required URLs depend on the ecosystems your repositories use.
16+
17+
### Required URLs for all ecosystems
18+
19+
These URLs are required for all automatic dependency submission workflows:
20+
21+
* `https://github.com`—Required for accessing {% data variables.product.github %} and downloading actions.
22+
* `https://api.github.com`—Required for {% data variables.product.github %} API access.
23+
* `https://*.githubusercontent.com`—Required for downloading action source code and releases (including `raw.githubusercontent.com`, `github-releases.githubusercontent.com`, and `objects.githubusercontent.com`).
24+
25+
### Ecosystem-specific URLs
26+
27+
Depending on the ecosystems you use, you may need to allowlist additional URLs.
28+
29+
#### Go
30+
31+
* `https://go.dev`—For downloading the Go toolchain.
32+
* `https://golang.org`—Alternate domain for Go downloads.
33+
* `https://proxy.golang.org`—Official Go module proxy for downloading Go modules during dependency detection.
34+
35+
> [!NOTE]
36+
> The `actions/go-versions` repository is accessed via `https://raw.githubusercontent.com`, which is already covered in the general requirements.
37+
38+
#### Java (Maven and Gradle)
39+
40+
* `https://repo.maven.apache.org`—Maven Central repository for downloading dependencies.
41+
* `https://api.adoptium.net`—For downloading Adoptium/Temurin JDK distributions (default distribution used by `actions/setup-java`).
42+
43+
If you use a different JDK distribution, you may also need:
44+
45+
* `https://aka.ms` and `https://download.microsoft.com`—For Microsoft Build of OpenJDK (note: `aka.ms` is also used for .NET downloads).
46+
* `https://download.oracle.com`—For Oracle JDK.
47+
* `https://api.azul.com`—For Azul Zulu OpenJDK.
48+
49+
#### .NET (C#, F#, Visual Basic)
50+
51+
* `https://aka.ms`—Microsoft URL shortener that redirects to .NET download locations.
52+
* `https://builds.dotnet.microsoft.com`—Primary feed for .NET SDK and runtime downloads.
53+
* `https://ci.dot.net`—Secondary feed for .NET builds.
54+
55+
> [!NOTE]
56+
> The `microsoft/component-detection` tool used by .NET autosubmission is downloaded from {% data variables.product.github %} releases, which is already covered in the general requirements (`https://github.com` and `https://*.githubusercontent.com`).
57+
58+
#### Python
59+
60+
* `https://python.org`—For downloading Python interpreters.
61+
62+
> [!NOTE]
63+
> The `actions/python-versions` repository and `microsoft/component-detection` releases are accessed via URLs already covered in the general requirements (`https://*.githubusercontent.com` and `https://github.com`).
64+
65+
## Use {% data variables.product.company_short %}-hosted {% data variables.actions.hosted_runners %} for automatic dependency submission
66+
67+
{% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %} users can use {% data variables.actions.hosted_runners %} to run automatic dependency submissions jobs.
68+
69+
1. Provision a larger runner at the organization level with the name `dependency-submission`. For more information, see [Adding a {% data variables.actions.hosted_runner %} to an organization](/actions/using-github-hosted-runners/about-larger-runners/managing-larger-runners#adding-a-larger-runner-to-an-organization).
70+
1. Give your repository access to the runner. For more information, see [Allowing repositories to access {% data variables.actions.hosted_runners %}](/actions/using-github-hosted-runners/about-larger-runners/managing-larger-runners#allowing-repositories-to-access-larger-runners).
71+
1. Under "Dependency graph", click the dropdown menu next to “Automatic dependency submission”, then select **Enabled for labeled runners**.
72+
73+
## Troubleshoot automatic dependency submission
74+
75+
Automatic dependency submission makes a best effort to cache package downloads between runs using the [Cache](https://github.com/marketplace/actions/cache) action to speed up workflows. For self-hosted runners, you may want to manage this cache within your own infrastructure. To do this, you can disable the built-in caching by setting an environment variable of `GH_DEPENDENCY_SUBMISSION_SKIP_CACHE` to `true`. For more information, see [AUTOTITLE](/actions/learn-github-actions/variables).
76+
77+
### Manifest deduplication
78+
79+
{% data reusables.dependency-graph.deduplication %}
80+
81+
## Package ecosystem-specific information
82+
83+
### Maven projects
84+
85+
For Maven projects, automatic dependency submission runs an open source fork of the [Maven Dependency Tree Dependency Submission](https://github.com/marketplace/actions/maven-dependency-tree-dependency-submission). The fork allows {% data variables.product.github %} to stay in sync with the upstream repository plus maintain some changes that are only applicable to automatic submission. The fork's source is available at [advanced-security/maven-dependency-submission-action](https://github.com/advanced-security/maven-dependency-submission-action).
86+
87+
If your repository's dependencies seem inaccurate, check that the timestamp of the last dependency graph build matches the last change to your `pom.xml` file. The timestamp is visible on the table of alerts in the repository's {% data variables.product.prodname_dependabot_alerts %} tab. Pushing a commit which updates `pom.xml` will trigger a new run of the Dependency Tree Submission action and force a rebuild of that repository's dependency graph.
88+
89+
### Gradle projects
90+
91+
For Gradle projects, automatic dependency submission runs a fork of the open source Gradle actions from [gradle/actions](https://github.com/gradle/actions). The fork is available at [actions/gradle-build-tools-actions](https://github.com/actions/gradle-build-tools-actions). You can view the results of the autosubmission action under your repository's **Actions** tab. Each run will be labeled "Automatic Dependency Submission (Gradle)" and its output will contain the JSON payload which the action submitted to the API.
92+
93+
### .NET projects
94+
95+
The .NET autosubmission action uses the open source [component-detection](https://github.com/microsoft/component-detection/) project as the engine for its dependency detection. It supports .NET 8.x, 9.x, and 10.x. .NET autosubmission runs if the repository's `dependabot.yml` defines `nuget` as a [`package-ecosystem`](/code-security/dependabot/working-with-dependabot/dependabot-options-reference#package-ecosystem-) or when there is a supported manifest file in the root directory of the repository. Supported manifest files include `.sln`, `.csproj`, `packages.config`, `.vbproj`, `.vcxproj`, and `.fsproj`.
96+
97+
### Python projects
98+
99+
Python uses the open source [component-detection](https://github.com/microsoft/component-detection/) project as its underlying graph generation engine. The autosubmission action for Python will only run if there is a `requirements.txt` file in the root directory of the repository. Python autosubmission does not currently support private packages; packages referenced in `requirements.txt` which are not publicly available will cause the autosubmission action to fail.
100+
101+
> [!NOTE]
102+
> This action uses [actions/setup-python](https://github.com/actions/setup-python) to install Python. You must include a .python-version file in your repository to specify the Python version to be installed.

content/code-security/reference/supply-chain-security/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ topics:
1717
- Vulnerabilities
1818
contentType: reference
1919
children:
20+
- /automatic-dependency-submission
2021
- /dependabot-options-reference
2122
- /dependabot-alerts-filters
2223
- /supported-ecosystems-and-manifests-for-dependency-scope

0 commit comments

Comments
 (0)