Skip to content

Add signing validation command and notation trust materials - #1984

Merged
lbussell merged 16 commits into
dotnet:mainfrom
lbussell:dev/loganbussell/signing-validation
Feb 26, 2026
Merged

lbussell merged 16 commits into
dotnet:mainfrom
lbussell:dev/loganbussell/signing-validation

Conversation

@lbussell

@lbussell lbussell commented Feb 24, 2026 •

Copy link
Copy Markdown
Member

Add VerifySignaturesCommand that verifies container image signatures using the notation CLI. This includes:

  • NotationClient wrapper for notation CLI operations
  • Notation trust policy files for supplychain and test environments
  • Dockerfile changes to install notation and Microsoft Root CA certificates
  • Trust store configuration property for signature verification
  • Unit tests for the verification command and notation client

This is part 2/3 of #1376.

lbussell and others added 2 commits February 24, 2026 15:01
Add VerifySignaturesCommand that verifies container image signatures
using the notation CLI. This includes:

- VerifySignaturesCommand and options for CLI integration
- NotationClient wrapper for notation CLI operations
- Notation trust policy files for supplychain and test environments
- Dockerfile changes to install notation and bake in root CA certificates
- TrustStoreName configuration property for signature verification
- Unit tests for the verification command and notation client

Co-authored-by: Copilot <[email protected]>
Use Parallel.ForEachAsync with ConcurrentBag for thread-safe
failure collection, matching the pattern used in other commands.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds signature verification capabilities for container images using the notation CLI. It introduces a new VerifySignaturesCommand that reads image references from a merged image-info.json file and verifies signatures against configured trust policies. The implementation includes notation CLI wrapper, trust policy configurations for test and production environments, and corresponding unit tests.

Changes:

  • Added NotationClient wrapper for notation CLI operations (verify, import trust policy, add certificates, login)
  • Added trust policy JSON files for test and supplychain environments with strict signature verification
  • Modified Dockerfile to install notation and download Microsoft Root CA certificates
  • Extended SigningConfiguration with TrustStoreName property for verification
  • Created VerifySignaturesCommand with registry authentication and signature verification logic
  • Updated C# coding guidelines documentation with LINQ preference and interface documentation conventions

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
src/notation-trust/policies/test.json Trust policy configuration for test environment with strict verification
src/notation-trust/policies/supplychain.json Trust policy configuration for production supplychain environment
src/ImageBuilder/Notation/NotationClient.cs CLI wrapper implementation for notation commands
src/ImageBuilder/Notation/INotationClient.cs Interface defining notation CLI operations
src/ImageBuilder/ImageBuilder.cs Dependency injection registration for NotationClient and VerifySignaturesCommand
src/ImageBuilder/Configuration/SigningConfiguration.cs Added TrustStoreName property and removed TODO comment
src/ImageBuilder/Commands/Signing/VerifySignaturesOptions.cs Command options including image info path and trust materials location
src/ImageBuilder/Commands/Signing/VerifySignaturesCommand.cs Main verification logic with registry login and signature checking
src/ImageBuilder.Tests/Notation/NotationClientTests.cs Basic unit test for NotationClient dry run
src/ImageBuilder.Tests/Commands/Signing/VerifySignaturesCommandTests.cs Comprehensive tests for verification command scenarios
src/Dockerfile.linux Installation of notation and Microsoft Root CA certificates
.github/instructions/csharp.instructions.md Updated coding guidelines with LINQ usage and documentation conventions

@lbussell
lbussell marked this pull request as ready for review February 25, 2026 20:04
@lbussell
lbussell requested a review from a team as a code owner February 25, 2026 20:04
@lbussell
lbussell enabled auto-merge (squash) February 26, 2026 21:45
@lbussell
lbussell merged commit a221025 into dotnet:main Feb 26, 2026
12 checks passed
@lbussell
lbussell deleted the dev/loganbussell/signing-validation branch February 26, 2026 22:51
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.

3 participants