Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLSA v1.0: Add "Verifying Build Systems" #568

Merged
merged 19 commits into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/spec/v1.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ in the menu at the top of the page.
| [Guiding principles](principles.md) | Background on the guiding principles behind SLSA. |
| [Terminology](terminology.md) | Terminology and model used by SLSA. |
| [Requirements](requirements.md) | Detailed technical requirements, intended for system implementers. |
| [Verifying Build Systems](verifying_systems.md) | Guidelines for securing SLSA Build L3+ builders, intended for system implementers. |
| [Verifying build systems](verifying_systems.md) | Guidelines for securing SLSA Build L3+ builders, intended for system implementers. |
| [Threats & mitigations](threats.md) | Specific supply chain attacks and how SLSA helps. |
| [FAQ](faq.md) | Questions and more information. |
73 changes: 42 additions & 31 deletions docs/spec/v1.0/verifying_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,74 +14,84 @@ This diagram represents a successful attack:

![image](slsa_attack.png)
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved

Note: Platform abuse and attacks against builder availability are out of scope of this document.
Note: Platform abuse (e.g. running non-build workloads) and attacks against builder availability are out of scope of this document.

TODO: Align/cross-reference with SLSA Provenance Model.
TODO: Redraw diagrams in the style used by the rest of the site.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarkLodato who has created the diagrams before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a design firm (Projects by IF) draw them initially, and then I have since updated them. It's in Figma format, with the source at https://github.com/slsa-framework/slsa/tree/main/resources/editable-diagrams. You can create a free account. Figma has a bit of a learning curve, but it has a lot of features for power users, such as components.

Sadly there is no clean version control integration, so I just download the .fig file and check it in whenever I update the diagram, which is as light pain.

For this PR, I think any diagram is fine, then we can clean it up once we get close to publishing.

MarkLodato marked this conversation as resolved.
Show resolved Hide resolved

### Types of attackers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this list of attacker profiles, but the rest of the doc doesn't seem to use it. That seems like a missing piece, though I can't figure out exactly what's missing.

Maybe it's that the SLSA Build requirements are designed to protect against Low and Medium attackers, while protecting against High attackers is very complex and we need this "verifying systems" piece to convince consumers that they've done a good enough job?


We consider three attacker profiles differentiated by the attacker's capabilities and privileges.
We consider three attacker profiles differentiated by the attacker's capabilities and privileges as related to the build they wish to subvert (the "target build").

#### Low privilege
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you thought about just calling these:

  • Everyone else (low privilege)
  • Project maintainer (medium privilege)
  • Build service admin (high privilege)

It seems like the rest of the doc does not use the low/medium/high profile terms anyway. Perhaps the alternates are easier to work in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to the alternatives

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering private projects, I'd recommend to not use "Everyone else" rather something like "Developer" or "Contributor". I feel this could help apply for both public and private projects.

  • 1 for alternatives though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New wording is "Project contributors". (But it should be singular.)

But that seems overly narrow. An attacker could be someone who is not a contributor at all, no?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, we are talking about someone who is able to execute the capabilities:

Capabilities:

  • Create builds on the build service. These are the attacker's controlled builds.
  • Modify one or more controlled builds' external parameters.
  • Modify one or more controlled builds' environments and run arbitrary code inside those environments.
  • Read the target build's source repo.
  • Fork the target build's source repo.
  • Modify a fork of the target build's source repo and build from it.

I suppose they are an "Authenticated User" with those abilities. That would satisfy my concern about private / public projects.


- Examples
- Anyone on the internet
- Build platform insiders without administrative access
- Build servec insiders without administrative access
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "Build service"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


- Capabilities
- Create builds on the build platform.
- Modify their builds' external parameters.
- Modify their builds' environments and run arbitrary code inside those environments.
- Read the source repo.
- Fork the source repo. Modify their fork and build from it.
- Access builder maintainers' intranet or other internal communications (e.g. email, design documents)
- Create builds on the build service. These are the attacker's controlled builds.
- Modify one or more controlled builds' external parameters.
- Modify one or more controlled builds' environments and run arbitrary code inside those environments.
- Read the target build's source repo.
- Fork the target build's source repo.
- Modify a fork of the target build's source repo and build from it.
- Access builder maintainers' intranet or other internal communications (e.g. email, design documents).
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved

#### Medium privilege

- Examples
- Project maintainer

- Capabilities
- All listed under "low privilege"
- Create new builds in the package's build project
- Modify the source repo and build from it.
- All listed under "low privilege".
- Create new builds under the target build's project or identity.
- Modify the target build's source repo and build from it.
- Modify the target build's configuration.

#### High privilege

- Examples
- Build platform admin
- Build service admin

- Capabilities
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved
- All listed under "low privilege"
- Run arbitrary code on the build platform
- Read and modify network traffic
- All listed under "low privilege" and "medium privilege".
- Run arbitrary code on the build service.
- Read and modify network traffic.
- Access the control plane's cryptographic secrets.
- Remotely access build executors (e.g. via SSH).

TODO: List other high-privilege capabilities.
TODO: Maybe differentiate between unilateral and non-unilateral privileges.

## Build Model

The build model consists of five components: parameters, the build platform, one or more build executors, a build cache, and output storage. The data flow between these components is shown in the diagram below.
The build model consists of five components: parameters, the control plane, one or more build executors, a build cache, and output storage. The data flow between these components is shown in the diagram below.

![image](slsa_build_model.png)
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved

TODO: Align with provenance and build models.

The following sections detail each element of the build model and prompts for assessing its ability to produce SLSA Build L3 provenance.

### Parameters
### External Parameters

