Serge Bazanski | 0ed2f96 | 2021-03-15 16:39:30 +0100 | [diff] [blame] | 1 | // Copyright 2020 The Monogon Project Authors. |
| 2 | // |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
| 8 | // |
| 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | // |
| 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
| 16 | |
| 17 | syntax = "proto3"; |
| 18 | package metropolis.proto.api; |
| 19 | option go_package = "source.monogon.dev/metropolis/proto/api"; |
| 20 | |
Serge Bazanski | 516d300 | 2021-10-01 00:05:41 +0200 | [diff] [blame] | 21 | import "metropolis/proto/common/common.proto"; |
Lorenz Brun | 85ad26a | 2023-03-27 17:00:00 +0200 | [diff] [blame] | 22 | import "net/proto/net.proto"; |
Serge Bazanski | 516d300 | 2021-10-01 00:05:41 +0200 | [diff] [blame] | 23 | |
Serge Bazanski | 0ed2f96 | 2021-03-15 16:39:30 +0100 | [diff] [blame] | 24 | // NodeParameters is the data with which a Node is set booted. It contains the |
| 25 | // configuration required for a node to either bootstrap a new cluster, or |
| 26 | // register into an existing one. |
| 27 | // It is serialized into a proto message and supplied to Metropolis in an |
| 28 | // implementation-specific way (currently: either on ESP partition or via qemu |
| 29 | // fw_cfg). |
| 30 | message NodeParameters { |
Serge Bazanski | 516d300 | 2021-10-01 00:05:41 +0200 | [diff] [blame] | 31 | // ClusterBootstrap configures the node to attempt to create a new cluster |
| 32 | // from scratch. Further nodes can become part of the cluster by being |
| 33 | // configured with ClusterRegister, which should contain data retrieved from |
| 34 | // the newly bootstrapped cluster by its operator. |
Serge Bazanski | 0ed2f96 | 2021-03-15 16:39:30 +0100 | [diff] [blame] | 35 | message ClusterBootstrap { |
Serge Bazanski | 516d300 | 2021-10-01 00:05:41 +0200 | [diff] [blame] | 36 | // owner_public_key is a raw Ed25519 public whose corresponding private |
| 37 | // key can be used to prove ownership of the cluster and retrieve |
| 38 | // management credentials for the cluster via an AAA.Escrow call. |
Serge Bazanski | 72068da | 2021-03-16 13:15:45 +0100 | [diff] [blame] | 39 | bytes owner_public_key = 1; |
Serge Bazanski | 5df62ba | 2023-03-22 17:56:46 +0100 | [diff] [blame^] | 40 | |
| 41 | // If not set, defaults to: |
| 42 | // - TPM mode: REQUIRED |
| 43 | common.ClusterConfiguration initial_cluster_configuration = 3; |
Serge Bazanski | 0ed2f96 | 2021-03-15 16:39:30 +0100 | [diff] [blame] | 44 | } |
Serge Bazanski | 516d300 | 2021-10-01 00:05:41 +0200 | [diff] [blame] | 45 | // ClusterRegister configures the node to attempt to register into an |
| 46 | // existing cluster, ie. contact an existing running cluster and become |
| 47 | // its member. |
Serge Bazanski | 0ed2f96 | 2021-03-15 16:39:30 +0100 | [diff] [blame] | 48 | message ClusterRegister { |
Serge Bazanski | 516d300 | 2021-10-01 00:05:41 +0200 | [diff] [blame] | 49 | // cluster_directory is a directory (mapping of names into IP addresses |
| 50 | // and public keys) of existing nodes in the cluster. It's used as the |
| 51 | // initial contact point of the already running cluster that the node |
| 52 | // should register into. It can be retrieved by an operator from |
| 53 | // a running cluster via Management.GetClusterInfo. |
| 54 | metropolis.proto.common.ClusterDirectory cluster_directory = 1; |
| 55 | // register_ticket is the opaque Register Ticket required from a node to |
| 56 | // begin registering it into a cluster. It can be retrieved by an |
| 57 | // operator from a running cluster via Management.GetRegisterTicket. |
| 58 | bytes register_ticket = 2; |
Serge Bazanski | fbd38e2 | 2021-10-08 14:41:16 +0200 | [diff] [blame] | 59 | // ca_certificate is the DER-encoded x509 CA of the cluster that the |
Serge Bazanski | 516d300 | 2021-10-01 00:05:41 +0200 | [diff] [blame] | 60 | // node should expect when contacting nodes in cluster_directory and |
Serge Bazanski | fbd38e2 | 2021-10-08 14:41:16 +0200 | [diff] [blame] | 61 | // attempting to register into a cluster. It can be retrieved by |
| 62 | // an operator from a running cluster via Management.GetClusterInfo. |
| 63 | bytes ca_certificate = 3; |
Serge Bazanski | 0ed2f96 | 2021-03-15 16:39:30 +0100 | [diff] [blame] | 64 | } |
| 65 | oneof cluster { |
| 66 | ClusterBootstrap cluster_bootstrap = 1; |
| 67 | ClusterRegister cluster_register = 2; |
| 68 | } |
Lorenz Brun | 85ad26a | 2023-03-27 17:00:00 +0200 | [diff] [blame] | 69 | |
| 70 | // Optional network configuration when autoconfiguration is not possible or |
| 71 | // desirable. If unset, autoconfiguration (ie. DHCP) is used. |
| 72 | net.proto.Net network_config = 4; |
Serge Bazanski | 0ed2f96 | 2021-03-15 16:39:30 +0100 | [diff] [blame] | 73 | } |