-
Notifications
You must be signed in to change notification settings - Fork 2
Add NuGet Artifact Repository documentation #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # Phylum NuGet Registry | ||
|
|
||
| The Phylum NuGet registry is based on NuGet's [Server API]. | ||
|
|
||
| [Server API]: https://learn.microsoft.com/en-us/nuget/api/overview | ||
|
|
||
| ## Configuration | ||
cd-work marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| All configuration options will require a Phylum API key, since Phylum requires | ||
| authentication. You can find out how to generate one in our | ||
| [API Keys documentation]. | ||
|
|
||
| In the following examples, all API keys will be represented as | ||
| `<PHYLUM_API_KEY>`, so make sure to replace them with your generated key. | ||
|
|
||
| Additionally, if the default policy is not sufficient, a group can be passed to | ||
| evaluate all packages against the group's policy. To do this, just replace | ||
| `<PHYLUM_ORG>` and `<PHYLUM_GROUP>` with the desired org and group name. The | ||
| supplied API key **must** have access to this group. | ||
|
|
||
| If Phylum's default [policy] is sufficient, you can omit the username from the | ||
| authentication details. | ||
|
|
||
| [API Keys documentation]: ../knowledge_base/api-keys.md#generate-an-api-key | ||
| [policy]: ../knowledge_base/policy.md | ||
|
|
||
| ### `dotnet` | ||
|
|
||
| To use the Phylum NuGet registry, the original nuget.org registry first needs to | ||
| be disabled: | ||
|
|
||
| ```sh | ||
| dotnet nuget disable source nuget.org | ||
| ``` | ||
|
|
||
| Once the official registry is disabled, the Phylum source can be added. If | ||
| you're not running Windows, you'll also have to add the | ||
| `--store-password-in-clear-text` flag. | ||
|
|
||
| ```sh | ||
| dotnet nuget add source https://nuget.phylum.io/v3/index.json \ | ||
| --protocol-version 3 \ | ||
| --name Phylum \ | ||
| --valid-authentication-types basic \ | ||
| --username <PHYLUM_ORG>/<PHYLUM_GROUP> \ | ||
| --password <PHYLUM_API_KEY> | ||
| ``` | ||
|
|
||
| > ⚠️ **WARNING** ⚠️ | ||
| > | ||
| > Do not accidentally save your token into your shell history. | ||
cd-work marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| A blocked package will show up in `dotnet` output as missing: | ||
|
|
||
| ```text | ||
| /Demo.csproj : error NU1102: Unable to find package Example.Vulnerable with version (= 1.2.3) | ||
| /Demo.csproj : error NU1102: - Found 42 version(s) in Phylum [ Nearest version: 2.0.0 ] | ||
| ``` | ||
|
|
||
| If a version range is accepted by the manifest, the package manager will | ||
| automatically attempt to use a version that passes Phylum's policy. | ||
|
|
||
| ### `nuget` | ||
|
|
||
| To use the Phylum NuGet registry, the original nuget.org registry first needs to | ||
| be disabled: | ||
|
|
||
| ```sh | ||
| nuget sources Disable -Name nuget.org | ||
| ``` | ||
|
|
||
| Once the official registry is disabled, the Phylum source can be added. If | ||
| you're not running Windows, you'll also have to add the | ||
| `--store-password-in-clear-text` flag. | ||
|
|
||
| ```sh | ||
| nuget sources Add \ | ||
| -Source https://nuget.phylum.io/v3/index.json\ | ||
| -ProtocolVersion 3 \ | ||
| -Name Phylum | ||
| -UserName <PHYLUM_ORG>/<PHYLUM_GROUP> | ||
| -Password <PHYLUM_API_KEY> | ||
| ``` | ||
|
|
||
| > ⚠️ **WARNING** ⚠️ | ||
| > | ||
| > Do not accidentally save your token into your shell history. | ||
|
|
||
| A blocked package will show up in `nuget` output as missing: | ||
|
|
||
| ```text | ||
| Package 'Example.Vulnerable 1.2.3' is not found in the following primary source(s): 'https://nuget.phylum.io/v3/index.json'. Please verify all your online package sources are available (OR) package id, version are specified correctly. | ||
| ``` | ||
|
|
||
| If a version range is accepted by the manifest, the package manager will | ||
| automatically attempt to use a version that passes Phylum's policy. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.