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: docs/concepts/Security-Best-Practices.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ For more information about Dependabot alerts & security updates, [see the follow
117
117
118
118
**📦 Package Consumer**
119
119
120
-
When using multiple public & private NuGet source feeds, a package can be downloaded from any of the feeds. To ensure your build is predictable and secure from known attacks such as [Dependency Confusion](https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610), knowing what specific feed(s) your packages are coming from is a best practice. You can use a single feed or private feed with upstreaming capabilities for protection.
120
+
Use package sources that you trust. When using multiple public & private NuGet source feeds, a package can be downloaded from any of the feeds. To ensure your build is predictable and secure from known attacks such as [Dependency Confusion](https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610), knowing what specific feed(s) your packages are coming from is a best practice. You can use a single feed or private feed with upstreaming capabilities for protection.
121
121
122
122
For more information to secure your package feeds, see [3 Ways to Mitigate Risk When Using Private Package Feeds](https://azure.microsoft.com/resources/3-ways-to-mitigate-risk-using-private-package-feeds/en-us/).
Copy file name to clipboardExpand all lines: docs/consume-packages/consuming-packages-authenticated-feeds.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,10 @@ ms.topic: conceptual
10
10
# Consuming packages from authenticated feeds
11
11
12
12
Many NuGet operations, such as restore and install, require communication with one or more package sources, which [can be configured in *nuget.config* files](../reference/nuget-config-file.md#packagesources).
13
+
14
+
> [!NOTE]
15
+
> Use package sources that you trust.
16
+
13
17
For HTTP feeds, NuGet will make an unauthenticated request, and if the server responds with an HTTP 401 response, NuGet will search for credentials in the following order:
@@ -37,11 +41,11 @@ This approach provides an extra layer of security by storing the credentials in
37
41
For more information, refer to the section on [credentials in *nuget.config* files](#credentials-in-nugetconfig-files).
38
42
39
43
> [!NOTE]
40
-
> Be aware that encrypted passwords are only supported on Windows.
44
+
> Be aware that encrypted passwords are only supported on Windows.
41
45
> Moreover, they can only be decrypted on the same machine and by the same user who originally encrypted them.
42
46
43
47
1.**Using Environment Variable Macros in nuget.config**: If using encrypted credentials is not possible, consider storing the credentials in the *nuget.config* file with environment variable macros.
44
-
This approach allows you to reference environment variables that contain the actual credentials.
48
+
This approach allows you to reference environment variables that contain the actual credentials.
45
49
It enhances transparency and helps end users understand how their credentials are configured.
46
50
For more information, refer to the section on [credentials in *nuget.config* files](#credentials-in-nugetconfig-files).
Copy file name to clipboardExpand all lines: docs/reference/cli-reference/cli-ref-sources.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,9 @@ ms.topic: reference
13
13
14
14
Manages the list of sources located in the user scope configuration file or a specified configuration file. The user scope configuration file is located at `%appdata%\NuGet\NuGet.Config` (Windows) and `~/.nuget/NuGet/NuGet.Config` (Mac/Linux).
15
15
16
+
> [!NOTE]
17
+
> Use package sources that you trust.
18
+
16
19
Note that the source URL for nuget.org is `https://api.nuget.org/v3/index.json`.
17
20
18
21
## Usage
@@ -54,7 +57,7 @@ where `<operation>` is one of *List, Add, Remove, Enable, Disable,* or *Update*,
54
57
Specifies the password for authenticating with the source.
55
58
56
59
> [!NOTE]
57
-
> Be aware that encrypted passwords are only supported on Windows.
60
+
> Be aware that encrypted passwords are only supported on Windows.
58
61
> Moreover, they can only be decrypted on the same machine and by the same user who originally encrypted them.
Copy file name to clipboardExpand all lines: docs/reference/nuget-config-file.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ Lists all known package sources. The order is ignored during restore operations
117
117
| :-- | :-- |
118
118
|**Key**| (name to assign to the package source) |
119
119
|**Value**| The path or URL of the package source. |
120
-
|**protocolVersion**| The NuGet server protocol version to be used. The current version is "3". Defaults to version "2" when not pointing to a package source URL ending in `.json` (e.g. https://api.nuget.org/v3/index.json). Supported in [NuGet 3.0+](/nuget/release-notes/nuget-3.0.0). See [NuGet Server API](/nuget/api/overview) for more information about the version 3 protocol. |
120
+
|**protocolVersion**| The NuGet server protocol version to be used. The current version is "3". Defaults to version "2" when not pointing to a package source URL ending in `.json` (e.g. <https://api.nuget.org/v3/index.json>). Supported in [NuGet 3.0+](/nuget/release-notes/nuget-3.0.0). See [NuGet Server API](/nuget/api/overview) for more information about the version 3 protocol. |
121
121
|**allowInsecureConnections**| When false, or not specified, NuGet will emit a warning when the source uses http, rather than https. If you are confident that communication with this source will never be at risk of interception attacks, you can set the value to true to suppress the warning. Supported in NuGet 6.8+. |
122
122
|**disableTLSCertificateValidation**| This configuration property allows you to disable SSL/TLS certificate validation for your HTTPS server. When set to true, the server will ignore any errors related to SSL/TLS certificates, such as expired or self-signed certificates, and establish the connection without validation. Supported in NuGet 6.11+. |
123
123
@@ -134,6 +134,9 @@ Lists all known package sources. The order is ignored during restore operations
134
134
</packageSources>
135
135
```
136
136
137
+
> [!NOTE]
138
+
> Use package sources that you trust.
139
+
137
140
> [!NOTE]
138
141
> When using the CLI, you can express a [`RestoreSources`](../reference/msbuild-targets.md#restore-properties) MSBuild property or [`--source`(.NET CLI)](/dotnet/core/tools/dotnet-restore#options) | [`-Source`(NuGet CLI)](/nuget/reference/cli-reference/cli-ref-restore#options) to override the `<packageSources>` defined in the NuGet.config.
139
142
@@ -303,7 +306,7 @@ Identifies to the currently active source or indicates the aggregate of all sour
303
306
304
307
## trustedSigners section
305
308
306
-
Stores trusted signers used to allow package while installing or restoring. This list cannot be empty when the user sets `signatureValidationMode` to `require`.
309
+
Stores trusted signers used to allow package while installing or restoring. This list cannot be empty when the user sets `signatureValidationMode` to `require`.
307
310
308
311
This section can be updated with the [`nuget trusted-signers` command](../reference/cli-reference/cli-ref-trusted-signers.md).
309
312
@@ -439,7 +442,6 @@ The table below show environnment variable syntax and path separator support for
439
442
|`$MY_VAR`|`/`| No | No | No | No |
440
443
|`$MY_VAR`|`\`| No | No | No | No |
441
444
442
-
443
445
## Example config file
444
446
445
447
Below is an example `nuget.config` file that illustrates a number of settings including optional ones:
0 commit comments