Skip to content

Commit 9ecf99c

Browse files
authored
Merge pull request #81 from konflux-ci/revert-80-build-metadata-rework
Revert "Rework supply chain metadata documentation"
2 parents c7b74d6 + 27daed8 commit 9ecf99c

File tree

6 files changed

+55
-202
lines changed

6 files changed

+55
-202
lines changed

docs/modules/ROOT/pages/how-tos/_nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
**** xref:how-tos/testing/integration/creatingoverridesnapshot.adoc[Creating an override snapshot]
2020
** xref:how-tos/metadata/index.adoc[Inspecting provenance and attestations]
2121
*** xref:how-tos/metadata/sboms.adoc[Inspecting SBOMs]
22-
*** xref:how-tos/metadata/attestations.adoc[Inspecting artifact attestations]
22+
*** xref:how-tos/metadata/provenance.adoc[Downloading the SLSA provenance]
2323
** xref:how-tos/deleting.adoc[Deleting applications and components]

docs/modules/ROOT/pages/how-tos/creating.adoc

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ kubectl -n pipelines-as-code create secret generic pipelines-as-code-secret \
4040
. Still in the context of your {ProductName} repository, run `kubectl create -f smee/smee-client`.
4141
. Now, you can trigger your application’s first build pipeline. In the git repository for your application, using your preferred text editor, open a pull request against the `/.tekton/pull-request.yaml` file.
4242
.. Specifically, replace any existing value for the `git-url` field with the git URL for your application’s repository. (This is the URL you would use to clone the repository locally; it ends with `.git`.)
43-
. Once the PR is made, a build pipeline should start. You can track its progress in the {ProductName} UI or you can see the final status in GitHub after the pipeline completes. If the pipeline is successful, you can merge the PR.
43+
. Once the PR is made, a build pipeline should start. You can track its progress on GitHub, or in the {ProductName} UI. If the pipeline is successful, you can merge the PR.
4444

4545
== Example YAML file for multiple components
4646

