Skip to content

Commit c49be63

Browse files
authored
Merge pull request #265 from Dstack-TEE/branding
chore: Case sensitive dstack name
2 parents 51b8a44 + fccd83d commit c49be63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+95
-94
lines changed

attestation.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# TEE Attestation Guide for DStack Applications
1+
# TEE Attestation Guide for dstack Applications
22

3-
This document outlines the process of verifying the authenticity and integrity of data produced by DStack Applications running within Intel TDX environments.
3+
This document outlines the process of verifying the authenticity and integrity of data produced by dstack Applications running within Intel TDX environments.
44

55
## 1. Review code safety
66

@@ -11,28 +11,28 @@ This document outlines the process of verifying the authenticity and integrity o
1111
## 2. Validate data origin authenticity
1212
### 2.1 Understanding tdx quote measurements
1313

14-
Applications generate a tdx quote using Dstack's API given the data they want to prove.
14+
Applications generate a tdx quote using dstack's API given the data they want to prove.
1515

1616
The quote signature can be verified using dcap-qvl to confirm its generation by a legitimate TDX CVM and environment trustworthiness.
1717
Following signature verification, examine MRTD and RTMRs to confirm the CVM is executing the verified code.
1818

1919
The MR register values indicate the following:
2020

21-
- MRTD: Contains the virtual firmware measurement, taken by TDX-module in SEAM mode. Virtual firmware (OVMF in Dstack's case) is the first code executed post-CVM startup, serving as the App code's trust anchor. Intel signs and guarantees TDX-module integrity.
21+
- MRTD: Contains the virtual firmware measurement, taken by TDX-module in SEAM mode. Virtual firmware (OVMF in dstack's case) is the first code executed post-CVM startup, serving as the App code's trust anchor. Intel signs and guarantees TDX-module integrity.
2222

23-
- RTMR: Measurements recorded by code executing within the CVM. In Dstack OS, these measurements are defined as:
23+
- RTMR: Measurements recorded by code executing within the CVM. In dstack OS, these measurements are defined as:
2424

25-
- RTMR0: OVMF records CVM's virtual hardware setup, including CPU count, memory size, and device configuration. While Dstack uses fixed devices, CPU and memory specifications can vary. RTMR0 can be computed from these specifications.
25+
- RTMR0: OVMF records CVM's virtual hardware setup, including CPU count, memory size, and device configuration. While dstack uses fixed devices, CPU and memory specifications can vary. RTMR0 can be computed from these specifications.
2626
- RTMR1: OVMF records the Linux kernel measurement.
2727
- RTMR2: Linux kernel records kernel cmdline (including rootfs hash) and initrd measurements.
28-
- RTMR3: initrd records Dstack App details, including compose hash, instance id, app id, rootfs hash, and key provider.
28+
- RTMR3: initrd records dstack App details, including compose hash, instance id, app id, rootfs hash, and key provider.
2929

3030
MRTD, RTMR0, RTMR1, and RTMR2 can be pre-calculated from the built image (given CPU+RAM specifications). Compare these with the verified quote's MRs to confirm correct base image code execution.
3131

3232
RTMR3 differs as it contains runtime information like compose hash and instance id. Verify this by replaying the event log - if the calculated RTMR3 matches the quote's RTMR3, the event log information is valid. Then verify the compose hash, key provider, and other event log details match expectations.
3333

3434
### 2.2. Determining expected MRs
35-
MRTD, RTMR0, RTMR1, and RTMR2 correspond to the image. Dstack OS builds all related software from source.
35+
MRTD, RTMR0, RTMR1, and RTMR2 correspond to the image. dstack OS builds all related software from source.
3636
Build version v0.4.0 using these commands:
3737
```bash
3838
git clone https://github.com/Dstack-TEE/meta-dstack.git
@@ -59,7 +59,7 @@ Once these verification steps are completed successfully, the report_data contai
5959

6060
## Conclusion
6161

62-
To verify Dstack App data trustworthiness:
62+
To verify dstack App data trustworthiness:
6363

6464
- Review source code for correctness and safety.
6565
- Build image from source.

basefiles/dstack-guest-agent.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Unit]
2-
Description=Dstack Guest Agent Service
2+
Description=dstack Guest Agent Service
33
After=network.target tboot.service
44
Before=docker.service
55

basefiles/dstack-prepare.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Unit]
2-
Description=DStack Guest Preparation Service
2+
Description=dstack Guest Preparation Service
33
After=network.target chronyd.service
44
Before=app-compose.service dstack-guest-agent.service docker.service
55
OnFailure=reboot.target

docs/deployment.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Deployment of DStack
1+
# Deployment of dstack
22

3-
This document describes the deployment of DStack components on bare metal TDX hosts.
3+
This document describes the deployment of dstack components on bare metal TDX hosts.
44
It contains steps to deploy dstack-kms and dstack-gateway into CVMs.
55

66
## Prerequisites
77

88
- Follow the [TDX setup guide](https://github.com/canonical/tdx) to setup the TDX host.
99
- Install `cargo` and `rustc`
1010

11-
## Clone the DStack repository
11+
## Clone the dstack repository
1212
```bash
1313
git clone https://github.com/Dstack-TEE/dstack
1414
```
@@ -229,7 +229,7 @@ MY_URL=https://gateway.test2.dstack.phala.network:9202
229229
# Bootnode URL. If you want to deploy a multi-node dstack-gateway cluster, set the bootnode URL to the URL of another node already deployed or planed to be deployed later.
230230
BOOTNODE_URL=https://gateway.test2.dstack.phala.network:9202
231231
232-
# DStack OS image name
232+
# dstack OS image name
233233
OS_IMAGE=dstack-0.5.2
234234
235235
# Set defaults for variables that might not be in .env
@@ -296,10 +296,10 @@ After the dstack-vmm is ready, you can deploy an app on it following the steps b
296296

297297
The on-chain registration process includes two steps:
298298

299-
1. Deploy an App's control contract DstackApp. Developers can develop their own or choose the reference contract from the Dstack repository. Custom contracts need to implement the IAppAuth interface.
299+
1. Deploy an App's control contract DstackApp. Developers can develop their own or choose the reference contract from the dstack repository. Custom contracts need to implement the IAppAuth interface.
300300
2. Call DstackKms.registerApp(appContractAddress) to register the contract.
301301

302-
The Dstack repository provides scripts to complete these two steps:
302+
The dstack repository provides scripts to complete these two steps:
303303

304304
**Option 1: Traditional deployment (2 transactions)**
305305
```bash

docs/design-and-hardening-decisions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The meta-dstack layer is designed to create a minimally secure image for booting
1010

1111
**Decision**: We use `linux-yocto-dev` (development recipes) instead of `linux-yocto` (stable recipes).
1212

13-
**Rationale**: We use Scarthgap version of Yocto, which is the latest version when we started the Dstack project. The stable `linux-yocto` recipe in Scarthgap is based on kernel 6.6 which does not support RTMR[1-2]. So we switch to `linux-yocto-dev` to get the kernel 6.9 support. The latest released Yocto (Walnascar) updated kernel to 6.12 which meets our requirements. We plan to upgrade the Yocto version later, but this is not trivial as all downstream Yocto recipes need to be updated to adapt to the major Yocto version change.
13+
**Rationale**: We use Scarthgap version of Yocto, which is the latest version when we started the dstack project. The stable `linux-yocto` recipe in Scarthgap is based on kernel 6.6 which does not support RTMR[1-2]. So we switch to `linux-yocto-dev` to get the kernel 6.9 support. The latest released Yocto (Walnascar) updated kernel to 6.12 which meets our requirements. We plan to upgrade the Yocto version later, but this is not trivial as all downstream Yocto recipes need to be updated to adapt to the major Yocto version change.
1414

1515
### 2. TDVF vs td-shim Boot Firmware
1616

@@ -49,7 +49,7 @@ See [here](https://intel.github.io/ccc-linux-guest-hardening-docs/security-spec.
4949

5050
### 5. Secure System Time
5151

52-
**Implementation**: Dstack OS enforces the guest kernel uses TSC as the only timer source by appending `tsc=reliable no-kvmclock` to the kernel cmdline. It also enforces the use of NTS with built-in [trusted servers](https://github.com/Dstack-TEE/meta-dstack/blob/bef2dfa850f4116ae4ece96d8c0948965c5874b3/meta-dstack/recipes-core/chrony/files/chrony.conf#L13-L20) to synchronize system time.
52+
**Implementation**: dstack OS enforces the guest kernel uses TSC as the only timer source by appending `tsc=reliable no-kvmclock` to the kernel cmdline. It also enforces the use of NTS with built-in [trusted servers](https://github.com/Dstack-TEE/meta-dstack/blob/bef2dfa850f4116ae4ece96d8c0948965c5874b3/meta-dstack/recipes-core/chrony/files/chrony.conf#L13-L20) to synchronize system time.
5353

5454
**Behavior**: When `secure_time` is enabled in the app-compose.json configuration, the system ensures time synchronization is completed before requesting application keys. If `secure_time` is disabled, time synchronization is not enforced before application launch.
5555

docs/security-guide/cvm-boundaries.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
This document describes the Dstack defined information exchange channels between CVM and the outside world.
1+
This document describes the dstack defined information exchange channels between CVM and the outside world.
22

33
## Network layer
44

55
### Virtual Native Network
6-
Dstack currently uses QEMU's user-mode network stack to create a virtual network for the CVM. In this setup, QEMU (running on the host) simulates the gateway, DNS, and DHCP services. The CVM should treat these network components as untrusted.
6+
dstack currently uses QEMU's user-mode network stack to create a virtual network for the CVM. In this setup, QEMU (running on the host) simulates the gateway, DNS, and DHCP services. The CVM should treat these network components as untrusted.
77

88
### Wireguard Network
99
When dstack-gateway is enabled, it establishes a secure Wireguard network connection between the workload CVM and dstack-gateway CVM.
1010
External clients connect to the workload CVM through dstack-gateway using the CVM's ZT-HTTPS domain. For clients, ZT-HTTPS ensures no man-in-the-middle attacks can occur between them and the workload CVM. However, workload developers should note that incoming traffic might come from either dstack-gateway or the QEMU native network.
1111

1212
## Host Shared Folder
13-
Dstack OS requires a host shared folder to be attached to the CVM. It copies the following files from the host shared folder to the CVM:
13+
dstack OS requires a host shared folder to be attached to the CVM. It copies the following files from the host shared folder to the CVM:
1414

1515
| File | Purpose |
1616
|------|--------|
@@ -82,7 +82,7 @@ The hash of this file is not extended to any RTMR because each field has its own
8282
It does not make sense to measure the entire sys-config.json, because it is not deterministic and measuring it would make the verification process troublesome.
8383

8484
### .encrypted-env
85-
Dstack uses encrypted environment variables to allow app developers to securely load sensitive configuration values into the CVM. Since these variables are temporarily stored on the host server before being loaded into the CVM, encryption ensures host servers cannot access the confidential data.
85+
dstack uses encrypted environment variables to allow app developers to securely load sensitive configuration values into the CVM. Since these variables are temporarily stored on the host server before being loaded into the CVM, encryption ensures host servers cannot access the confidential data.
8686

8787
#### Encryption Workflow:
8888

@@ -116,13 +116,13 @@ Dstack uses encrypted environment variables to allow app developers to securely
116116
This file is not measured to RTMRs. But it is highly recommended to add application-specific integrity checks on encrypted environment variables at the application layer. See [security-guide.md](security-guide.md) for more details.
117117

118118
### .user-config
119-
This is an optional application-specific configuration file that applications inside the CVM can access. Dstack OS simply stores it at /dstack/user-config without any measurement or additional processing.
119+
This is an optional application-specific configuration file that applications inside the CVM can access. dstack OS simply stores it at /dstack/user-config without any measurement or additional processing.
120120

121121
Application developers should perform integrity checks on user_config at the application layer if necessary.
122122

123123
## APIs
124124

125-
Dstack provides several API services for communication between components. These APIs define the boundaries and information exchange channels between the CVM and external systems.
125+
dstack provides several API services for communication between components. These APIs define the boundaries and information exchange channels between the CVM and external systems.
126126

127127
### VSOCK-based Guest API Service
128128

docs/security-guide/security-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dstack Production Security Best Practices
1+
# dstack Production Security Best Practices
22

33
This document describes security considerations for deploying dstack apps in production.
44

@@ -30,11 +30,11 @@ services:
3030
3131
## Reproducibility
3232
33-
If your App is intended for end users who need to verify what code your App is running, then the verifiability of Docker images is crucial. Dstack anchors the code running inside the CVM through the hash of app-compose.json. However, at the same time, the App needs to provide users with a reproducible build method. There are multiple ways to achieve reproducible image builds, and dstack provides a reference example: [dstack-ingress](https://github.com/Dstack-TEE/dstack-examples/tree/main/custom-domain/dstack-ingress)
33+
If your App is intended for end users who need to verify what code your App is running, then the verifiability of Docker images is crucial. dstack anchors the code running inside the CVM through the hash of app-compose.json. However, at the same time, the App needs to provide users with a reproducible build method. There are multiple ways to achieve reproducible image builds, and dstack provides a reference example: [dstack-ingress](https://github.com/Dstack-TEE/dstack-examples/tree/main/custom-domain/dstack-ingress)
3434
3535
## Authenticated envs and user_config
3636
37-
Dstack provides encrypted environment variable functionality. Although the CVM physical machine controller cannot view encrypted environment variables, they may forge encrypted environment variables because the CVM encryption public key is known to everyone. Therefore, Apps need to perform auth checks on encrypted environment variables at the application layer. LAUNCH_TOKEN pattern is one method to prevent unauthorized envs replacement. For details, refer to the deployment script of [dstack-gateway](https://github.com/Dstack-TEE/dstack/blob/1b8a4516826b02f9d7f747eddac244dcd68fc325/gateway/dstack-app/deploy-to-vmm.sh#L150-L165).
37+
dstack provides encrypted environment variable functionality. Although the CVM physical machine controller cannot view encrypted environment variables, they may forge encrypted environment variables because the CVM encryption public key is known to everyone. Therefore, Apps need to perform auth checks on encrypted environment variables at the application layer. LAUNCH_TOKEN pattern is one method to prevent unauthorized envs replacement. For details, refer to the deployment script of [dstack-gateway](https://github.com/Dstack-TEE/dstack/blob/1b8a4516826b02f9d7f747eddac244dcd68fc325/gateway/dstack-app/deploy-to-vmm.sh#L150-L165).
3838
3939
If you use dstack-vmm's built-in UI, the prelaunch script has already been automatically filled in for you:
4040
@@ -79,7 +79,7 @@ Example app-compose.json:
7979

8080
## Don't expose unexpected ports
8181

82-
In Dstack CVM, dstack-guest-agent listens on port 8090, allowing public access to basic CVM information.
82+
In dstack CVM, dstack-guest-agent listens on port 8090, allowing public access to basic CVM information.
8383

8484
In docker-compose.yaml, all declared ports will be exposed to the public internet. Do not expose unnecessary ports.
8585

dstack-mr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version.workspace = true
44
authors.workspace = true
55
edition.workspace = true
66
license.workspace = true
7-
description = "A CLI tool for calculating TDX measurements for DStack images"
7+
description = "A CLI tool for calculating TDX measurements for dstack images"
88

99
[dependencies]
1010
serde = { workspace = true, features = ["derive"] }

dstack-mr/cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct MachineConfig {
3030
#[arg(short, long, default_value = "2G", value_parser = parse_memory_size)]
3131
memory: u64,
3232

33-
/// Path to DStack image metadata.json
33+
/// Path to dstack image metadata.json
3434
metadata: PathBuf,
3535

3636
/// Enable two-pass add pages

dstack-util/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mod parse_env_file;
3030
mod system_setup;
3131
mod utils;
3232

33-
/// DStack guest utility
33+
/// dstack guest utility
3434
#[derive(Parser)]
3535
#[command(author, version, about)]
3636
struct Cli {

0 commit comments

Comments
 (0)