Skip to content

Commit 17be2d4

Browse files
authored
Merge pull request #99955 from FeynmanZhou/main
Update container-registry-tutorial-sign-build-push.md
2 parents e1c2233 + 53f2ae2 commit 17be2d4

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

articles/container-registry/container-registry-tutorial-sign-build-push.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ In this tutorial:
3333
> [!NOTE]
3434
> The tutorial uses early released versions of notation and notation plugins.
3535
36-
1. Install notation with plugin support from the [release version](https://github.com/notaryproject/notation/releases/)
36+
1. Install notation 0.11.0-alpha.4 with plugin support on a Linux environment. You can also download the package for other environments from the [release page](https://github.com/notaryproject/notation/releases/tag/v0.11.0-alpha.4).
3737

3838
```bash
3939
# Download, extract and install
40-
curl -Lo notation.tar.gz https://github.com/notaryproject/notation/releases/download/v0.9.0-alpha.1/notation_0.9.0-alpha.1_linux_amd64.tar.gz
40+
curl -Lo notation.tar.gz https://github.com/notaryproject/notation/releases/download/v0.11.0-alpha.4/notation_0.11.0-alpha.4_linux_amd64.tar.gz
4141
tar xvzf notation.tar.gz
4242

4343
# Copy the notation cli to the desired bin directory in your PATH
4444
cp ./notation /usr/local/bin
4545
```
4646

47-
2. Install the notation Azure Key Vault plugin for remote signing and verification
47+
2. Install the notation Azure Key Vault plugin for remote signing and verification.
4848

4949
> [!NOTE]
5050
> The plugin directory varies depending upon the operating system being used. The directory path below assumes Ubuntu.
@@ -56,13 +56,13 @@ In this tutorial:
5656
5757
# Download the plugin
5858
curl -Lo notation-azure-kv.tar.gz \
59-
https://github.com/Azure/notation-azure-kv/releases/download/v0.3.1-alpha.1/notation-azure-kv_0.3.1-alpha.1_Linux_amd64.tar.gz
59+
https://github.com/Azure/notation-azure-kv/releases/download/v0.4.0-alpha.4/notation-azure-kv_0.4.0-alpha.4_Linux_amd64.tar.gz
6060
6161
# Extract to the plugin directory
6262
tar xvzf notation-azure-kv.tar.gz -C ~/.config/notation/plugins/azure-kv notation-azure-kv
6363
```
6464

65-
3. List the available plugins and verify that the plugin is available
65+
3. List the available plugins and verify that the plugin is available.
6666

6767
```bash
6868
notation plugin ls
@@ -73,7 +73,7 @@ In this tutorial:
7373
> [!NOTE]
7474
> For easy execution of commands in the tutorial, provide values for the Azure resources to match the existing ACR and AKV resources.
7575

76-
1. Configure AKV resource names
76+
1. Configure AKV resource names.
7777

7878
```bash
7979
# Name of the existing Azure Key Vault used to store the signing keys
@@ -84,7 +84,7 @@ In this tutorial:
8484
CERT_PATH=./${KEY_NAME}.pem
8585
```
8686

87-
2. Configure ACR and image resource names
87+
2. Configure ACR and image resource names.
8888

8989
```bash
9090
# Name of the existing registry example: myregistry.azurecr.io
@@ -106,7 +106,7 @@ Otherwise create an x509 self-signed certificate storing it in AKV for remote si
106106

107107
### Create a self-signed certificate (Azure CLI)
108108

109-
1. Create a certificate policy file
109+
1. Create a certificate policy file.
110110

111111
Once the certificate policy file is executed as below, it creates a valid signing certificate compatible with **notation** in AKV. The EKU listed is for code-signing, but isn't required for notation to sign artifacts.
112112
@@ -128,32 +128,32 @@ Otherwise create an x509 self-signed certificate storing it in AKV for remote si
128128
EOF
129129
```
130130
131-
1. Create the certificate
131+
1. Create the certificate.
132132
133133
```azure-cli
134134
az keyvault certificate create -n $KEY_NAME --vault-name $AKV_NAME -p @my_policy.json
135135
```
136136
137-
1. Get the Key ID for the certificate
137+
1. Get the Key ID for the certificate.
138138
139139
```bash
140140
KEY_ID=$(az keyvault certificate show -n $KEY_NAME --vault-name $AKV_NAME --query 'kid' -o tsv)
141141
```
142-
4. Download public certificate
142+
4. Download public certificate.
143143
144144
```bash
145145
CERT_ID=$(az keyvault certificate show -n $KEY_NAME --vault-name $AKV_NAME --query 'id' -o tsv)
146146
az keyvault certificate download --file $CERT_PATH --id $CERT_ID --encoding PEM
147147
```
148148
149-
5. Add the Key ID to the keys and certs
149+
5. Add the Key ID to the keys and certs.
150150
151151
```bash
152152
notation key add --name $KEY_NAME --plugin azure-kv --id $KEY_ID
153153
notation cert add --name $KEY_NAME $CERT_PATH
154154
```
155155
156-
6. List the keys and certs to confirm
156+
6. List the keys and certs to confirm.
157157
158158
```bash
159159
notation key ls
@@ -162,31 +162,39 @@ Otherwise create an x509 self-signed certificate storing it in AKV for remote si
162162
163163
## Build and sign a container image
164164
165-
1. Build and push a new image with ACR Tasks
165+
1. Build and push a new image with ACR Tasks.
166166
167167
```azure-cli
168168
az acr build -r $ACR_NAME -t $IMAGE $IMAGE_SOURCE
169169
```
170170
171-
2. Authenticate with your individual Azure AD identity to use an ACR token
171+
2. Authenticate with your individual Azure AD identity to use an ACR token.
172172
173173
```azure-cli
174174
export USER_NAME="00000000-0000-0000-0000-000000000000"
175175
export PASSWORD=$(az acr login --name $ACR_NAME --expose-token --output tsv --query accessToken)
176176
export NOTATION_PASSWORD=$PASSWORD
177177
```
178178
179-
3. Sign the container image
179+
3. Choose [COSE](https://datatracker.ietf.org/doc/html/rfc8152) or JWS signature envelope to sign the container image.
180180
181+
- Sign the container image with the COSE signature envelope:
182+
183+
```bash
184+
notation sign --envelope-type cose --key $KEY_NAME $IMAGE
185+
```
186+
187+
- Sign the container image with the default JWS signature envelope:
188+
181189
```bash
182190
notation sign --key $KEY_NAME $IMAGE
183191
```
184-
192+
185193
## View the graph of artifacts with the ORAS CLI
186194
187-
ACR support for ORAS artifacts enables a linked graph of supply chain artifacts that can be viewed through the ORAS CLI or the Azure CLI
195+
ACR support for ORAS artifacts enables a linked graph of supply chain artifacts that can be viewed through the ORAS CLI or the Azure CLI.
188196
189-
1. Signed images can be view with the ORAS CLI
197+
1. Signed images can be view with the ORAS CLI.
190198
191199
```bash
192200
oras login -u $USER_NAME -p $PASSWORD $REGISTRY
@@ -195,7 +203,7 @@ ACR support for ORAS artifacts enables a linked graph of supply chain artifacts
195203
196204
## View the graph of artifacts with the Azure CLI
197205
198-
1. List the manifest details for the container image
206+
1. List the manifest details for the container image.
199207
200208
```azure-cli
201209
az acr manifest show-metadata $IMAGE -o jsonc
@@ -248,4 +256,4 @@ notation verify $IMAGE
248256
249257
## Next steps
250258
251-
[Enforce policy to only deploy signed container images to Azure Kubernetes Service (AKS) utilizing **ratify** and **gatekeeper**.](https://github.com/Azure/notation-azure-kv/blob/main/docs/nv2-sign-verify-aks.md)
259+
See [Enforce policy to only deploy signed container images to Azure Kubernetes Service (AKS) utilizing **ratify** and **gatekeeper**.](https://github.com/Azure/notation-azure-kv/blob/main/docs/nv2-sign-verify-aks.md)

0 commit comments

Comments
 (0)