@@ -111,73 +111,3 @@ metadata:
111111
spec:
112112
url: "https://github.com/konflux-ci/anothertestrepo"
113113
--
114-
115-
== Finding the built image
116-
117-
After a pipeline completes with a built artifact, you may want to test the resulting image to ensure that it works properly. The `IMAGE_URL` Tekton result will be set to the pullspec for the image. This can be discovered using the UI or the CLI.
118-
119-
+
120-
NOTE: Images build from pull request pipelines will be automatically deleted 5 days after they are built. This parameter can be changed by xref:/how-tos/configuring/customizing-the-build.adoc[customizing the build].
121-
122-
=== With the UI
123-
124-
All build PipelineRuns are visible in the {ProductName} UI. The location of these images in the OCI registry is reported on the *Activity* page.
125-
126-
.Procedure
127-
128-
In the console, complete the following steps to find the image pullspec for a completed PipelineRun:
129-
130-
. Navigate to the *Activity* > *Pipeline runs* tab.
131-
132-
. For the component whose SBOM you want to view, select its most recent pipeline run.
133-
134-
. Find the *Results* section at the bottom of the page and look for the `IMAGE_URL` row. It should resemble `quay.io/redhat-user-workloads/workspace-tenant/application/component:tag`. The `IMAGE_DIGEST` provided can be used as an alternative mechanism for referencing the image. You will
135-
136-
=== With the CLI
137-
138-
After the build PipelineRuns are completed from git push events, the Components are updated with the location of the artifact in the OCI registry.
139-
140-
The CLI
141-
142-
.Prerequisites
143-
144-
* xref:/getting-started/cli.adoc[Login] to {ProductName}.
145-
146-
* Install the link:https://stedolan.github.io/jq/download/[jq] CLI tool.
147-
148-
.Procedure
149-
150-
In the CLI, complete the following steps to find the latest pullspec for a component:
151-
152-
. List your components.
153-
+
154-
[source]
155-
----
156-
$ oc get components
157-
----
158-
+
159-
.Example output
160-
+
161-
[source]
162-
----
163-
NAME AGE STATUS REASON TYPE
164-
devfile-sample-go-basic-8wqt 8m54s True OK Updated
165-
devfile-sample-python-basic-ikch 20d True OK Updated
166-
----
167-
168-
. Choose which component's image you want to discover. Then use `oc get` and the `jq` CLI tool to get the component image path.
169-
170-
+
171-
[source]
172-
----
173-
$ oc get component <component name> -o json | jq '.status.containerImage'
174-
----
175-
176-
. For convenience, you may want to save the image path to a local variable.
177-
+
178-
Example:
179-
+
180-
[source]
181-
--
182-
IMAGE=quay.io/redhat-user-workloads/workspace-tenant/application/component@sha256:<output omitted>
183-
--
Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1 @@
1-
= Inspecting provenance and attestations
2-
3-
We are committed to providing exceptional security with {ProductName} by hardening the build platform and providing transparency into the build process and artifact's composition. By hardening the build platform, we enable multiple builds to run on a shared platform while preventing tampering from other running builds (link:https://slsa.dev/spec/v1.1/threats-overview[threats to the build process]). By providing transparency, we enable xref:/advanced-how-tos/managing-compliance-with-ec.adoc[policy evaluation] and auditability on the actual build process (link:https://slsa.dev/spec/v1.1/threats-overview[threats to the package selection]). This commitment means that {ProductName} conforms to the link:https://slsa.dev/spec/v1.0/levels#build-l3[SLSA Build Level 3] requirements.
4-
5-
Don't take our word on the transparency -- you can download and inspect these artifacts yourself! {ProductName} generates and pushes build metadata as OCI artifacts to the container registry alongside your software's build using the link:https://github.com/oras-project/artifacts-spec/blob/main/manifest-referrers-api.md[referrers API].
6-
7-
== Discovering the associated metadata
8-
9-
.Prerequisites
10-
11-
* Install the link:https://docs.sigstore.dev/cosign/installation/[Cosign] CLI tool.
12-
13-
* Install the link:https://stedolan.github.io/jq/download/[jq] CLI tool.
14-
15-
* xref:/getting-started/cli.adoc[Login] to {ProductName}.
16-
17-
.Procedure
18-
19-
In the CLI, complete the following steps to discover the associated metadata a component:
20-
21-
. Find the image for a xref:/how-tos/creating.adoc#finding-the-built-image[recently completed build pipeline] and export the value to the `IMAGE` environment variable
22-
+
23-
Example:
24-
+
25-
[source]
26-
--
27-
IMAGE=quay.io/redhat-user-workloads/workspace-tenant/application/component@sha256:<output omitted>
28-
--
29-
30-
+
31-
. Print a high-level overview of the artifact's metadata that {ProductName} has created for a component:
32-
33-
+
34-
[source]
35-
--
36-
cosign tree $IMAGE
37-
--
38-
+
39-
Example output:
40-
+
41-
[source]
42-
--
43-
📦 Supply Chain Security Related artifacts for an image: quay.io/redhat-user-workload/workspace-tenant/application/component@sha256:<sha-digest>
44-
└── 📦 SBOMs for an image tag: quay.io/redhat-user-workload/workspace-tenant/application/component:sha256-<sha-digest>.sbom
45-
└── 🍒 sha256:<sbom-sha-digest>
46-
└── 💾 Attestations for an image tag: quay.io/redhat-user-workload/workspace-tenant/application/component:sha256-<sha-digest>.att
47-
└── 🍒 sha256:<attestation-sha-digest>
48-
└── 🔐 Signatures for an image tag: quay.io/redhat-user-workload/workspace-tenant/application/component:sha256-<sha-digest>.sig
49-
└── 🍒 sha256:<signature-sha-digest>
50-
--
51-
52-
The `cosign tree` command will show all metadata associated to the artifact via the referrers API. The SBOM artifact contains the Software Bill of MaterialsWe have provided further procedures for you to view and inspect the xref:/how-tos/metadata/attestations.adoc[attestations] and xref:/how-tos/metadata/sboms.adoc[SBOMs] by {ProductName}.
53-
54-
== Downloading the attestations
55-
56-
In order to enable the software artifacts' build processes to be audited, . As part of that commitment, {ProductName} conforms to This includes providing transparency into when and how all artifacts are built by generating link:https://slsa.dev/spec/v1.0/provenance[SLSA provenance] with Tekton Chains.
57-
58-
The pipeline provenance generated by link:https://tekton.dev/docs/concepts/supply-chain-security/[Tekton Chains] contains information from the PipelineRun that generated the attested artifact including input parameters for the Tasks as well as Task results.
59-
60-
We have provided the procedures for you to link:/how-tos/metadata/provenance/downloading.adoc[download] and link:/how-tos/metadata/provenance/inspect.adoc[inspect] the SLSA provenace that {ProductName} generates for each of your xref:../glossary/index.adoc#component[components].
61-
62-
The SLSA provenance is stored as an OCI artifact alongside the images that are pushed to the container registry. The provenance is associated with the artifact by the link:https://github.com/oras-project/artifacts-spec/blob/main/manifest-referrers-api.md[referrers API] and can be retrieved from the OCI registry using a command line tool `cosign`.
63-
64-
A software bill of materials (SBOM) provides greater transparency for your software supply chain. {ProductName} provides link:https://www.cisa.gov/sites/default/files/2023-04/sbom-types-document-508c.pdf[build SBOMs], which list all the software libraries that a component uses. Those libraries can enable specific functionality or facilitate development.
65-
66-
You can use an SBOM to better understand the composition of your software. In particular, you can use various tools to scan your SBOM and determine if any of your dependencies have known vulnerabilities. Furthermore, to comply with cybersecurity regulations, your organization might need to provide its customers with the SBOM for your application's components. For example, in the United States, the link:https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/[Executive Order on Improving the Nation's Cybersecurity] requires vendors to provide SBOMs, and in Europe, the link:https://www.cisa.gov/sites/default/files/2023-09/EU%20Commission%20SBOM%20Work_508c.pdf[Cyber Resilience Act] does the same.
67-
68-
69-
== Additional resources
70-
* Learn about the SLSA framework and xref:/index.adoc#supply-chain-security-through-slsa-conformity[how {ProductName} meets the requirements of SLSA Build Level 3].
71-
* Red Hat's Enterprise Contract (EC) is a powerful tool that you can also use to verify your SLSA provenance; visit link:https://enterprisecontract.dev/docs/user-guide/main/cli.html#_validating_an_image[this page] to learn how to use the EC CLI tool to verify your provenance. You will need the public key used by Tekton Chains, which you can find by following link:https://enterprisecontract.dev/docs/user-guide/main/cli.html#_finding_the_public_key[these instructions].
1+
= Inspecting provenance and attestations

