Verify .NET deployments
Turn on NuGet lock files so packages.lock.json pins each package's content hash, and deploy the output of dotnet publish. The attester hashes every file in the checkout and every file in the publish directory, and inspects each .NET process. The verifier downloads every locked package from nuget.org, checks its content hash, and requires each assembly and native library in the publish directory to be a file one of those packages ships, unchanged. Files the build produces (the application's own assembly, its apphost, deps.json and runtimeconfig.json) are compared with a build the verifier runs: the attester hashes them with the publish directory, and the package check leaves the ones build.outputs names to the build.
| Lockfile | packages.lock.json |
|---|---|
| Reference | nuget.org package by content hash |
| What is verified | Assemblies and native libraries in the publish directory |
How it works
The lockfile is read at the deployed commit, from the verifier's own clone of the public repository, never from the server. Every package is compared with the reference the lockfile pins, fetched and checked by hash. Besides the packages, the deployed files are compared with the commit, every process of the service is inspected, and every running executable and library is explained by a reference. A reference that cannot be fetched makes the result inconclusive, never passing.
The .NET guide
The .NET guide covers the setup for the project, the attester and the verifier:
- What gets verified
- Requirements
- Attester configuration
- Verifier configuration
- Build and deploy
- Common findings
- Limits