Skip to content

Commit

Permalink
measurements.json
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris committed Sep 23, 2024
1 parent 3f80c37 commit fa89a40
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ WIP Toolbox
- [Client allowing only server using the custom TLS certificate](cmd/https-client/main.go)
- [Status API server, with ability for recording and querying events](cmd/status-api/)

Canonical way to collapse a TDX [measurements.json](docs/measurements.json) file into a single hash, in a reproducible way:

```bash
cat measurements.json | jq --sort-keys --compact-output | sha256sum
```

## Usage

```bash
Expand All @@ -24,7 +30,9 @@ $ curl --cacert cert.pem https://127.0.0.1:8080
$ go run cmd/https-client/main.go
```

Status api server that can be used to record and query events. Events can be added through local named pipe (file `pipe.fifo`), or through HTTP API.
### Status API server

The status api server is used to record and query events. Events can be added through local named pipe (file `pipe.fifo`), or through HTTP API.

```bash
# Start the server
Expand All @@ -40,10 +48,10 @@ $ curl -s localhost:8082/api/v1/events | jq -r '(.[] | [.received_at, .message]
2024-09-21T14:35:42.486016Z 222
```

---

## Next Steps

These partly overlap with https://github.com/flashbots/cvm-reverse-proxy:
- Server that verifies client-side aTLS certificate
- Client that sends client-side aTLS certificate
- One server that exposes an aTLS endpoint to serve the local TLS cert, and another server that exposes a TLS endpoint
23 changes: 23 additions & 0 deletions docs/measurements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"8": {
"expected": "0000000000000000000000000000000000000000000000000000000000000000"
},
"11": {
"expected": "efa43e0beff151b0f251c4abf48152382b1452b4414dbd737b4127de05ca31f7"
},
"12": {
"expected": "0000000000000000000000000000000000000000000000000000000000000000"
},
"13": {
"expected": "0000000000000000000000000000000000000000000000000000000000000000"
},
"15": {
"expected": "0000000000000000000000000000000000000000000000000000000000000000"
},
"4": {
"expected": "ea92ff762767eae6316794f1641c485d4846bc2b9df2eab6ba7f630ce6f4d66f"
},
"9": {
"expected": "c9f429296634072d1063a03fb287bed0b2d177b0a504755ad9194cffd90b2489"
}
}

0 comments on commit fa89a40

Please sign in to comment.