Skip to content

Commit cfc30a6

Browse files
authored
Merge pull request #336 from lmilleri/ocp-main-merge-upstream
Merge upstream for OSC 1.13 release
2 parents 37e67ae + 506088a commit cfc30a6

108 files changed

Lines changed: 5121 additions & 628 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN go mod download
1919

2020
# Copy the config templates
2121
COPY config/templates/ config/templates/
22-
COPY cmd/main.go cmd/main.go
22+
COPY cmd/ cmd/
2323
COPY api/ api/
2424
COPY internal/controller/ internal/controller/
2525

@@ -29,6 +29,7 @@ COPY internal/controller/ internal/controller/
2929
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
3030
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
3131
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
32+
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o secret-converter cmd/secret-converter/main.go
3233

3334
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1773939694
3435

@@ -37,6 +38,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1773939694
3738

3839
WORKDIR /
3940
COPY --from=builder /opt/app-root/src/manager .
41+
COPY --from=builder /opt/app-root/src/secret-converter .
4042

4143
# Copy the config templates
4244
COPY --from=builder /opt/app-root/src/config/templates/ /config/templates/

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ endif
4848

4949
# Image URL to use all building/pushing image targets
5050
IMG ?= controller:latest
51+
5152
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
5253
ENVTEST_K8S_VERSION = 1.32.0
5354

@@ -103,7 +104,7 @@ vet: ## Run go vet against code.
103104

104105
.PHONY: test
105106
test: manifests generate fmt vet envtest ## Run tests.
106-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
107+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(shell go list ./... | grep -v '/cmd$$' | grep -v '/cmd/') -coverprofile cover.out
107108

108109
##@ Build
109110

@@ -175,13 +176,13 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
175176
# Run sample attestation in a kind cluster
176177
# pre-requirements: kuttl plugin and kind are installed
177178
# Usage: KBS_IMAGE_NAME=<trustee-image> CLIENT_IMAGE_NAME=<client-image> make test-e2e
178-
KBS_IMAGE_NAME ?= ghcr.io/confidential-containers/key-broker-service:built-in-as-v0.17.0
179-
CLIENT_IMAGE_NAME ?= quay.io/confidential-containers/kbs-client:v0.17.0
179+
KBS_IMAGE_NAME ?= ghcr.io/confidential-containers/staged-images/kbs:b2442c222485b6ec5d6dee09d5a30bb561ff3622
180+
CLIENT_IMAGE_NAME ?= quay.io/confidential-containers/kbs-client:v0.19.0
180181
.PHONY: test-e2e
181182
test-e2e:
182183
./tests/scripts/kind-with-registry.sh
183-
KBS_IMAGE_NAME=${KBS_IMAGE_NAME} CLIENT_IMAGE_NAME=${CLIENT_IMAGE_NAME} kubectl kuttl test || true
184-
kind delete cluster
184+
trap 'kind delete cluster' EXIT; \
185+
KBS_IMAGE_NAME=${KBS_IMAGE_NAME} CLIENT_IMAGE_NAME=${CLIENT_IMAGE_NAME} kubectl kuttl test
185186

186187
##@ Build Dependencies
187188

