diff --git a/charts/templates/coordinator.yaml b/charts/templates/coordinator.yaml index bf98de4c9..e6ddb6f7d 100644 --- a/charts/templates/coordinator.yaml +++ b/charts/templates/coordinator.yaml @@ -40,6 +40,10 @@ spec: serviceAccountName: marblerun-coordinator containers: - env: + {{- if .Values.coordinator.debugLogging }} + - name: EDG_DEBUG_LOGGING + value: "1" + {{- end }} - name: EDG_COORDINATOR_MESH_ADDR value: "{{ .Values.coordinator.meshServerHost }}:{{ .Values.coordinator.meshServerPort }}" - name: EDG_COORDINATOR_CLIENT_ADDR diff --git a/charts/values.yaml b/charts/values.yaml index ac8e8b85e..51833139b 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -75,6 +75,8 @@ coordinator: sealDir: "/coordinator/data/" # OE_SIMULATION needs be set to "1" when running on systems without SGX1+FLC capabilities simulation: false + # Enable debug logging in the coordinator + debugLogging: false probes: readiness: diff --git a/coordinator/seal/distributed/seal.go b/coordinator/seal/distributed/seal.go index e7e30ad8c..71a789ed6 100644 --- a/coordinator/seal/distributed/seal.go +++ b/coordinator/seal/distributed/seal.go @@ -211,7 +211,17 @@ func (s *Sealer) SetSealMode(mode seal.Mode) { s.mux.Lock() defer s.mux.Unlock() s.log.Debug("Setting seal mode", zap.Int("sealMode", int(mode))) + + needsResealing := s.mode != mode && s.keyEncryptionKey != nil + s.mode = mode + + if needsResealing { + s.log.Debug("Seal mode changed: resealing key encryption key") + if err := s.sealKEK(context.Background()); err != nil { + s.log.Error("Failed to reseal key encryption key after seal mode change", zap.Error(err)) + } + } } // sealKEK seals the sealer's key encryption key using the enclave's product or unique key (if not disabled). diff --git a/test/e2e/helm/helm.go b/test/e2e/helm/helm.go index dca7ce57b..b93bf2f58 100644 --- a/test/e2e/helm/helm.go +++ b/test/e2e/helm/helm.go @@ -79,6 +79,7 @@ func (h *Helm) InstallChart( "tenantID": os.Getenv(constants.EnvAzureTenantID), "clientSecret": os.Getenv(constants.EnvAzureClientSecret), }, + "debugLogging": true, }, } values = mergeMaps(values, extraValues)