Skip to content

Commit da93c19

Browse files
authored
Enhance global private registry configuration guidance
Added details on configuring global private registry credentials for CodeQL scans and improved guidance for NuGet authentication.
1 parent 6119202 commit da93c19

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

troubleshooting/codeql-builds/compiled-languages-csharp.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ Scanning a C# application with CodeQL
22

33
# Dependencies
44

5+
## Global Private Registry (with default setup)
6+
7+
Organization-level configuration of NuGet server credentials can significantly improve the precision of CodeQL default scans, particularly when using `build-mode: none`. When credentials are properly configured at the organization level, CodeQL can access and analyze dependencies from private registries during the scanning process.
8+
9+
For default setup, ensure credentials to your private registries listed in your `nuget.config` are available/injected so that the analysis does not attempt to hit a registry that will fail for every dependency. Even if not listed in a nuget.config, the global private registry server/credentials are injected into a proxy during default setup! Configuring registry auth is especially important for organizations using private NuGet feeds, as proper authentication allows CodeQL (and Dependabot) to:
10+
- Resolve dependency metadata more accurately - leading to a more precise CodeQL database
11+
- Analyze the complete dependency graph - instead of a loose detection on package versions
12+
- Provide more comprehensive security findings - helping to enusre data flows are more fully mapped
13+
- Reduce false positives/false negatives in vulnerability detection - better detection of data types and call targets sourced from dependencies
14+
15+
516
## NuGet Error NU1301
617
This can indicate your custom package server is not configured which may fail the `dotnet restore` command. For private package servers, the follwing guidance shows how to add package sources: [Setting up authentication for nuget feeds](https://github.com/actions/setup-dotnet#setting-up-authentication-for-nuget-feeds)
718

@@ -51,24 +62,6 @@ Alternatively, add a new source with `nuget sources Add`
5162
nuget restore
5263
```
5364

54-
## Global Private Registry
55-
56-
Organization-level configuration of NuGet server credentials can significantly improve the precision of CodeQL default scans, particularly when using `build-mode: none`. When credentials are properly configured at the organization level, CodeQL can access and analyze dependencies from private registries during the scanning process.
57-
58-
For `build-mode: none`, ensure credentials to your private registries listed in your `nuget.config` are available/injected so that the analysis does not attempt to hit a registry that will fail for every dependency. This is especially important for organizations using private NuGet feeds, as proper authentication allows CodeQL to:
59-
60-
- Resolve dependency metadata more accurately
61-
- Analyze the complete dependency graph
62-
- Provide more comprehensive security findings
63-
- Reduce false negatives in vulnerability detection
64-
65-
Configure organization-level credentials through:
66-
- Organization secrets for NuGet authentication tokens
67-
- Properly configured `nuget.config` files in your repositories
68-
- Environment variables for package source authentication
69-
70-
This configuration ensures that default scans have the necessary access to evaluate your complete codebase and its dependencies, leading to more accurate and comprehensive security analysis.
71-
7265
# Build Failures
7366

7467
## [error]We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps.

0 commit comments

Comments
 (0)