You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: troubleshooting/codeql-builds/compiled-languages-csharp.md
+11-18Lines changed: 11 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,17 @@ Scanning a C# application with CodeQL
2
2
3
3
# Dependencies
4
4
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
+
5
16
## NuGet Error NU1301
6
17
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)
7
18
@@ -51,24 +62,6 @@ Alternatively, add a new source with `nuget sources Add`
51
62
nuget restore
52
63
```
53
64
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
-
72
65
# Build Failures
73
66
74
67
## [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