docs/modules/ROOT/pages/how-tos/metadata/attestations.adoc renamed to docs/modules/ROOT/pages/how-tos/metadata/provenance.adoc

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,8 @@
1-
= Inspecting artifact attestations
1+
= Downloading the SLSA provenance
22

3-
Generally speaking, link:https://github.com/in-toto/attestation/blob/main/spec/README.md#in-toto-attestation-framework-spec[attestations] are authenticated metadata about software artifacts. An identity (and their private cryptographic key) are required to create an attestation for a software artifact. The primary attestation that {ProductName} generates is the SLSA provenance which is produced by link:https://tekton.dev/docs/concepts/supply-chain-security/[Tekton Chains]. This provenance contains information from the PipelineRun that generated the attested artifact including input parameters for the Tasks as well as Task results.
3+
We are committed to providing exceptional build-time security with {ProductName}. As part of that commitment, {ProductName} conforms to the link:https://slsa.dev/spec/v1.0/levels#build-l3[SLSA Build Level 3] requirements. This includes providing transparency into the steps taken for all artifact builds by generating link:https://slsa.dev/spec/v1.0/provenance[SLSA provenance].
44

5-
After you have found the image for a xref:/how-tos/creating.adoc#finding-the-built-image[recently completed build pipeline] and exported the value to the `IMAGE` environment variable, you are ready to start exploring the information stored in the attestations.
6-
7-
== Inspect the SLSA provenance
8-
9-
Tekton Chains produces a very detailed SLSA provenance. If we were to look at the output from the following provenance, we would find that it is over 2800 lines long!
10-
11-
[source]
12-
--
13-
$ cosign download attestation $IMAGE | jq -r '.payload | @base64d | fromjson' | head
14-
{
15-
"_type": "https://in-toto.io/Statement/v0.1",
16-
"predicateType": "https://slsa.dev/provenance/v0.2",
17-
"subject": [
18-
{
19-
"name": "quay.io/redhat-user-workloads/rhtap-integration-tenant/oras-container/oras-container",
20-
"digest": {
21-
"sha256": "5d0a8a5535fcc4ba467264cacbdeab2fb8662a538a61cb7fc8b3155e3f20fa39"
22-
}
23-
},
24-
--
25-
26-
Therefore, it will likely be convenient to use tools like `jq` to further filter the provenance to identify smaller sets of relevant information.
27-
28-
=== Identify the build parameters
29-
30-
Since the SLSA provenance includes metadata about the input parameters, we can use it to view the parameters for the Tekton PipelineRun including its source repository!
31-
32-
[source]
33-
--
34-
$ cosign download attestation $IMAGE | jq -r '.payload | @base64d | fromjson | .predicate.invocation.parameters'
35-
{
36-
"build-args-file": "",
37-
"build-source-image": "false",
38-
"dockerfile": "Containerfile",
39-
"git-url": "https://github.com/konflux-ci/oras-container",
40-
"hermetic": "false",
41-
"image-expires-after": "",
42-
"java": "false",
43-
"output-image": "quay.io/redhat-user-workloads/rhtap-integration-tenant/oras-container/oras-container:477ee20f7e6d146ea203c4aaa0507f4d1e925a53",
44-
"path-context": ".",
45-
"prefetch-input": "",
46-
"rebuild": "false",
47-
"revision": "477ee20f7e6d146ea203c4aaa0507f4d1e925a53",
48-
"skip-checks": "false"
49-
}
50-
--
5+
We have also provided the following procedure for you to actually access the SLSA provenace that {ProductName} generates for each of your xref:../glossary/index.adoc#component[components]. Follow the instructions below to download your SLSA provenance.
516

527
.Prerequisites
538

@@ -152,6 +107,11 @@ Example output:
152107
"payloadType",
153108
"signatures"
154109
]
110+
[
111+
"payload",
112+
"payloadType",
113+
"signatures"
114+
]
155115
--
156116
157117
+
@@ -170,16 +130,13 @@ Example output:
170130
📦 Supply Chain Security Related artifacts for an image: quay.io/redhat-user-workloads/rhn-support-csears-tenant/demo-build/partner-catalog-build-ucmg@sha256::<output omitted>
171131
└── 💾 Attestations for an image tag: quay.io/redhat-user-workloads/rhn-support-csears-tenant/demo-build/partner-catalog-build-ucmg:sha256-:<output omitted>.att
172132
├── 🍒 sha256::<output omitted>
133+
└── 🍒 sha256::<output omitted>
173134
└── 🔐 Signatures for an image tag: quay.io/redhat-user-workloads/rhn-support-csears-tenant/demo-build/partner-catalog-build-ucmg:sha256-:<output omitted>.sig
174135
└── 🍒 sha256::<output omitted>
175136
└── 📦 SBOMs for an image tag: quay.io/redhat-user-workloads/rhn-support-csears-tenant/demo-build/partner-catalog-build-ucmg:sha256-:<output omitted>.sbom
176137
└── 🍒 sha256:<output omitted>
177138
--
178139
179-
== Inspecting the downloaded provenance
180-
181-
The generated provenance includes information from the Tekton PipelineRun that generated the attested artifact. It
182-
183140
== Additional resources
184141
* Learn about the SLSA framework and xref:/index.adoc#supply-chain-security-through-slsa-conformity[how {ProductName} meets the requirements of SLSA Build Level 3].
185142
* Red Hat's Enterprise Contract (EC) is a powerful tool that you can also use to verify your SLSA provenance; visit link:https://enterprisecontract.dev/docs/user-guide/main/cli.html#_validating_an_image[this page] to learn how to use the EC CLI tool to verify your provenance. You will need the public key used by Tekton Chains, which you can find by following link:https://enterprisecontract.dev/docs/user-guide/main/cli.html#_finding_the_public_key[these instructions].

docs/modules/ROOT/pages/how-tos/metadata/sboms.adoc

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
= Inspecting artifact SBOMs
1+
= Inspecting SBOMs
22

3+
== Software bill of materials
34
A software bill of materials (SBOM) provides greater transparency for your software supply chain. {ProductName} provides link:https://www.cisa.gov/sites/default/files/2023-04/sbom-types-document-508c.pdf[build SBOMs], which list all the software libraries that a component uses. Those libraries can enable specific functionality or facilitate development.
45

56
You can use an SBOM to better understand the composition of your software. In particular, you can use various tools to scan your SBOM and determine if any of your dependencies have known vulnerabilities. Furthermore, to comply with cybersecurity regulations, your organization might need to provide its customers with the SBOM for your application's components. For example, in the United States, the link:https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/[Executive Order on Improving the Nation's Cybersecurity] requires vendors to provide SBOMs, and in Europe, the link:https://www.cisa.gov/sites/default/files/2023-09/EU%20Commission%20SBOM%20Work_508c.pdf[Cyber Resilience Act] does the same.
@@ -37,20 +38,52 @@ The SBOM is unsigned so there is no way to verify whether it has been tampered w
3738

