Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ tests:
kms:
type: Vault
vault:
kmsPluginImage: registry.example.com/vault-plugin@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
vaultAddress: https://vault.example.com:8200
authentication:
type: AppRole
Expand Down
353 changes: 165 additions & 188 deletions config/v1/tests/apiservers.config.openshift.io/VaultKMS.yaml

Large diffs are not rendered by default.

27 changes: 6 additions & 21 deletions config/v1/types_kmsencryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,29 +121,14 @@ type VaultAppRoleAuthentication struct {
}

// VaultKMSPluginConfig defines the KMS plugin configuration specific to Vault KMS
// +kubebuilder:validation:XValidation:rule="!has(self.kmsPluginImage)",message="kmsPluginImage is managed by the platform and may not be set"
type VaultKMSPluginConfig struct {
// kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.
// kmsPluginImage must not be set. The container image for the HashiCorp Vault
// KMS plugin is sourced by the platform from the KMS plugin provider ConfigMap.
// The field exists so the controller can carry that value in memory; it is
// never persisted on this resource and any value provided here is rejected.
//
// The image must be a fully qualified OCI image pull spec with a SHA256 digest.
// The format is: host[:port][/namespace]/name@sha256:<digest>
// where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
// The total length must be between 75 and 447 characters.
//
// Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
// The registry hostname must be included and must contain at least one dot.
// Image tags (e.g., ":latest", ":v1.0.0") are not allowed.
//
// Consult the OpenShift documentation for compatible plugin versions with your cluster version,
// then obtain the image digest for that version from HashiCorp's container registry.
//
// For disconnected environments, mirror the plugin image to an accessible registry
// and reference the mirrored location with its digest.
//
// +kubebuilder:validation:MinLength=75
// +kubebuilder:validation:MaxLength=447
// +kubebuilder:validation:XValidation:rule=`(self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))`,message="the OCI Image reference must end with a valid '@sha256:<digest>' suffix, where '<digest>' is 64 characters long"
// +kubebuilder:validation:XValidation:rule=`(self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))`,message="the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme. Short names are not allowed, the registry hostname must be included."
// +required
// +optional
KMSPluginImage string `json:"kmsPluginImage,omitempty"`

// vaultAddress specifies the address of the HashiCorp Vault instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,35 +237,11 @@ spec:
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
kmsPluginImage must not be set. The container image for the HashiCorp Vault
KMS plugin is sourced by the platform from the KMS plugin provider ConfigMap.
The field exists so the controller can carry that value in memory; it is
never persisted on this resource and any value provided here is rejected.
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,10 +413,13 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
x-kubernetes-validations:
- message: kmsPluginImage is managed by the platform and may
not be set
rule: '!has(self.kmsPluginImage)'
required:
- type
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,35 +237,11 @@ spec:
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
kmsPluginImage must not be set. The container image for the HashiCorp Vault
KMS plugin is sourced by the platform from the KMS plugin provider ConfigMap.
The field exists so the controller can carry that value in memory; it is
never persisted on this resource and any value provided here is rejected.
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,10 +413,13 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
x-kubernetes-validations:
- message: kmsPluginImage is managed by the platform and may
not be set
rule: '!has(self.kmsPluginImage)'
required:
- type
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,35 +237,11 @@ spec:
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
kmsPluginImage must not be set. The container image for the HashiCorp Vault
KMS plugin is sourced by the platform from the KMS plugin provider ConfigMap.
The field exists so the controller can carry that value in memory; it is
never persisted on this resource and any value provided here is rejected.
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,10 +413,13 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
x-kubernetes-validations:
- message: kmsPluginImage is managed by the platform and may
not be set
rule: '!has(self.kmsPluginImage)'
required:
- type
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,35 +237,11 @@ spec:
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
kmsPluginImage must not be set. The container image for the HashiCorp Vault
KMS plugin is sourced by the platform from the KMS plugin provider ConfigMap.
The field exists so the controller can carry that value in memory; it is
never persisted on this resource and any value provided here is rejected.
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,10 +413,13 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
x-kubernetes-validations:
- message: kmsPluginImage is managed by the platform and may
not be set
rule: '!has(self.kmsPluginImage)'
required:
- type
type: object
Expand Down
Loading