Skip to content

Commit a221025

Browse files
lbussellCopilotCopilot
authored
Add signing validation command and notation trust materials (#1984)
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. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ab3d450 commit a221025

13 files changed

Lines changed: 710 additions & 2 deletions

File tree

.github/instructions/csharp.instructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ For all new C# code:
2323
- Do not add unused methods/parameters for use cases that were not asked for.
2424
- Reuse existing methods or services as much as possible.
2525
- Use composition over inheritance.
26+
- Use LINQ instead of for loops when working with collections.
2627

2728
## Error Handling & Edge Cases
2829

@@ -50,7 +51,8 @@ For all new C# code:
5051

5152
## Comments
5253

53-
- Add XML documentation comments for for new **public** or **internal** types and members.
54+
- Add XML documentation comments for new **public** or **internal** types and members.
55+
- Primary documentation belongs on interfaces, implementations should use `<inheritdoc/>` unless additional context is needed.
5456
- Comments that simply restate the member or parameter name do not provide value.
5557
- Comments should provide additional context or explain non-obvious behavior, especially for parameters.
5658
- Comments inside methods should explain "why," not "what".

src/Dockerfile.linux

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-azurelinux3.0 AS build-env
77
ARG TARGETARCH
88

9+
# download root CA certificates for signature verification
10+
WORKDIR /
11+
RUN mkdir -p notation-trust/certs/test notation-trust/certs/supplychain \
12+
&& curl -fSL --output notation-trust/certs/test/root-ca.crt \
13+
"https://www.microsoft.com/pkiops/certs/Microsoft%20RSA%20Testing%20Root%20Certificate%20Authority%202019.crt" \
14+
&& curl -fSL --output notation-trust/certs/supplychain/root-ca.crt \
15+
"https://www.microsoft.com/pkiops/certs/Microsoft%20Supply%20Chain%20RSA%20Root%20CA%202022.crt"
16+
917
WORKDIR /image-builder
1018

1119
# restore packages before copying entire source - provides optimizations when rebuilding
@@ -30,9 +38,14 @@ RUN tdnf install -y \
3038
docker-cli \
3139
git \
3240
moby-engine \
41+
notation \
3342
oras \
3443
&& tdnf clean all
3544

45+
# install notation trust materials (root CA certs + trust policies)
46+
COPY --from=build-env ["/notation-trust/", "/notation-trust/"]
47+
COPY ["notation-trust/policies/", "/notation-trust/policies/"]
48+
3649
# install image-builder
3750
WORKDIR /image-builder
3851
COPY --from=build-env /image-builder/out ./

0 commit comments

Comments
 (0)