-
Notifications
You must be signed in to change notification settings - Fork 229
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
Build Environment track threats #1267
Comments
Thank you for getting this started @paveliak :) I really like where you're going with this, and it's quite similar to what we had in our very first proposal for this track: Tampering during build environment image generation/distributionAttacks on the generation process of a build image can result in persistent backdoors baked into the build image and therefore result in wide compromise. This can be addressed via L1, and is a specific case of SLSA threat D. Tampering during build executionAn attacker with temporary access to the compute platform during build execution can modify the software or hardware components underlying the build environment to modify build outputs or modify inputs before they are used in the build steps. I think this one is no longer in scope for the BuildEnv track, since it relates to runtime integrity. Tampering at build image boot timeWith temporary access to the compute platform/host system, an attacker may target the instantiation/boot process of the build environment, which could allow them to embed a malicious kernel or build agent with minimal detection ability by the tenant. This can be addressed via L2. Tampering during build dispatchFor performance, build platforms often run a pool of idle build environments waiting to receive a new build job. An attacker with temporary access to the build environment during the period before a build job is started may replace common tools with malicious ones, or start monitoring software that can sniff for secrets used in continuous deployment, or introduce backdoors that can provide more persistent access during the job. This one can be addressed via L3. Two interesting things stand out to me immediately:
|
Requesting to add @paveliak as a maintainer. He contributes as co-shepherd of the attested build environment track, so being able to manage issues and approve PRs in this track would be really helpful. Relevant contributions to the track: * PR review: #1115 (review) * PR review: #1244 (review) * Issue discussion: #1253 * Issue discussion: #1267 * Issue discussion: #1150 Signed-off-by: Marcela Melara <[email protected]>
Build
track defines requirements for the provenance that is generated for the build artifacts. Trustworthiness of the build provenance largely depends on the trustworthiness of the environment the build runs in. Build track assumes full trust into theBuild Platform
providing no solutions to verify build environment integrity.Build Environment
track intends to close this gap.Build environment is bootstrapped from a
build image
, which is expected to be an artifact of a SLSA build pipeline. Build platform verifies image provenance upon starting up the environment and provides evidence to the tenant.Bootrapping the build environment is a complex process, especially at higher SLSA levels. Build L3 usually requires significant changes to existing build platforms to maintain ephemeral build environments. It is not uncommon for the build platforms to rely on public cloud providers for managing compute resources that power build environments. This in turn might significantly increase attack surface because added build platform dependencies effectively become part of the
TCB
.Build Environment
track addresses TCB size concerns atL2
andL3
levels. L1 level assumes full trust into the Build Platform including underlying Compute Platform (eg. public cloud provider). L2 level adds capabilities for verifying Compute Platform. L3 level removes Compute Platform from TCB rooting the trust into the hardware.Threat model
This diagram outlines the lifetime of a build image between it being generated and used for creating a build environment. Image could be compromised at different times (components). Higher SLSA levels secure the build environment from a larger amount of threats.
L1
level protects from threats that happened to the build image in between generating it and passing to theBuild Platform
. This covers cases of unauthorized modifications happening to the image as it is distributed (potentially via untrusted channels).L2
level protects from threats occurring at theBuild Platform
side as it interacts with theCompute Provider
for actually creating a build environment.Control plane
is the onlyBuild Platform
component that is considered trusted atL2
as it performs remote attestation of the build environment.L3
level protects from threats coming from theCompute Provider
. It requires build running in a trusted execution environment using technologies likeAMD SEV
andIntel TDX
.Compute provider
is considered untrusted atL3
with the trust rooted into hardware.NOTE:
Control Plane
is considered trusted atL2
andL3
as it performs remote attestation of the build environment. Build platforms may provide capabilities that let tenants perform remote attestation themselves. However, for theControl Plane
to be considered untrusted it should have no back-door access to the build environment (e.g. viaSSH
). Besides,Control Plane
provides input data to the build environment (i.e. build request message) and security risks associated with compromising inputs have to be considered as well.What follows are the example threats.
Invalid build image
Threat: Wrong image is used for the build environment. This could be a dev/test image or an older version of the image having security vulnerabilities.
Mitigation: Control Plane verifies build image provenance upon creating build environment. Needs
L1
levelExample: Malicious actor gained access to the build image supply chain and was ultimately able to configure the wrong image in the
Build platform
.Root file system integrity
Threat: Malicious software is deployed to the build environment via unauthorized access to the root file system.
Mitigation: Root file system is protected by file system integrity solutions like dm-verity and is measured in the
TPM
. Or the root file system is encrypted with the encryption key released to the build environment after it has passed remote attestation. NeedsL2
level.Example: Malicious actor gained unauthorized access to the build environment root file system and was able to modify it. For a build image that is served remotely via a network file system (
NSF
) or a network block device (NBD
) this could happen if the remote server is compromised or data was compromised at rest.Reused build environment
Threat: Build environment unexpectedly reused across two or more builds
Mitigation: Unique build identifier is included into the Build environment provenance (and
TPM
measurement) allowingControl plane
to detect environment reuse. NeedsL2
levelExample: Due to a bug in the build platform, the environment was used for running two or more jobs and effectively losing “ephemeral” property. Malicious actors could use this vulnerability to poison the build environments they should not have access to.
Continuous integrity of the build environment
Threat: Build environment integrity was compromised due to unauthorized access on the
Compute provider
side.Mitigation: Trusted execution environment provided by hardware-assisted mechanisms like
AMD SEV
andIntel TDX
secures access to the build environment state even in the event of a fully compromised compute provider. RequiresL3
level.Example: Malicious actor (potentially a rogue administrator) was able to retrieve encryption secrets from the build environment memory and modify contents of the root or temporary file system (used to store transient data including build artifacts).
CC @marcelamelara
The text was updated successfully, but these errors were encountered: