You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spec/draft/source-requirements.md
+53-35Lines changed: 53 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Source: Requirements for producing source"
3
-
description: "This page covers the detailed technical requirements for producing producing source revisions at each SLSA level. The intended audience is source control system implementers and security engineers."
3
+
description: "This page covers the detailed technical requirements for producing source revisions at each SLSA level. The intended audience is source control system implementers and security engineers."
4
4
---
5
5
6
6
## Objective
@@ -23,7 +23,7 @@ The following terms apply to Version Control Systems:
23
23
| Term | Description
24
24
| --- | ---
25
25
| Source Repository (Repo) | A self-contained unit that holds the content and revision history for a set of files, along with related metadata like Branches and Tags.
26
-
| Source Revision | A specific, logically immutable snapshot of the repository's tracked files. It is uniquely identified by a revision identifier, such as a cryptographic hash like a Git commit SHA or a path-qualified sequential number like `25@trunk/` in SVN. A Source Revision includes both the content (the files) and its associated version control metadata, such as the author, timestamp, and parent revision(s). Note: Path qualification is needed for version control systems that use represent Branches and Tags using paths, such as Subversion and Perforce.
26
+
| Source Revision | A specific, logically immutable snapshot of the repository's tracked files. It is uniquely identified by a revision identifier, such as a cryptographic hash like a Git commit SHA or a path-qualified sequential number like `25@trunk/` in SVN. A Source Revision includes both the content (the files) and its associated version control metadata, such as the author, timestamp, and parent revision(s). Note: Path qualification is needed for version control systems that represent Branches and Tags using paths, such as Subversion and Perforce.
27
27
| Named Reference | A user-friendly name for a specific source revision, such as `main` or `v1.2.3`.
28
28
| Change | A modification to the state of the Source Repository, such as creation of a new Source Revision based on a previous Source Revision, or creation, deletion, or modification of a Named Reference.
29
29
| Change History | A record of the history of Source Revisions that preceded a specific revision.
@@ -60,7 +60,7 @@ The following terms apply to Source Control Systems:
60
60
| --- | ---
61
61
| Administrator | A human who can perform privileged operations on one or more projects. Privileged actions include, but are not limited to, modifying the change history and modifying project- or organization-wide security policies.
62
62
| Trusted person | A human who is authorized by the organization to propose and approve changes to the source.
63
-
| Trusted robot | Automation authorized by the organization to act in explicitly defined contexts. The Robot’s identity and codebase cannot be unilaterally influenced.
63
+
| Trusted robot | Automation authorized by the organization to act in explicitly defined contexts. The robot’s identity and codebase cannot be unilaterally influenced.
64
64
| Untrusted person | A human who has limited access to the project. They MAY be able to read the source. They MAY be able to propose or review changes to the source. They MAY NOT approve changes to the source or perform any privileged actions on the project.
65
65
66
66
## Onboarding
@@ -182,13 +182,13 @@ Many examples in this document use the [git version control system](https://git-
<trid="choose-scs"><td>Choose an appropriate source control system <ahref="#choose-scs">🔗</a><td>
185
+
<trid="choose-scs"><td>Choose an appropriate Source Control System <ahref="#choose-scs">🔗</a><td>
186
186
187
-
An organization producing source revisions MUST select a SCS capable of reaching
187
+
An organization producing Source Revisions MUST select an SCS capable of reaching
188
188
their desired SLSA Source Level.
189
189
190
190
> For example, if an organization wishes to produce revisions at Source Level 3,
191
-
they MUST choose a source control system capable of producing Source Level 3
191
+
they MUST choose a Source Control System capable of producing Source Level 3
192
192
attestations.
193
193
194
194
<td>✓<td>✓<td>✓<td>✓
@@ -236,30 +236,49 @@ determine if that expectation has been met by looking for the
236
236
237
237
<trid="safe-expunging-process"><td>Safe Expunging Process <ahref="#safe-expunging-process">🔗</a><td>
238
238
239
-
SCSs MAY allow the organization to expunge (remove) content from a repository and its change history without leaving a public record of the removed content,
240
-
but the organization MUST only allow these changes in order to meet legal or privacy compliance requirements.
241
-
Content changed under this process includes changing files, history, references, or any other metadata stored by the SCS.
239
+
SCSs MAY allow the organization to expunge (remove) content from a repository
240
+
and its change history without leaving a public record of the removed content,
241
+
but the organization MUST only allow these changes in order to meet legal or
242
+
privacy compliance requirements. Content changed under this process includes
243
+
changing files, history, references, or any other metadata stored by the SCS.
242
244
243
245
#### Warning
244
246
245
-
Removing a revision from a repository is similar to deleting a package version from a registry: it's almost impossible to estimate the amount of downstream supply chain impact.
246
-
> For example, in Git, each revision ID is based on the ones before it. When you remove a revision, you must generate new revisions (and new revision IDs) for any revisions that were built on top of it. Consumers who took a dependency on the old revisions may now be unable to refer to the revision they've already integrated into their products.
247
+
Removing a revision from a repository is similar to deleting a package version
248
+
from a registry: it's almost impossible to estimate the amount of downstream
249
+
supply chain impact.
247
250
248
-
It may be the case that the specific set of changes targeted by a legal takedown can be expunged in ways that do not impact consumed revisions, which can mitigate these problems.
251
+
> For example, in Git, each revision ID is based on the ones before it.
252
+
When you remove a revision, you must generate new revisions (and new revision IDs)
253
+
for any revisions that were built on top of it. Consumers who took a dependency
254
+
on the old revisions may now be unable to refer to the revision they've already
255
+
integrated into their products.
249
256
250
-
It is also the case that removing content from a repository won't necessarily remove it everywhere.
251
-
The content may still exist in other copies of the repository, either in backups or on developer machines.
257
+
It may be the case that the specific set of changes targeted by a legal takedown
258
+
can be expunged in ways that do not impact consumed revisions, which can mitigate
259
+
these problems.
260
+
261
+
It is also the case that removing content from a repository won't necessarily
262
+
remove it everywhere.
263
+
The content may still exist in other copies of the repository, either in backups
264
+
or on developer machines.
252
265
253
266
#### Process
254
267
255
-
An organization MUST document the Safe Expunging Process and describe how requests and actions are tracked and SHOULD log the fact that content was removed.
256
-
Different organizations and tech stacks may have different approaches to the problem.
268
+
An organization MUST document the Safe Expunging Process and describe how
269
+
requests and actions are tracked and SHOULD log the fact that content was
270
+
removed. Different organizations and tech stacks may have different approaches
271
+
to the problem.
257
272
258
-
SCSs SHOULD have technical mechanisms in place which require an Administrator plus, at least, one additional 'trusted person' to trigger any expunging (removals) made under this process.
273
+
SCSs SHOULD have technical mechanisms in place which require an Administrator
274
+
plus at least one additional 'trusted person' to trigger any expunging
275
+
(removals) made under this process.
259
276
260
-
The application of the safe expunging process and the resulting logs MAY be private to both prevent calling attention to potentially sensitive data (e.g. PII) or to comply with local laws
261
-
and regulations which may require the change to be kept private to the extent possible.
262
-
Organizations SHOULD prefer to make logs public if possible.
277
+
The application of the safe expunging process and the resulting logs MAY be
278
+
private to both prevent calling attention to potentially sensitive data (e.g.
279
+
PII) or to comply with local laws and regulations which may require the change
280
+
to be kept private to the extent possible. Organizations SHOULD prefer to make
281
+
logs public if possible.
263
282
264
283
<td><td>✓<td>✓<td>✓
265
284
@@ -309,7 +328,7 @@ If the SCS DOES NOT generate a VSA for a revision, the revision has Source Level
309
328
At Source Levels 1 and 2 the SCS MAY issue these attestations based on its
310
329
understanding of the underlying system (e.g. based on design docs, security
311
330
reviews, etc...), but at Level 3+ the SCS MUST use
312
-
the SCSissued [source provenance](#source-provenance) when making the issuing
331
+
the SCS-issued [source provenance](#source-provenance) when issuing
313
332
the VSAs.
314
333
315
334
<td>✓<td>✓<td>✓<td>✓
@@ -442,7 +461,7 @@ It is possible that an SCS can make no claims about a particular revision.
442
461
or if the revision was not the result of an accepted change management process.
Changes in protected branches MUST be agreed to by two or more trusted persons prior to submission.
448
467
The following combinations are acceptable:
@@ -462,7 +481,6 @@ still requires review. The exact definition of “context” depends on the proj
462
481
and this does not preclude well-understood automatic merges, such as cutting a release branch.
463
482
464
483
**[Informed Review]** The SCS MUST present reviewers with a clear representation of the result of accepting the proposed change. See [Human Readable Changes](#human-readable-diff).
465
-
the old and new revisions. E.g. by using [the diff tool](#human-readable-diff).
466
484
467
485
**[Trusted Robot Contributions]** An organization MAY choose to grant a Trusted
468
486
Robot a perpetual exception to a policy (e.g. a bot may be able to merge a change
@@ -487,7 +505,7 @@ There are two broad categories of source attestations within the source track:
487
505
2. Source provenance attestations: Provide trustworthy, tamper-proof, metadata with the necessary information to determine what high level security properties a given source revision has.
488
506
489
507
To provide interoperability and ensure ease of use, it's essential that the Source VSAs are applicable across all Source Control Systems.
490
-
However, due to the significant differences in how SCSs operate and how they may chose to meet the Source Track requirements, it is preferable to
508
+
However, due to the significant differences in how SCSs operate and how they may choose to meet the Source Track requirements, it is preferable to
491
509
allow for flexibility with the full source provenance attestations. To that end, SLSA leaves source provenance attestations undefined and up to the SCSs to determine
492
510
what works best in their environment.
493
511
@@ -507,7 +525,7 @@ The source track issues Source VSAs using the [Verification Summary Attestations
507
525
SCSs that do not use cryptographic digests MUST define a canonical type that is used to identify immutable revisions and MUST include the repository within the type[^1].
508
526
- For example: `svn_revision_id: svn+https://svn.myproject.org/svn/MyProject/trunk@2019`
509
527
3.`subject.annotations.sourceRefs` SHOULD be set to a list of references that pointed to this revision when the attestation was created. The list MAY be non-exhaustive.
510
-
- git references MUST be fully qualified (e.g. `refs/head/main` or `refs/tags/v1.0`) to reduce the likelihood of confusing downstream tooling.
528
+
- git references MUST be fully qualified (e.g. `refs/heads/main` or `refs/tags/v1.0`) to reduce the likelihood of confusing downstream tooling.
511
529
4.`resourceUri` MUST be set to the URI of the repository, preferably using [SPDX Download Location](https://spdx.github.io/spdx-spec/v2.3/package-information/#77-package-download-location-field).
512
530
E.g. `git+https://github.com/foo/hello-world`.
513
531
5.`verifiedLevels` MUST include the SLSA source track level the SCS asserts the revision meets. One of `SLSA_SOURCE_LEVEL_0`, `SLSA_SOURCE_LEVEL_1`, `SLSA_SOURCE_LEVEL_2`, `SLSA_SOURCE_LEVEL_3`.
@@ -523,7 +541,7 @@ was code reviewed).
523
541
The SCS MAY embed organization-provided properties within `verifiedLevels`
524
542
corresponding to technical controls enforced by the SCS. If such properties are
525
543
provided they MUST be prefixed with `ORG_SOURCE_` to distinguish them from other
526
-
properties the SCS may wish use.
544
+
properties the SCS may wish to use.
527
545
528
546
-`ORG_SOURCE_` to indicate a property that is meant for consumption by
529
547
external consumers.
@@ -580,8 +598,8 @@ Example implementations:
580
598
581
599
### Source provenance attestations
582
600
583
-
Source provenance attestations provide tamper-proof evidence ([attestation model](attestation-model)))
584
-
that can be used to determine what SLSA Source Level or other highlevel properties a given revision meets.
601
+
Source provenance attestations provide tamper-proof evidence ([attestation model](attestation-model))
602
+
that can be used to determine what SLSA Source Level or other high-level properties a given revision meets.
585
603
This evidence can be used by:
586
604
587
605
- an authority as the basis for issuing a [Source VSA](#source-verification-summary-attestation)
@@ -595,7 +613,7 @@ operate over Subversion repositories.
595
613
These differences also mean that, depending on the configuration, the issuers of provenance attestations may vary from implementation to implementation, often because entities with the knowledge to issue them may vary.
596
614
The authority that issues [Source VSAs](#source-verification-summary-attestation) MUST understand which entity should issue each provenance attestation type, and ensure all source provenance attestations come from their expected issuers.
597
615
598
-
'Source provenance attestations' is a generic term used to refer to any type of attestation that provides evidence the process used to create a revision.
616
+
'Source provenance attestations' is a generic term used to refer to any type of attestation that provides evidence of the process used to create a revision.
599
617
600
618
Example source provenance attestations:
601
619
@@ -623,7 +641,7 @@ revision's properties recorded in the summary attestation.
623
641
In addition to the requirements for SLSA Source L4, most organizations will
624
642
require multiple of these controls as part of their required protections.
625
643
626
-
If an organization has indicated that use of these these controls are part of
644
+
If an organization has indicated that use of these controls is part of
627
645
their repository's expectations, consumers SHOULD be able to verify that the
628
646
process was followed for the revision they are consuming by examining the
629
647
[summary](#source-verification-summary-attestation) or [source
@@ -702,15 +720,15 @@ Requirements:
702
720
703
721
#### Context
704
722
705
-
In many organizations it is normal to review only the "net difference" between the tip of the topic branch and the "best merge base", the closest shared commit between the topic and target branches computed at the time of review.
723
+
In many organizations, it is normal to review only the "net difference" between the tip of the topic branch and the "best merge base", the closest shared commit between the topic and target branches computed at the time of review.
706
724
707
725
The topic branch may contain many commits of which not all were intended to represent a shippable state of the repository.
708
726
709
727
If a repository merges branches with a standard merge commit, all those unreviewed commits on the topic branch will become "reachable" from the protected branch by virtue of the multi-parent merge commit.
710
728
711
729
When a repo is cloned, all commits _reachable_ from the main branch are fetched and become accessible from the local checkout.
712
730
713
-
This combination of factors allows attacks where the victim performs a `git clone` operation followed by a `git reset --hard <unreviewed revision id>`.
731
+
This combination of factors allows attacks where the victim performs a `git clone` operation followed by a `git reset --hard <unreviewed revision ID>`.
714
732
715
733
#### Mitigations
716
734
@@ -738,7 +756,7 @@ Summary:
738
756
The discussion around a change may often be as important as the change itself.
739
757
740
758
Intended for:
741
-
Large organizations, or any where discussion is an important part of the change management process.
759
+
Large organizations, or anywhere discussion is an important part of the change management process.
742
760
743
761
Benefits:
744
762
From any revision, it's possible for future developers to read through the discussion that ultimately produced it.
@@ -766,7 +784,7 @@ If there are problems detected with the contents on the train branch, it's norma
766
784
Approved changes will be re-applied to a new train in this scenario.
767
785
768
786
The key benefit to this approach is that the protected branch remains stable for longer, allowing more time for human and automatic code review.
769
-
A key downside to this approach is that organizations will not know the final revision id that represents a change until the entire train process completes.
787
+
A key downside to this approach is that organizations will not know the final revision ID that represents a change until the entire train process completes.
770
788
771
789
A change review process will now be associated with multiple distinct revisions.
772
790
@@ -776,7 +794,7 @@ A change review process will now be associated with multiple distinct revisions.
776
794
It is important to note that no human or automatic review will have the chance to pre-approve ID2. This will appear to violate any organization policies that require pre-approval of changes before submission.
777
795
The SCS and the organization MUST protect this process in the same way they protect other artifact build pipelines.
778
796
779
-
At a minimum the SCS MUST issue an attestation that the revision id generated by a merged train is identical ("MERGESAME" in git terminology) to the state of the protected branch after applying each approved changeset in sequence.
797
+
At a minimum the SCS MUST issue an attestation that the revision ID generated by a merged train is identical ("MERGESAME" in git terminology) to the state of the protected branch after applying each approved changeset in sequence.
780
798
No other content may be added or removed during this process.
0 commit comments