README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ type KbsConfigSpec struct {
6262
// +optional
6363
KbsResourcePolicyConfigMapName string `json:"kbsResourcePolicyConfigMapName,omitempty"`
6464

65-
// TdxConfigSpec is the struct that hosts the TDX specific configuration
66-
// +optional
67-
TdxConfigSpec TdxConfigSpec `json:"tdxConfigSpec,omitempty"`
68-
6965
// IbmSEConfigSpec is the struct that hosts the IBMSE specific configuration
7066
// +optional
7167
IbmSEConfigSpec IbmSEConfigSpec `json:"ibmSEConfigSpec,omitempty"`
@@ -84,13 +80,6 @@ type IbmSEConfigSpec struct {
8480
CertStorePvc string `json:"certStorePvc,omitempty"`
8581
}
8682

87-
// TdxConfigSpec defines the desired state for TDX configuration
88-
type TdxConfigSpec struct {
89-
// kbsTdxConfigMapName is the name of the configmap containing sgx_default_qcnl.conf file
90-
// +optional
91-
KbsTdxConfigMapName string `json:"kbsTdxConfigMapName,omitempty"`
92-
}
93-
9483
// KbsLocalCertCacheSpec defines the configuration for mounting local certificates into trustee file system
9584
type KbsLocalCertCacheSpec struct {
9685
// SecretName is the name of the secret that maps to a local directory containing the certificates
@@ -207,14 +196,11 @@ spec:
207196
kbsHttpsKeySecretName: kbs-https-key
208197
kbsHttpsCertSecretName: kbs-https-certificate
209198
# K8s Secrets to be made available to KBS clients
210-
kbsSecretResources: ["kbsres1"]
199+
kbsSecretResources: ["attestation-status"]
211200
# Attestation policy
212201
kbsAttestationPolicyConfigMapName: attestation-policy
213202
# Resource policy
214203
kbsResourcePolicyConfigMapName: resource-policy
215-
# TDX settings
216-
tdxConfigSpec:
217-
kbsTdxConfigMapName: tdx-config-sample
218204
# IBMSE settings
219205
ibmSEConfigSpec:
220206
certStorePvc: ibmse-pvc
@@ -316,7 +302,7 @@ data:
316302
]
317303
```
318304

319-
The default installation creates a sample K8s secret named `kbsres1` to be made available to clients.
305+
The default installation creates a sample K8s secret named `attestation-status` to be made available to clients.
320306
Take a look at [patch-kbs-resources.yaml](config/samples/microservices/patch-kbs-resources.yaml) and update it
321307
with the K8s secrets that you want to deliver to clients via Trustee.
322308

api/v1alpha1/kbsconfig_types.go

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ const (
3636
DeploymentTypeMicroservices DeploymentType = "MicroservicesDeployment"
3737
)
3838

39-
// TdxConfigSpec defines the desired state for TDX configuration
40-
type TdxConfigSpec struct {
41-
// kbsTdxConfigMapName is the name of the configmap containing sgx_default_qcnl.conf file
42-
// +optional
43-
KbsTdxConfigMapName string `json:"kbsTdxConfigMapName,omitempty"`
44-
}
45-
4639
// IbmSEConfigSpec defines the desired state for IBMSE configuration
4740
type IbmSEConfigSpec struct {
4841
// certStorePvc is the name of the PeristentVolumeClaim where certificates/keys are mounted
@@ -75,6 +68,69 @@ type KbsDeploymentSpec struct {
7568
Replicas *int32 `json:"replicas,omitempty"`
7669
}
7770

71+
// TlsConfig defines TLS protocol and cipher configuration for Trustee HTTPS server.
72+
//
73+
// The TLS profile determines which protocol versions and cipher suites are enabled:
74+
// - old: TLS 1.0+ (legacy compatibility)
75+
// - intermediate: TLS 1.2+ (default, balanced security)
76+
// - modern: TLS 1.3 only (PQC-ready)
77+
// - custom: user-defined configuration
78+
//
79+
// When using the custom profile, all fields (minVersion, maxVersion, ciphers, groups)
80+
// are optional. If not specified, the underlying KBS will use its default values.
81+
//
82+
// Example - Modern profile for PQC:
83+
//
84+
// tlsConfig:
85+
// profile: modern
86+
//
87+
// Example - Custom profile with explicit settings:
88+
//
89+
// tlsConfig:
90+
// profile: custom
91+
// minVersion: "1.2"
92+
// ciphers:
93+
// - TLS_AES_128_GCM_SHA256
94+
// groups:
95+
// - x25519
96+
//
97+
// +kubebuilder:validation:XValidation:rule="!has(self.minVersion) || !has(self.maxVersion) || self.minVersion <= self.maxVersion",message="minVersion must not be greater than maxVersion"
98+
type TlsConfig struct {
99+
// Profile defines the TLS security profile.
100+
// Valid values: "old", "intermediate" (default), "modern", "custom"
101+
// - old: TLS 1.0+ (legacy compatibility)
102+
// - intermediate: TLS 1.2+ (balanced security, default)
103+
// - modern: TLS 1.3 only (PQC-ready)
104+
// - custom: user-defined versions and ciphers
105+
// +kubebuilder:validation:Enum=old;intermediate;modern;custom
106+
// +kubebuilder:default=intermediate
107+
// +optional
108+
Profile string `json:"profile,omitempty"`
109+
110+
// MinVersion specifies minimum TLS version (only for custom profile)
111+
// Valid values: "1.0", "1.1", "1.2", "1.3"
112+
// +kubebuilder:validation:Pattern=`^1\.[0-3]$`
113+
// +optional
114+
MinVersion string `json:"minVersion,omitempty"`
115+
116+
// MaxVersion specifies maximum TLS version (only for custom profile)
117+
// Valid values: "1.0", "1.1", "1.2", "1.3"
118+
// +kubebuilder:validation:Pattern=`^1\.[0-3]$`
119+
// +optional
120+
MaxVersion string `json:"maxVersion,omitempty"`
121+
122+
// Ciphers is a list of cipher suites (only for custom profile)
123+
// Supports both IANA and OpenSSL formats
124+
// Example: ["TLS_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"]
125+
// +optional
126+
Ciphers []string `json:"ciphers,omitempty"`
127+
128+
// Groups specifies TLS key exchange groups (only for custom profile)
129+
// Example: ["x25519", "secp256r1"]
130+
// +optional
131+
Groups []string `json:"groups,omitempty"`
132+
}
133+
78134
// KbsConfigSpec defines the desired state of KbsConfig
79135
type KbsConfigSpec struct {
80136
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
@@ -143,10 +199,6 @@ type KbsConfigSpec struct {
143199
// +optional
144200
KbsResourcePolicyConfigMapName string `json:"kbsResourcePolicyConfigMapName,omitempty"`
145201

146-
// TdxConfigSpec is the struct that hosts the TDX specific configuration
147-
// +optional
148-
TdxConfigSpec TdxConfigSpec `json:"tdxConfigSpec,omitempty"`
149-
150202
// IbmSEConfigSpec is the struct that hosts the IBMSE specific configuration
151203
// +optional
152204
IbmSEConfigSpec IbmSEConfigSpec `json:"ibmSEConfigSpec,omitempty"`
@@ -242,6 +294,11 @@ type TrusteeConfigSpec struct {
242294
// Default value is ClusterIP
243295
// +optional
244296
KbsServiceType corev1.ServiceType `json:"kbsServiceType,omitempty"`
297+
298+
// TlsConfig defines TLS protocol and cipher configuration for KBS HTTPS server
299+
// If not specified, defaults to "intermediate" profile (TLS 1.2+)
300+
// +optional
301+
TlsConfig *TlsConfig `json:"tlsConfig,omitempty"`
245302
}
246303

247304
// TrusteeConfigStatus defines the observed state of TrusteeConfig

0 commit comments

Comments
 (0)