@@ -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+
184278func init () {
185- SchemeBuilder .Register (& KbsConfig {}, & KbsConfigList {})
279+ SchemeBuilder .Register (& KbsConfig {}, & KbsConfigList {}, & TrusteeConfig {}, & TrusteeConfigList {} )
186280}
0 commit comments