Skip to content

Commit 6cd8898

Browse files
authored
Merge pull request #241 from lmilleri/backport-05112025
Backporting for v1.0.0
2 parents 668d26f + fbd9d7c commit 6cd8898

49 files changed

Lines changed: 2529 additions & 27 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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15+
16+
# Copy the config templates
17+
COPY config/templates/ config/templates/
1518
COPY cmd/main.go cmd/main.go
1619
COPY api/ api/
1720
COPY internal/controller/ internal/controller/
@@ -30,6 +33,10 @@ RUN microdnf install -y openssl && microdnf clean all
3033

3134
WORKDIR /
3235
COPY --from=builder /opt/app-root/src/manager .
36+
37+
# Copy the config templates
38+
COPY --from=builder /opt/app-root/src/config/templates/ /config/templates/
39+
3340
USER 65532:65532
3441

3542
ENTRYPOINT ["/manager"]

api/v1alpha1/kbsconfig_types.go

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ type KbsConfigSpec struct {
119119
// KbsHttpsCertSecretName is the name of the secret that contains the KBS https certificate
120120
KbsHttpsCertSecretName string `json:"kbsHttpsCertSecretName,omitempty"`
121121

122+
// KbsAttestationKeySecretName is the name of the secret that contains the attestation token private key
123+
// +optional
124+
KbsAttestationKeySecretName string `json:"kbsAttestationKeySecretName,omitempty"`
125+
126+
// KbsAttestationCertSecretName is the name of the secret that contains the attestation token certificate
127+
// +optional
128+
KbsAttestationCertSecretName string `json:"kbsAttestationCertSecretName,omitempty"`
129+
122130
// KbsSecretResources is an array of secret names that contain the keys required by clients
123131
// +optional
124132
KbsSecretResources []string `json:"kbsSecretResources,omitempty"`
@@ -181,6 +189,92 @@ type KbsConfigList struct {
181189
Items []KbsConfig `json:"items"`
182190
}
183191

192+
// HttpsSpec defines the desired state for HTTPS configuration
193+
type HttpsSpec struct {
194+
// TlsSecretName is the name of the Kubernetes TLS secret (type: kubernetes.io/tls)
195+
// that contains the TLS certificate and private key
196+
TlsSecretName string `json:"tlsSecretName,omitempty"`
197+
}
198+
199+
// AttestationTokenVerificationSpec token validation using trusted certificate authorities
200+
type AttestationTokenVerificationSpec struct {
201+
// TlsSecretName is the name of the Kubernetes TLS secret (type: kubernetes.io/tls)
202+
// that contains the TLS certificate for attestation token verification
203+
TlsSecretName string `json:"tlsSecretName,omitempty"`
204+
}
205+
206+
// Profile Type string determines the trustee profile
207+
// +enum
208+
type ProfileType string
209+
210+
const (
211+
// ProfileTypePermissive: permissive mode is enabled
212+
// - resource-policy is permissive
213+
// - debug log enabled by default
214+
ProfileTypePermissive ProfileType = "Permissive"
215+
216+
// ProfileTypeRestricted: restricted mode is enabled
217+
// - resource-policy is restricted
218+
// - https configuration is enforced
219+
// - insecure_api enforced to false
220+
// - insecure_key enforced to false
221+
ProfileTypeRestrictive ProfileType = "Restricted"
222+
)
223+
224+
// TrusteeConfigSpec defines the desired state of TrusteeConfig
225+
type TrusteeConfigSpec struct {
226+
// HttpsSpec is the struct that hosts the HTTPS configuration
227+
// +optional
228+
HttpsSpec HttpsSpec `json:"httpsSpec,omitempty"`
229+
230+
// AttestationTokenVerificationSpec token validation using trusted certificate authorities
231+
// +optional
232+
AttestationTokenVerificationSpec AttestationTokenVerificationSpec `json:"attestationTokenVerificationSpec,omitempty"`
233+
234+
// ProfileType determines how to configure trustee, e.g. in permissive/restricted mode etc.
235+
Profile ProfileType `json:"profileType,omitempty"`
236+
237+
// KbsServiceType is the type of service to create for KBS
238+
// Default value is ClusterIP
239+
// +optional
240+
KbsServiceType corev1.ServiceType `json:"kbsServiceType,omitempty"`
241+
}
242+
243+
// TrusteeConfigStatus defines the observed state of TrusteeConfig
244+
type TrusteeConfigStatus struct {
245+
// IsReady is true when the TrusteeConfig configuration is ready
246+
IsReady bool `json:"isReady,omitempty"`
247+
248+
// KbsConfigRef is a reference to the associated KbsConfig object
249+
// +optional
250+
KbsConfigRef *corev1.ObjectReference `json:"kbsConfigRef,omitempty"`
251+
252+
// StatusDescription provides a human-readable description of the current status
253+
// +optional
254+
StatusDescription string `json:"statusDescription,omitempty"`
255+
}
256+
257+
//+kubebuilder:object:root=true
258+
//+kubebuilder:subresource:status
259+
260+
// TrusteeConfig is the Schema for the trusteeconfigs API
261+
type TrusteeConfig struct {
262+
metav1.TypeMeta `json:",inline"`
263+
metav1.ObjectMeta `json:"metadata,omitempty"`
264+
265+
Spec TrusteeConfigSpec `json:"spec,omitempty"`
266+
Status TrusteeConfigStatus `json:"status,omitempty"`
267+
}
268+
269+
//+kubebuilder:object:root=true
270+
271+
// TrusteeConfigList contains a list of TrusteeConfig
272+
type TrusteeConfigList struct {
273+
metav1.TypeMeta `json:",inline"`
274+
metav1.ListMeta `json:"metadata,omitempty"`
275+
Items []TrusteeConfig `json:"items"`
276+
}
277+
184278
func init() {
185-
SchemeBuilder.Register(&KbsConfig{}, &KbsConfigList{})
279+
SchemeBuilder.Register(&KbsConfig{}, &KbsConfigList{}, &TrusteeConfig{}, &TrusteeConfigList{})
186280
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 127 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/confidentialcontainers.org_kbsconfigs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ spec:
7171
KbsAsConfigMapName is the name of the configmap that contains the KBS AS configuration
7272
Required only when MicroservicesDeployment is set
7373
type: string
74+
kbsAttestationCertSecretName:
75+
description: KbsAttestationCertSecretName is the name of the secret
76+
that contains the attestation token certificate
77+
type: string
78+
kbsAttestationKeySecretName:
79+
description: KbsAttestationKeySecretName is the name of the secret
80+
that contains the attestation token private key
81+
type: string
7482
kbsAttestationPolicyConfigMapName:
7583
description: KbsAttestationPolicyConfigMapName is the name of the
7684
configmap that contains the Attestation Policy

0 commit comments

Comments
 (0)