3839
* xref:/getting-started/cli.adoc[Login] to {ProductName}.
3940

40-
* You have found the image for a xref:/how-tos/creating.adoc#finding-the-built-image[recently completed build pipeline] and exported the value to the `IMAGE` environment variable.
41-
4241
.Procedure
4342

4443
In the CLI, complete the following steps to download the SBOM for a component:
4544

46-
. Use Cosign to download the SBOM. Pass the IMAGE environment variable as an argument into Cosign's `download sbom` command.
45+
. List your components.
46+
+
47+
[source]
48+
----
49+
$ oc get components
50+
----
51+
+
52+
.Example output
53+
+
54+
[source]
55+
----
56+
NAME AGE STATUS REASON TYPE
57+
devfile-sample-go-basic-8wqt 8m54s True OK Updated
58+
devfile-sample-python-basic-ikch 20d True OK Updated
59+
----
60+
61+
. Choose which component's SBOM you want to download. Then use `oc get` and the jq CLI tool to get the component image path.
62+
63+
+
64+
[source]
65+
----
66+
$ oc get component <component name> -ojson | jq '.status.containerImage'
67+
----
68+
69+
+
70+
.Example
71+
72+
+
73+
[source]
74+
----
75+
$ oc get component devfile-sample-python-basic-ikch -ojson | jq '.status.containerImage'
76+
"quay.io/redhat-appstudio/user-workload@sha256:<sha-digest>"
77+
----
78+
79+
. Use Cosign to download the SBOM. From the output of the last command, pass the image path as an argument into Cosign's `download sbom` command. Be sure to delete any quotation marks around the image path.
4780

