|
| 1 | ++++ |
| 2 | +title = "How FRSCA is meeting SLSA levels 1-3" |
| 3 | +description = "A document describing how FRSCA is meeting SLSA compliance, specifically levels 1-3" |
| 4 | +date = 2023-02-07T08:20:00+00:00 |
| 5 | +updated = 2023-02-07T08:20:00+00:00 |
| 6 | +draft = false |
| 7 | +weight = 20 |
| 8 | +sort_by = "weight" |
| 9 | +template = "docs/page.html" |
| 10 | + |
| 11 | +[extra] |
| 12 | +toc = true |
| 13 | +top = false |
| 14 | ++++ |
| 15 | + |
| 16 | +## Reminder on SLSA levels |
| 17 | + |
| 18 | +SLSA levels at a high level are as follows (table from |
| 19 | +[https://slsa.dev/spec/v0.1/levels#summary-of-levels](https://slsa.dev/spec/v0.1/levels#summary-of-levels)): |
| 20 | + |
| 21 | +| **Level** | **Description** | **Example** | |
| 22 | +| --------- | -------------------------------------- | ----------------------------------------------------- | |
| 23 | +| 1 | Documentation of the build process | Unsigned provenance | |
| 24 | +| 2 | Tamper resistance of the build service | Hosted source/build, signed provenance | |
| 25 | +| 3 | Extra resistance to specific threats | Security controls on host, non-falsifiable provenance | |
| 26 | +| 4 | Highest levels of confidence and trust | Two-party review + hermetic builds | |
| 27 | + |
| 28 | +The full requirements table can be found here: |
| 29 | + |
| 30 | +[Requirements](https://slsa.dev/spec/v0.1/requirements#summary-table) |
| 31 | + |
| 32 | +## sample-pipeline |
| 33 | + |
| 34 | +```other |
| 35 | +frsca/examples/sample-pipeline |
| 36 | +``` |
| 37 | + |
| 38 | +For the purposes of this document, we're going to be comparing SLSA requirements |
| 39 | +to what we are deploying via the sample-pipeline. Please read |
| 40 | +`frsca/examples/sample-pipeline/README.md` for information on setting up FRSCA |
| 41 | +and the sample pipeline. |
| 42 | + |
| 43 | +# SLSA 1 Requirements |
| 44 | + |
| 45 | +1. Build - |
| 46 | + [Scripted build](https://slsa.dev/spec/v0.1/requirements#scripted-build) |
| 47 | + **✅** |
| 48 | +2. Provenance - [Available](https://slsa.dev/spec/v0.1/requirements#available) |
| 49 | + ✅ |
| 50 | + |
| 51 | +`sample-pipeline` meets both of these requirements. The build is scripted, which |
| 52 | +is evident in following individual steps from the `Makefile` down through the |
| 53 | +various shell scripts which setup the FRSCA environment and trigger the build |
| 54 | +via Tekton Pipelines. |
| 55 | + |
| 56 | +Because we're using Tekton Chains in conjunction with Tekton Pipelines, |
| 57 | +provenance is created and available, satisfying the last requirement of SLSA 1. |
| 58 | + |
| 59 | +To prove, once the pipeline completes: |
| 60 | + |
| 61 | + ```bash |
| 62 | + > crane ls "$(echo -n ${IMAGE_URL} | sed 's|:[^/]*$||')" |
| 63 | + |
| 64 | + 0066d00de427d12b9a14e56f02f302031d9c40f3 |
| 65 | + sha256-e6dc8ea1ff666893462b64d997d496af8e69e905f2eeaf2ab7ec1fd565921d46.att |
| 66 | + sha256-e6dc8ea1ff666893462b64d997d496af8e69e905f2eeaf2ab7ec1fd565921d46.sbom |
| 67 | + sha256-e6dc8ea1ff666893462b64d997d496af8e69e905f2eeaf2ab7ec1fd565921d46.sig |
| 68 | + ``` |
| 69 | + |
| 70 | +# SLSA 2 Requirements |
| 71 | + |
| 72 | +1. Source - |
| 73 | + [Version controlled](https://slsa.dev/spec/v0.1/requirements#version-controlled) |
| 74 | + ✅\* |
| 75 | +2. Build - |
| 76 | + [Build service](https://slsa.dev/spec/v0.1/requirements#build-service) ✅ |
| 77 | +3. Provenance - |
| 78 | + [Authenticated](https://slsa.dev/spec/v0.1/requirements#authenticated) ✅ |
| 79 | +4. Provenance - |
| 80 | + [Service generated](https://slsa.dev/spec/v0.1/requirements#service-generated) |
| 81 | + ✅ |
| 82 | + |
| 83 | +SLSA 2 introduces four new requirements in addition to the requirements of SLSA |
| 84 | +1, all of which are being met by this sample pipeline. |
| 85 | + |
| 86 | +1. In this example, the original source code is version controlled. |
| 87 | + |
| 88 | + - It is up to the consumer of FRSCA to ensure they are following proper |
| 89 | + source requirements. |
| 90 | + |
| 91 | +1. The build is being performed within a TaskRun in a Tekton Pipelines |
| 92 | + PipelineRun. |
| 93 | +1. Provenance is not ony available, but it is authenticated. |
| 94 | + |
| 95 | + ```bash |
| 96 | + > cosign verify --key k8s://tekton-chains/signing-secrets "${IMAGE_URL}" |
| 97 | + |
| 98 | + Verification for ttl.sh/6b1d3c200c0fe4005da60bddc63873ef/example-sample:919eef3dd425318e9a65cb79b00ee323210ef070 -- |
| 99 | + The following checks were performed on each of these signatures: |
| 100 | + - The cosign claims were validated |
| 101 | + - The signatures were verified against the specified public key |
| 102 | + |
| 103 | + > cosign verify-attestation --type slsaprovenance --key k8s://tekton-chains/signing-secrets "${IMAGE_URL}" |
| 104 | + |
| 105 | + Verification for ttl.sh/6b1d3c200c0fe4005da60bddc63873ef/example-sample:919eef3dd425318e9a65cb79b00ee323210ef070 -- |
| 106 | + The following checks were performed on each of these signatures: |
| 107 | + - The cosign claims were validated |
| 108 | + - The signatures were verified against the specified public key |
| 109 | + ``` |
| 110 | + |
| 111 | +1. Tekton Chains observes Tekton Pipelines TaskRuns outputting an OCI image and |
| 112 | + generates provenance directly from the data it obtains, so we're satisfying |
| 113 | + service generated requirements. |
| 114 | +
|
| 115 | +# SLSA 3 Requirements |
| 116 | +
|
| 117 | +1. Source - |
| 118 | + [Verified history](https://slsa.dev/spec/v0.1/requirements#verified-history) |
| 119 | + ✅\* |
| 120 | +2. Source - |
| 121 | + [Retained indefinitely](https://slsa.dev/spec/v0.1/requirements#retained-indefinitely) |
| 122 | + (18 mo. for SLSA 3) ✅\* |
| 123 | +3. Build - |
| 124 | + [Build as code](https://slsa.dev/spec/v0.1/requirements#build-as-code) ✅ |
| 125 | +4. Build - |
| 126 | + [Ephemeral environment](https://slsa.dev/spec/v0.1/requirements#ephemeral-environment) |
| 127 | + ✅ |
| 128 | +5. Build - [Isolated](https://slsa.dev/spec/v0.1/requirements#isolated) ✅ |
| 129 | +6. Provenance - |
| 130 | + [Non-falsifiable](https://slsa.dev/spec/v0.1/requirements#non-falsifiable) |
| 131 | + (in progress) |
| 132 | +
|
| 133 | +Requirements 1 & 2 are asterisked due to the lack of control the FRSCA platform |
| 134 | +has around the source code management platforms leveraged by the end user. |
| 135 | +
|
| 136 | +1. See above. |
| 137 | +2. See above. |
| 138 | +3. Every step in the end-to-end build process via Tekton is described as code. |
| 139 | +4. Tasks are executed within a Pod that is specifically tied to that particular |
| 140 | + TaskRun, and when the TaskRun is complete, the Pod is not reused. |
| 141 | +
|
| 142 | + ```bash |
| 143 | + example-sample-pipeline-7mvgr-clone-repo-pod 0/1 Completed 0 44h |
| 144 | + example-sample-pipeline-7mvgr-build-and-push-image-pod 0/2 Completed 0 44h |
| 145 | + example-sample-pipeline-7mvgr-vulnerability-scan-pod 0/1 Completed 0 44h |
| 146 | + example-sample-pipeline-7mvgr-generate-bom-pod 0/2 Completed 0 44h |
| 147 | + example-sample-pipeline-7mvgr-deploy-to-cluster-pod 0/2 Completed 0 44h |
| 148 | + ``` |
| 149 | +
|
| 150 | +5. In the same vein, the build process within a PipelineRun is completely |
| 151 | + isolated from other PipelineRuns, and TaskRuns within a PipelineRun also do |
| 152 | + not share data between each other unless explicitly defined. |
| 153 | +6. Non-falsifiable provenance support by means of SPIFFE/SPIRE is currently in |
| 154 | + development and awaiting approval. See |
| 155 | + [TEP-89](https://github.com/tektoncd/community/blob/main/teps/0089-nonfalsifiable-provenance-support.md) |
| 156 | + for more information. |
0 commit comments