2022-09-05 09:06:08 +02:00
/ *
Copyright ( c ) Edgeless Systems GmbH
SPDX - License - Identifier : AGPL - 3.0 - only
* /
2022-04-06 10:36:58 +02:00
/ *
Package constants contains the constants used by Constellation .
Constants should never be overwritable by command line flags or configuration files .
* /
package constants
2022-10-11 13:57:52 +02:00
import (
"time"
)
2022-05-04 14:32:34 +02:00
2022-04-06 10:36:58 +02:00
const (
2022-04-12 14:07:17 +00:00
//
// Constellation.
//
// ConstellationNameLength is the maximum length of a Constellation's name.
ConstellationNameLength = 37
2023-02-10 13:27:22 +01:00
// AWSConstellationNameLength is the maximum length of a Constellation's name on AWS.
AWSConstellationNameLength = 10
2022-04-12 14:07:17 +00:00
// ConstellationMasterSecretStoreName is the name for the Constellation secrets in Kubernetes.
ConstellationMasterSecretStoreName = "constellation-mastersecret"
2022-10-18 13:15:54 +02:00
// ConstellationMasterSecretKey is the name of the key for the master secret in the master secret kubernetes secret.
2022-04-12 14:07:17 +00:00
ConstellationMasterSecretKey = "mastersecret"
2022-10-18 13:15:54 +02:00
// ConstellationSaltKey is the name of the key for the salt in the master secret kubernetes secret.
ConstellationSaltKey = "salt"
2023-01-17 15:28:07 +01:00
// ConstellationVerifyServiceUserData is the user data that the verification service includes in the attestation.
ConstellationVerifyServiceUserData = "VerifyService"
2023-03-09 09:47:28 +01:00
// AttestationVariant is the name of the environment variable that contains the attestation variant.
AttestationVariant = "CONSTEL_ATTESTATION_VARIANT"
2022-04-12 14:07:17 +00:00
2022-04-06 10:36:58 +02:00
//
// Ports.
//
2022-07-05 14:13:19 +02:00
// JoinServicePort is the port for reaching the join service within Kubernetes.
JoinServicePort = 9090
// JoinServiceNodePort is the port for reaching the join service outside of Kubernetes.
2022-11-09 15:57:54 +01:00
JoinServiceNodePort = 30090
// VerifyServicePortHTTP HTTP port for verification service.
VerifyServicePortHTTP = 8080
// VerifyServicePortGRPC GRPC port for verification service.
VerifyServicePortGRPC = 9090
// VerifyServiceNodePortHTTP HTTP node port for verification service.
2022-06-28 17:03:28 +02:00
VerifyServiceNodePortHTTP = 30080
2022-11-09 15:57:54 +01:00
// VerifyServiceNodePortGRPC GRPC node port for verification service.
2022-06-28 17:03:28 +02:00
VerifyServiceNodePortGRPC = 30081
2023-01-20 18:51:06 +01:00
// KeyServicePort is the port the KMS server listens on.
KeyServicePort = 9000
2022-11-09 15:57:54 +01:00
// BootstrapperPort port of bootstrapper.
2022-06-29 15:26:29 +02:00
BootstrapperPort = 9000
2022-11-09 15:57:54 +01:00
// KubernetesPort port for Kubernetes API.
KubernetesPort = 6443
// RecoveryPort port for Constellation recovery server.
RecoveryPort = 9999
// DebugdPort port for debugd process.
DebugdPort = 4000
// KonnectivityPort port for konnectivity k8s service.
2022-09-01 03:40:29 +02:00
KonnectivityPort = 8132
2022-04-06 10:36:58 +02:00
//
// Filenames.
//
2022-11-09 15:57:54 +01:00
// ClusterIDsFileName filename that contains Constellation clusterID and IP.
ClusterIDsFileName = "constellation-id.json"
// ConfigFilename filename of Constellation config file.
ConfigFilename = "constellation-conf.yaml"
// LicenseFilename filename of Constellation license file.
LicenseFilename = "constellation.license"
// AdminConfFilename filename of KubeConfig for admin access to Constellation.
AdminConfFilename = "constellation-admin.conf"
// MasterSecretFilename filename of Constellation mastersecret.
MasterSecretFilename = "constellation-mastersecret.json"
2022-11-14 18:18:58 +01:00
// TerraformWorkingDir is the directory name for the TerraformClient workspace.
TerraformWorkingDir = "constellation-terraform"
2022-12-07 11:48:54 +01:00
// TerraformIAMWorkingDir is the directory name for the Terraform IAM Client workspace.
TerraformIAMWorkingDir = "constellation-iam-terraform"
// GCPServiceAccountKeyFile is the file name for the GCP service account key file.
GCPServiceAccountKeyFile = "gcpServiceAccountKey.json"
2022-11-09 15:57:54 +01:00
// ControlPlaneAdminConfFilename filepath to control plane kubernetes admin config.
2022-10-21 10:16:44 +02:00
ControlPlaneAdminConfFilename = "/etc/kubernetes/admin.conf"
2022-11-09 15:57:54 +01:00
// KubectlPath path to kubectl binary.
KubectlPath = "/run/state/bin/kubectl"
2022-12-25 18:49:45 +01:00
// UpgradeAgentSocketPath is the path to the UDS that is used for the gRPC connection to the upgrade agent.
UpgradeAgentSocketPath = "/run/constellation-upgrade-agent.sock"
2023-01-06 12:08:25 +01:00
// UpgradeAgentMountPath is the path inside the operator container where the UDS is mounted.
UpgradeAgentMountPath = "/etc/constellation-upgrade-agent.sock"
2022-11-14 19:09:49 +01:00
// CniPluginsDir path directory for CNI plugins.
CniPluginsDir = "/opt/cni/bin"
// BinDir install path for CNI config.
BinDir = "/run/state/bin"
// KubeadmPath install path for kubeadm.
KubeadmPath = "/run/state/bin/kubeadm"
// KubeletPath install path for kubelet.
KubeletPath = "/run/state/bin/kubelet"
2022-06-29 16:13:01 +02:00
//
// Filenames for Constellation's micro services.
//
2022-07-18 12:28:02 +02:00
// ServiceBasePath is the base path for the mounted micro service's files.
2022-06-29 16:13:01 +02:00
ServiceBasePath = "/var/config"
// MeasurementsFilename is the filename of CC measurements.
MeasurementsFilename = "measurements"
2022-07-26 10:58:39 +02:00
// MeasurementSaltFilename is the filename of the salt used in creation of the clusterID.
MeasurementSaltFilename = "measurementSalt"
// MeasurementSecretFilename is the filename of the secret used in creation of the clusterID.
MeasurementSecretFilename = "measurementSecret"
2022-10-05 15:02:46 +02:00
// IDKeyDigestFilename is the name of the file holding the currently enforced idkeydigest.
2023-01-18 16:49:55 +01:00
IDKeyDigestFilename = "idkeydigests"
2022-10-05 15:02:46 +02:00
// EnforceIDKeyDigestFilename is the name of the file configuring whether idkeydigest is enforced or not.
EnforceIDKeyDigestFilename = "enforceIdKeyDigest"
2023-03-21 12:46:49 +01:00
// IDKeyConfigFilename is the name of the file holding the configuration for validating the SEV-SNP ID key digest.
IDKeyConfigFilename = "idKeyConfig"
2023-01-04 17:03:40 +01:00
// K8sVersionFieldName is the name of the of the key holding the wanted Kubernetes version.
K8sVersionFieldName = "cluster-version"
2022-11-23 10:29:36 +01:00
// ComponentsListKey is the name of the key holding the list of components in the components configMap.
ComponentsListKey = "components"
2023-02-09 15:54:12 +01:00
// NodeVersionResourceName resource name used for NodeVersion in constellation-operator and CLI.
NodeVersionResourceName = "constellation-version"
2023-01-06 20:48:03 +01:00
// NodeKubernetesComponentsAnnotationKey is the name of the annotation holding the reference to the ConfigMap listing all K8s components.
NodeKubernetesComponentsAnnotationKey = "constellation.edgeless.systems/kubernetes-components"
2022-12-06 18:48:01 +01:00
// JoiningNodesConfigMapName is the name of the configMap holding the joining nodes with the components hashes the node-operator should annotate the nodes with.
JoiningNodesConfigMapName = "joining-nodes"
2022-05-04 08:50:50 +02:00
//
// CLI.
//
2022-11-09 15:57:54 +01:00
// MinControllerCount is the minimum number of control nodes.
2022-05-04 08:50:50 +02:00
MinControllerCount = 1
2022-11-09 15:57:54 +01:00
// MinWorkerCount is the minimum number of worker nodes.
MinWorkerCount = 1
2022-11-15 15:40:49 +01:00
// EnvVarPrefix is expected prefix for environment variables used to overwrite config parameters.
EnvVarPrefix = "CONSTELL_"
// EnvVarAzureClientSecretValue is environment variable to overwrite
// provider.azure.clientSecretValue .
EnvVarAzureClientSecretValue = EnvVarPrefix + "AZURE_CLIENT_SECRET_VALUE"
2023-03-03 15:28:28 +01:00
// EnvVarOpenStackPassword is environment variable to overwrite
// provider.openstack.password .
EnvVarOpenStackPassword = EnvVarPrefix + "OS_PASSWORD"
2023-02-16 15:43:19 +01:00
// EnvVarNoSpinner is environment variable used to disable the loading indicator (spinner)
// displayed in Constellation CLI. Any non-empty value, e.g., CONSTELL_NO_SPINNER=1,
// can be used to disable the spinner.
EnvVarNoSpinner = EnvVarPrefix + "NO_SPINNER"
2023-01-25 14:42:52 +01:00
// MiniConstellationUID is a sentinel value for the UID of a mini constellation.
MiniConstellationUID = "mini"
2022-05-05 08:48:56 +02:00
//
// Kubernetes.
//
2022-11-09 15:57:54 +01:00
// KubernetesJoinTokenTTL time to live for Kubernetes join token.
2022-05-04 14:32:34 +02:00
KubernetesJoinTokenTTL = 15 * time . Minute
2022-11-09 15:57:54 +01:00
// ConstellationNamespace namespace to deploy Constellation components into.
2022-08-29 16:49:44 +02:00
ConstellationNamespace = "kube-system"
2022-11-09 15:57:54 +01:00
// JoinConfigMap k8s config map with node join config.
JoinConfigMap = "join-config"
// InternalConfigMap k8s config map with internal Constellation config.
InternalConfigMap = "internal-config"
2022-08-01 09:37:05 +02:00
2022-08-12 10:20:19 +02:00
//
// Helm.
//
2022-11-09 15:57:54 +01:00
// HelmNamespace namespace for helm charts.
2022-08-12 10:20:19 +02:00
HelmNamespace = "kube-system"
2022-08-01 09:37:05 +02:00
//
// Releases.
//
2022-11-28 10:27:33 +01:00
// CDNRepositoryURL is the base URL of the Constellation CDN artifact repository.
CDNRepositoryURL = "https://cdn.confidential.cloud"
2022-12-09 11:51:38 +01:00
// CDNAPIPrefix is the prefix of the Constellation API.
2022-12-05 15:15:03 +01:00
CDNAPIPrefix = "constellation/v1"
2023-02-03 10:05:42 +00:00
// CDNMeasurementsFile is name of file containing image measurements.
CDNMeasurementsFile = "measurements.json"
// CDNMeasurementsSignature is name of file containing signature for CDNMeasurementsFile.
CDNMeasurementsSignature = "measurements.json.sig"
2022-04-06 10:36:58 +02:00
)
2023-03-01 11:55:12 +01:00
// VersionInfo returns the version of a binary.
func VersionInfo ( ) string {
return versionInfo
}
2023-03-09 15:23:42 +01:00
// Timestamp returns the commit timestamp of a binary.
func Timestamp ( ) string {
return timestamp
}
// Commit returns the commit hash of a binary.
func Commit ( ) string {
return commit
}
// State returns the git state of the working directory.
func State ( ) string {
return state
}
var (
// versionInfo is the version of a binary. Left as a separate variable to allow override during build.
versionInfo = "0.0.0"
// timestamp is the commit timestamp of a binary. Left as a separate variable to allow override during build.
timestamp = "1970-01-01T00:00:00Z"
// commit is the commit hash of a binary. Left as a separate variable to allow override during build.
commit = "0000000000000000000000000000000000000000"
// state is the git state of the working directory. Left as a separate variable to allow override during build.
state = "unknown"
)