Skip to content

Commit b5016f8

Browse files
added readme.md
1 parent 35595e0 commit b5016f8

File tree

1 file changed

+49
-18
lines changed

1 file changed

+49
-18
lines changed

Diff for: README.md

+49-18
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,62 @@
11
## Requirements
22

33
- Docker
4-
- Rekor CLI
4+
- Cosign CLI
55
- Go 1.20+
6+
- Regctl
67

7-
Note - This demonstration is about fetching and verification of signatures and signed artifacts. So I have a already signed image.
88

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.
1610

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+
```
1737

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
2438

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+
```
2642

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"
2843

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"
2960
3061
repo2="localhost:5002/demo-reffer"
3162
repourl2="http://localhost:5002/v2/demo-reffer"
@@ -34,4 +65,4 @@ mtImage="application/vnd.oci.image.manifest.v1+json"
3465
docker run -d --rm --label demo=referrers -p "127.0.0.1:5002:5000" ghcr.io/project-zot/zot-linux-amd64:latest
3566
regctl registry set --tls=disabled localhost:5001
3667
37-
68+
-->

0 commit comments

Comments
 (0)