1
1
## Requirements
2
2
3
3
- Docker
4
- - Rekor CLI
4
+ - Cosign CLI
5
5
- Go 1.20+
6
+ - Regctl
6
7
7
- Note - This demonstration is about fetching and verification of signatures and signed artifacts. So I have a already signed image.
8
8
9
- ## Setup
10
- 1 . Setup Environment variables
11
- ```
12
- export IMAGE_URI=<.............>
13
- export SIGSTORE_REKOR_PUBLIC_KEY=<path to rekor.pub key>
14
- ```
15
- 2 . Replace the cosign.pub by your own key.
9
+ Note - Paste your cosign public key in cosign.pub file.
16
10
11
+ ## Setup for running the demo :
12
+
13
+
14
+ ```
15
+ 1. repo1="localhost:5001/demo-reffer"
16
+
17
+ ```
18
+
19
+ We can use any registry which supports OCI 1.1
20
+ ```
21
+ 2. docker run -d --rm --label demo=referrers -e "REGISTRY_STORAGE_DELETE_ENABLED=true" -e "REGISTRY_VALIDATION_DISABLED=true" -p "127.0.0.1:5001:5000" registry:2
22
+ ```
23
+
24
+ ```
25
+ 3. regctl registry set --tls=disabled localhost:5001
26
+ ```
27
+
28
+ It will fetch the digest for linux/amd64 image from a multiplatform image
29
+ ```
30
+ 4. digest=$(regctl image digest --platform linux/amd64 regclient/regctl:edge)
31
+ ```
32
+
33
+
34
+ ```
35
+ 5. regctl image copy regclient/regctl@${digest} ${repo1}:app
36
+ ```
17
37
18
- repo1="localhost:5001/demo-reffer"
19
- repourl1="http://localhost:5001/v2/demo-reffer "
20
- docker run -d --rm --label demo=referrers -e "REGISTRY_STORAGE_DELETE_ENABLED=true" -e "REGISTRY_VALIDATION_DISABLED=true" -p "127.0.0.1:5001:5000" registry:2
21
- regctl registry set --tls=disabled localhost:5001
22
- digest=$(regctl image digest --platform linux/amd64 regclient/regctl: edge )
23
- regctl image copy regclient/regctl@${digest} ${repo1}: app
24
38
25
- syft packages -q "${repo1}: app " -o cyclonedx-json | regctl artifact put --subject "${repo1}: app " --artifact-type application/vnd.cyclonedx+json -m application/vnd.cyclonedx+json --annotation "org.opencontainers.artifact.description=CycloneDX JSON SBOM"
39
+ ```
40
+ 6. syft packages -q "${repo1}:app" -o cyclonedx-json | regctl artifact put --subject "${repo1}:app" --artifact-type application/vnd.cyclonedx+json -m application/vnd.cyclonedx+json --annotation "org.opencontainers.artifact.description=CycloneDX JSON SBOM"
41
+ ```
26
42
27
- syft packages -q "${repo1}: app " -o spdx-json | regctl artifact put --subject "${repo1}: app " --artifact-type application/spdx+json -m application/spdx+json --annotation "org.opencontainers.artifact.description=SPDX JSON SBOM"
28
43
44
+ ```
45
+ 7. syft packages -q "${repo1}:app" -o spdx-json | regctl artifact put --subject "${repo1}:app" --artifact-type application/spdx+json -m application/spdx+json --annotation "org.opencontainers.artifact.description=SPDX JSON SBOM"
46
+
47
+ ```
48
+
49
+ Note -> Since cosign does not support these type of refferes so for performing artifact verification we have to add in toto attestation by using cosign CLI.
50
+
51
+ ```
52
+ 8. cosign attest --predicate <file> --key cosign.key <image>
53
+ ```
54
+
55
+
56
+
57
+
58
+ <!--
59
+ 1. repourl1="http://localhost:5001/v2/demo-reffer"
29
60
30
61
repo2="localhost:5002/demo-reffer"
31
62
repourl2="http://localhost:5002/v2/demo-reffer"
@@ -34,4 +65,4 @@ mtImage="application/vnd.oci.image.manifest.v1+json"
34
65
docker run -d --rm --label demo=referrers -p "127.0.0.1:5002:5000" ghcr.io/project-zot/zot-linux-amd64:latest
35
66
regctl registry set --tls=disabled localhost:5001
36
67
37
-
68
+ -->
0 commit comments