4881
+
4982
.Example
5083
+
5184
[source]
5285
----
53-
$ cosign download sbom $IMAGE
86+
$ cosign download sbom quay.io/redhat-appstudio/user-workload@sha256:<sha-digest>
5487
----
5588

5689
+
@@ -59,7 +92,7 @@ $ cosign download sbom $IMAGE
5992
+
6093
[source]
6194
----
62-
$ cosign download sbom $IMAGE > sbom.txt
95+
$ cosign download sbom quay.io/redhat-appstudio/user-workload@sha256:<sha-digest> > sbom.txt
6396
----
6497

6598
== Reading the SBOM

docs/modules/ROOT/pages/index.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,8 @@ a|In {ProductName}:
190190

191191
== Additional resources
192192

193-
* Learn xref:../how-tos/metadata/index.adoc[how to inspect the SLSA] provenance for your components.
193+
* Learn xref:../how-tos/metadata/provenance.adoc[how to inspect the SLSA] provenance for your components.
194194
* Visit the link:https://slsa.dev/spec/v1.0/[SLSA overview page], the link:https://slsa.dev/spec/v1.0/levels[Build Levels] page, or the link:https://slsa.dev/spec/v1.0/verifying-systems[verifying build platforms] page.
195+
196+
//xref to be double-checked before the release
197+
//OLD * Learn xref:../how-to-guides/Secure-your-supply-chain/proc_inspect-slsa-provenance.adoc[how to inspect the SLSA] provenance for your components.

0 commit comments

Comments
 (0)