Skip to content

Add NuGet (.NET) package registry to whitelist#104

Open
tomhardy0177 wants to merge 1 commit into
daytonaio:mainfrom
tomhardy0177:add-nuget
Open

Add NuGet (.NET) package registry to whitelist#104
tomhardy0177 wants to merge 1 commit into
daytonaio:mainfrom
tomhardy0177:add-nuget

Conversation

@tomhardy0177

Copy link
Copy Markdown

Summary

Adds a nuget: section to whitelist.yaml so sandboxes can run dotnet add package, dotnet restore, and nuget.exe against the NuGet v3 API.

Domains added

  • api.nuget.org — v3 service index, package metadata, package binary downloads (PackageBaseAddress)
  • *.nuget.org — wildcard for the sibling hosts the v3 index points at: azuresearch-usnc.nuget.org, azuresearch-ussc.nuget.org (search), and www.nuget.org (gallery). Per the file header, Daytona wildcards match exactly one subdomain level, so this covers all current and likely future <x>.nuget.org hosts without being overly broad.

Why

Every .NET workflow currently fails inside Daytona sandboxes with Connection reset by peer during the TLS Client hello to api.nuget.org. NuGet is the only mainstream package manager not on the list — npm, PyPI, Maven, RubyGems, crates.io, Go modules, Composer, conda, Yarn, and bun already have sections.

Concretely, dotnet add package Microsoft.AspNetCore.SignalR.Client (or any other package) returns:

```
error: Unable to load the service index for source https://api.nuget.org/v3/index.json.
error: The SSL connection could not be established, see inner exception.
error: Connection reset by peer
```

This blocks any agent doing greenfield .NET work in a Daytona sandbox, where the standard pattern is dotnet new <template> followed by dotnet add package to pull dependencies.

Verification of upstream hostnames

$ curl -s https://api.nuget.org/v3/index.json | jq -r '.resources[]."@id" | capture("//(?<h>[^/]+)").h' | sort -u
api.nuget.org
azuresearch-usnc.nuget.org
azuresearch-ussc.nuget.org
www.nuget.org

All four are covered by api.nuget.org + *.nuget.org.

Related

Format

Follows the conventions of the recently-merged PRs (e.g. #95 api.x.ai, #87 GCP, #89 Cloudflare Tunnel): group header comment, section name, list of domains, no trailing whitespace.

Adds a `nuget` section so sandboxes can run `dotnet add package`,
`dotnet restore`, and `nuget.exe` against the NuGet v3 API.

Currently every .NET workflow fails with TLS RST during the Client
hello (api.nuget.org is not in the Envoy allowlist). All other major
package managers (npm, pypi, maven, rubygems, crates.io, go modules)
already have sections; this fills a gap.

Wildcard rationale: the v3 service index at api.nuget.org/v3/index.json
lists separate hostnames for search (azuresearch-{usnc,ussc}.nuget.org)
and the gallery web UI (www.nuget.org). Because Daytona wildcards only
match one subdomain level, *.nuget.org covers all four siblings.

Signed-off-by: tomhardy0177 <183896012+tomhardy0177@users.noreply.github.com>
Comment thread whitelist.yaml
Comment on lines +406 to +410
# NuGet (.NET package registry — required for `dotnet add package`,
# `dotnet restore`, and `nuget.exe`). The v3 service index lives at
# api.nuget.org but lists search endpoints under
# azuresearch-{usnc,ussc}.nuget.org and the gallery web UI under
# www.nuget.org, so the *.nuget.org wildcard is needed to cover them all.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this comment more concise

Suggested change
# NuGet (.NET package registry — required for `dotnet add package`,
# `dotnet restore`, and `nuget.exe`). The v3 service index lives at
# api.nuget.org but lists search endpoints under
# azuresearch-{usnc,ussc}.nuget.org and the gallery web UI under
# www.nuget.org, so the *.nuget.org wildcard is needed to cover them all.
# NuGet (.NET package registry). Wildcard covers the v3 service index,
# search (azuresearch-*.nuget.org), and gallery UI (www.nuget.org).

Comment thread whitelist.yaml
# azuresearch-{usnc,ussc}.nuget.org and the gallery web UI under
# www.nuget.org, so the *.nuget.org wildcard is needed to cover them all.
nuget:
- api.nuget.org

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant, wildcard covers it

Suggested change
- api.nuget.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Nuget package registry

2 participants