Parameters are the external interface to the builder. They must include references to the source to be built and the build definition/script to be executed. They may include instructions to the build platform for how to create the build executor (e.g. which operating system to use). They may include additional strings to pass to the build executor.
External parameters are the external interface to the builder and include all inputs to the build process. Examples include the source to be built, the build definition/script to be executed, user-provided instructions to the control plane for how to create the build executor (e.g. which operating system to use), and any additional user-provided strings.

#### Prompts for Assessing Parameters
#### Prompts for Assessing External Parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also: What gives us confidence that there are no additional external parameters that are missing from the provenance, and that a future design change will not violate SLSA assumptions?

(I ask because the new GHA Variables is exactly this type of design change.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


- How does the platform process user-provided parameters? Examples: sanitizing, parsing, not at all
- Which parameters are processed by the control plane and which are processed by the executor?
- What sort of parameters does the control plane accept for executor configuration?
- How does the control plane process user-provided external parameters? Examples: sanitizing, parsing, not at all
- Which external parameters are processed by the control plane and which are processed by the executor?
- What sort of external parameters does the control plane accept for executor configuration?

### Control Plane
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved

The build platform is the control plane that orchestrates each independent build execution. It is responsible for setting up each build and cleaning up afterwards. The platform must generate and sign provenance for each SLSA Build L3+ build performed on the system. The platform is operated by one or more administrators, who have privileges to modify the platform.
The control plane is the build system component that orchestrates each independent build execution. It is responsible for setting up each build and cleaning up afterwards. The control plane generates and signs provenance for each SLSA Build L3+ build performed on the system. The control plane is operated by one or more administrators, who have privileges to modify the control plane.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The control plane is the build system component that orchestrates each independent build execution. It is responsible for setting up each build and cleaning up afterwards. The control plane generates and signs provenance for each SLSA Build L3+ build performed on the system. The control plane is operated by one or more administrators, who have privileges to modify the control plane.
The control plane is the build system component that orchestrates each independent build execution. It is responsible for setting up each build and cleaning up afterwards. At SLSA Build L3+ the control plane generates and signs provenance for each build performed on the system. The control plane is operated by one or more administrators, who have privileges to modify the control plane.

I'm worried that folks could read the original phrasing as only L3+ builds are signed, but maybe I'm being overly pessimistic here. My suggestion may not actually help either. :-D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, though I used L2+ since that's when the service starts signing provenance.


#### Prompts for Assessing Control Planes

- Administration
- What are they ways an employee can use privileged access to influence a build or provenance generation? Examples: physical access, terminal access, access to cryptographic secrets
- What are the ways an employee can use privileged access to influence a build or provenance generation? Examples: physical access, terminal access, access to cryptographic secrets
- What controls are in place to detect or prevent the employee from abusing such access? Examples: two-person approvals, audit logging, workload identities
- Roughly how many employees have such access?
- How are privileged accounts protected? Examples: two-factor authentication, client device security policies
Expand All @@ -100,26 +110,27 @@ The build platform is the control plane that orchestrates each independent build
- Creating executors
- How does the control plane share data with executors? Example: mounting a shared file system partition
- How does the control plane protect its integrity from executors? Example: not mount its own file system partitions on executors
- How does the control plane prevent executors from accessing its cryptographic secrets? Examples: dedicated secret storage, not mounting its own file system partitions on executors
- How does the control plane prevent executors from accessing its cryptographic secrets? Examples: dedicated secret storage, not mounting its own file system partitions on executors, hardware security modules

- Managing cryptographic secrets
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved
- How do you store the control plane's cryptographic secrets?
- How do you store the control plane's cryptographic secrets?
- Which parts of the organization have access to the control plane's cryptographic secrets?
- What controls are in place to detect or prevent employees abusing such access? Examples: two-person approvals, audit logging
- How frequently are cryptographic secrets rotated? Describe the rotation process.
- How are secrets protected in memory? Examples: secrets are stored in hardware security modules and backed up in secure cold storage
- How frequently are cryptographic secrets rotated? Describe the rotation process.
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved
- What is your plan for remediating cryptographic secret compromise? How frequently is this plan tested?

### Executor

The build executor is the independent execution environment where the build takes place. Each executor must be isolated from the build platform and from all other executors. Build users are free to modify the environment inside the executor arbitrarily. Build executors must have a means to fetch input artifacts (source, dependencies, etc).
The build executor is the independent execution environment where the build takes place. Each executor must be isolated from the control plane and from all other executors. Build users are free to modify the environment inside the executor arbitrarily. Build executors must have a means to fetch input artifacts (source, dependencies, etc).

#### Prompts for Assessing Executors

- Isolation technologies
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved
MarkLodato marked this conversation as resolved.
Show resolved Hide resolved
- How are executors isolated from the control plane and each other? Examples: VMs, containers, sandboxed processes
- How have you hardened your executors against malicious tenants? Examples: configuration hardening, limiting attack surface
- How frequently do you update your isolation software?
- What is your process for responding to platform vulnerability disclosures? What about vulnerabilities in your dependencies?
- What is your process for responding to vulnerability disclosures? What about vulnerabilities in your dependencies?

- Creation and destruction
- What environment is available in executors on creation? How were the elements of this environment chosen?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to append an example for what you'd expect an answer for "What environment is available"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Expand All @@ -137,7 +148,7 @@ Builders may have zero or more caches to store frequently used dependencies. Bui

- What sorts of caches are available to build executors?
- How are those caches populated?
- How do you defend against cache poisoning attacks? Example: content-addressable storage
- How do you defend against cache poisoning attacks?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might re-phrase this as "How are cache contents validated before use?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


### Output Storage

Expand Down