constellation/internal/atls
Malte Poll bdba9d8ba6
bazel: add build files for go (#1186)
* build: correct toolchain order
* build: gazelle-update-repos
* build: use pregenerated proto for dependencies
* update bazeldnf
* deps: tpm simulator
* Update Google trillian module
* cli: add stamping as alternative build info source
* bazel: add go_test wrappers, mark special tests and select testing deps
* deps: add libvirt deps
* deps: go-libvirt patches
* deps: cloudflare circl patches
* bazel: add go_test wrappers, mark special tests and select testing deps
* bazel: keep gazelle overrides
* bazel: cleanup bazelrc
* bazel: switch CMakeLists.txt to use bazel
* bazel: fix injection of version information via stamping
* bazel: commit all build files
* dev-docs: document bazel usage
* deps: upgrade zig-cc for go 1.20
* bazel: update Perl for macOS arm64 & Linux arm64 support
* bazel: use static perl toolchain for OpenSSL
* bazel: use static protobuf (protoc) toolchain
* deps: add git and go to nix deps

Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-03-09 15:23:42 +01:00
..
atls_test.go Upgrade go module to v2 2022-09-22 09:10:19 +02:00
atls.go dev-docs: Go package docs (#958) 2023-01-19 15:57:50 +01:00
BUILD.bazel bazel: add build files for go (#1186) 2023-03-09 15:23:42 +01:00
README.md Fix typo 2022-09-29 16:37:52 +02:00

Attested TLS (aTLS)

In a confidential computing (CC) environment, attested TLS (aTLS) can be used to establish secure connections between two parties utilizing the remote attestation features of the CC components.

aTLS modifies the TLS handshake by embedding an attestation statement into the TLS certificate. Instead of relying on a Certificate Authority, aTLS uses this attestation statement to establish trust in the certificate.

The protocol can be used by clients to verify a server certificate, by a server to verify a client certificate, or for mutual verification (mutual aTLS).

Client side verification

  1. The client sends a ClientHello message, setting ServerName to a random nonce.

  2. The server generates an attestation statement using the clients nonce and its CC capabilities.

    • The attestation is embedded in the server certificate using x509 certificate extensions with an object identifier (OID) to identify the CC attestation type. See OID for implementation details.
  3. The client verifies the attestation statement.

  4. If successful the client can trust the server to be running the expected configuration, and finish the TLS handshake.

sequenceDiagram
    participant Client
    participant Server
    Client->>Server: ClientHello(nonce)
    Server->>Client: ServerCertificate(AttestationStatement), ServerHelloDone
    Note over Client: Verify Attestation
    Client->>Server: ClientKeyExchange
    Client->>Server: ChangeCipherSpec, Finished
    Server->>Client: #

Server side verification

  1. The client sends a ClientHello message

  2. The server sends back a certificate and a random nonce. The nonce is encoded as the Distinguished Name of an acceptable CA.

  3. The client does not verify the servers certificate, but uses the nonce to generate an attestation based on its CC capabilities.

    • The attestation is embedded in the client certificate using x509 certificate extensions with an OID to identify the CC attestation type.
  4. The server verifies the client's attestation statement.

  5. If successful the server can trust the client to be running the expected configuration, and finish the TLS handshake.

sequenceDiagram
    participant Client
    participant Server
    Client->>Server: ClientHello
    Server->>Client: ServerCertificate, AcceptableCAs(nonce), ServerHelloDone
    Client->>Server: ClientKeyExchange, ClientCertificate(AttestationStatement)
    Client->>Server: ChangeCipherSpec, Finished
    Note over Server: Verify Attestation
    Server->>Client: ChangeCipherSpec, Finished

Mutual aTLS

  1. The client sends a ClientHello message, setting ServerName to a random nonce.

  2. The server generates an attestation statement using the clients nonce and its CC capabilities.

    • The attestation is embedded in the server certificate using x509 certificate extensions with an OID to identify the attestation type.
    • A nonce is encoded as the Distinguished Name of an acceptable CA.
  3. The client verifies the attestation statement.

  4. The client uses the nonce to generate an attestation based on its CC capabilities.

    • The attestation is embedded in the client certificate using x509 certificate extensions with an OID to identify the CC attestation type.
  5. The server verifies the client's attestation statement.

  6. If all verifications were successful, mutual trust in each others configuration is established, and the TLS handshake can be finished.

sequenceDiagram
    participant Client
    participant Server
    Client->>Server: ClientHello(nonce)
    Server->>Client: ServerCertificate(AttestationStatement), AcceptableCAs(nonce), ServerHelloDone
    Note over Client: Verify Attestation
    Client->>Server: ClientKeyExchange, ClientCertificate(AttestationStatement)
    Client->>Server: ChangeCipherSpec, Finished
    Note over Server: Verify Attestation
    Server->>Client: ChangeCipherSpec, Finished