TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
|
|
|
|
|
|
// This file is part of MinIO Console Server
|
2023-02-06 22:32:49 -06:00
|
|
|
// Copyright (c) 2023 MinIO, Inc.
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
// This file was generated by the swagger tool.
|
|
|
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
|
|
|
|
|
|
import (
|
2021-06-08 12:35:39 -07:00
|
|
|
"context"
|
|
|
|
|
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
"github.com/go-openapi/errors"
|
|
|
|
|
"github.com/go-openapi/strfmt"
|
|
|
|
|
"github.com/go-openapi/swag"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// EncryptionConfiguration encryption configuration
|
|
|
|
|
//
|
|
|
|
|
// swagger:model encryptionConfiguration
|
|
|
|
|
type EncryptionConfiguration struct {
|
2020-09-22 15:50:37 -07:00
|
|
|
MetadataFields
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
|
|
|
|
|
// aws
|
|
|
|
|
Aws *AwsConfiguration `json:"aws,omitempty"`
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
// azure
|
|
|
|
|
Azure *AzureConfiguration `json:"azure,omitempty"`
|
|
|
|
|
|
2021-02-10 18:09:50 -08:00
|
|
|
// gcp
|
|
|
|
|
Gcp *GcpConfiguration `json:"gcp,omitempty"`
|
|
|
|
|
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
// gemalto
|
|
|
|
|
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
|
|
|
|
|
|
|
|
|
|
// image
|
|
|
|
|
Image string `json:"image,omitempty"`
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
// kms mtls
|
|
|
|
|
KmsMtls *EncryptionConfigurationAO1KmsMtls `json:"kms_mtls,omitempty"`
|
|
|
|
|
|
|
|
|
|
// minio mtls
|
|
|
|
|
MinioMtls *KeyPairConfiguration `json:"minio_mtls,omitempty"`
|
|
|
|
|
|
2022-10-07 08:15:56 -07:00
|
|
|
// raw
|
|
|
|
|
Raw string `json:"raw,omitempty"`
|
|
|
|
|
|
2021-05-20 12:31:57 -07:00
|
|
|
// replicas
|
|
|
|
|
Replicas string `json:"replicas,omitempty"`
|
|
|
|
|
|
2022-03-01 01:56:38 -06:00
|
|
|
// secrets to be deleted
|
|
|
|
|
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
// security context
|
|
|
|
|
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
// server tls
|
|
|
|
|
ServerTLS *KeyPairConfiguration `json:"server_tls,omitempty"`
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
|
|
|
|
|
// vault
|
|
|
|
|
Vault *VaultConfiguration `json:"vault,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-22 15:50:37 -07:00
|
|
|
// UnmarshalJSON unmarshals this object from a JSON structure
|
|
|
|
|
func (m *EncryptionConfiguration) UnmarshalJSON(raw []byte) error {
|
|
|
|
|
// AO0
|
|
|
|
|
var aO0 MetadataFields
|
|
|
|
|
if err := swag.ReadJSON(raw, &aO0); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
m.MetadataFields = aO0
|
|
|
|
|
|
|
|
|
|
// AO1
|
|
|
|
|
var dataAO1 struct {
|
|
|
|
|
Aws *AwsConfiguration `json:"aws,omitempty"`
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
Azure *AzureConfiguration `json:"azure,omitempty"`
|
|
|
|
|
|
2021-02-10 18:09:50 -08:00
|
|
|
Gcp *GcpConfiguration `json:"gcp,omitempty"`
|
|
|
|
|
|
2020-09-22 15:50:37 -07:00
|
|
|
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
|
|
|
|
|
|
|
|
|
|
Image string `json:"image,omitempty"`
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
KmsMtls *EncryptionConfigurationAO1KmsMtls `json:"kms_mtls,omitempty"`
|
|
|
|
|
|
|
|
|
|
MinioMtls *KeyPairConfiguration `json:"minio_mtls,omitempty"`
|
|
|
|
|
|
2022-10-07 08:15:56 -07:00
|
|
|
Raw string `json:"raw,omitempty"`
|
|
|
|
|
|
2021-05-20 12:31:57 -07:00
|
|
|
Replicas string `json:"replicas,omitempty"`
|
|
|
|
|
|
2022-03-01 01:56:38 -06:00
|
|
|
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
ServerTLS *KeyPairConfiguration `json:"server_tls,omitempty"`
|
2020-09-22 15:50:37 -07:00
|
|
|
|
|
|
|
|
Vault *VaultConfiguration `json:"vault,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m.Aws = dataAO1.Aws
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
m.Azure = dataAO1.Azure
|
|
|
|
|
|
2021-02-10 18:09:50 -08:00
|
|
|
m.Gcp = dataAO1.Gcp
|
|
|
|
|
|
2020-09-22 15:50:37 -07:00
|
|
|
m.Gemalto = dataAO1.Gemalto
|
|
|
|
|
|
|
|
|
|
m.Image = dataAO1.Image
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
m.KmsMtls = dataAO1.KmsMtls
|
|
|
|
|
|
|
|
|
|
m.MinioMtls = dataAO1.MinioMtls
|
|
|
|
|
|
2022-10-07 08:15:56 -07:00
|
|
|
m.Raw = dataAO1.Raw
|
|
|
|
|
|
2021-05-20 12:31:57 -07:00
|
|
|
m.Replicas = dataAO1.Replicas
|
|
|
|
|
|
2022-03-01 01:56:38 -06:00
|
|
|
m.SecretsToBeDeleted = dataAO1.SecretsToBeDeleted
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
m.SecurityContext = dataAO1.SecurityContext
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
m.ServerTLS = dataAO1.ServerTLS
|
2020-09-22 15:50:37 -07:00
|
|
|
|
|
|
|
|
m.Vault = dataAO1.Vault
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MarshalJSON marshals this object to a JSON structure
|
|
|
|
|
func (m EncryptionConfiguration) MarshalJSON() ([]byte, error) {
|
|
|
|
|
_parts := make([][]byte, 0, 2)
|
|
|
|
|
|
|
|
|
|
aO0, err := swag.WriteJSON(m.MetadataFields)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
_parts = append(_parts, aO0)
|
|
|
|
|
var dataAO1 struct {
|
|
|
|
|
Aws *AwsConfiguration `json:"aws,omitempty"`
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
Azure *AzureConfiguration `json:"azure,omitempty"`
|
|
|
|
|
|
2021-02-10 18:09:50 -08:00
|
|
|
Gcp *GcpConfiguration `json:"gcp,omitempty"`
|
|
|
|
|
|
2020-09-22 15:50:37 -07:00
|
|
|
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
|
|
|
|
|
|
|
|
|
|
Image string `json:"image,omitempty"`
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
KmsMtls *EncryptionConfigurationAO1KmsMtls `json:"kms_mtls,omitempty"`
|
|
|
|
|
|
|
|
|
|
MinioMtls *KeyPairConfiguration `json:"minio_mtls,omitempty"`
|
|
|
|
|
|
2022-10-07 08:15:56 -07:00
|
|
|
Raw string `json:"raw,omitempty"`
|
|
|
|
|
|
2021-05-20 12:31:57 -07:00
|
|
|
Replicas string `json:"replicas,omitempty"`
|
|
|
|
|
|
2022-03-01 01:56:38 -06:00
|
|
|
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
ServerTLS *KeyPairConfiguration `json:"server_tls,omitempty"`
|
2020-09-22 15:50:37 -07:00
|
|
|
|
|
|
|
|
Vault *VaultConfiguration `json:"vault,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dataAO1.Aws = m.Aws
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
dataAO1.Azure = m.Azure
|
|
|
|
|
|
2021-02-10 18:09:50 -08:00
|
|
|
dataAO1.Gcp = m.Gcp
|
|
|
|
|
|
2020-09-22 15:50:37 -07:00
|
|
|
dataAO1.Gemalto = m.Gemalto
|
|
|
|
|
|
|
|
|
|
dataAO1.Image = m.Image
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
dataAO1.KmsMtls = m.KmsMtls
|
|
|
|
|
|
|
|
|
|
dataAO1.MinioMtls = m.MinioMtls
|
|
|
|
|
|
2022-10-07 08:15:56 -07:00
|
|
|
dataAO1.Raw = m.Raw
|
|
|
|
|
|
2021-05-20 12:31:57 -07:00
|
|
|
dataAO1.Replicas = m.Replicas
|
|
|
|
|
|
2022-03-01 01:56:38 -06:00
|
|
|
dataAO1.SecretsToBeDeleted = m.SecretsToBeDeleted
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
dataAO1.SecurityContext = m.SecurityContext
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
dataAO1.ServerTLS = m.ServerTLS
|
2020-09-22 15:50:37 -07:00
|
|
|
|
|
|
|
|
dataAO1.Vault = m.Vault
|
|
|
|
|
|
|
|
|
|
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
|
|
|
|
|
if errAO1 != nil {
|
|
|
|
|
return nil, errAO1
|
|
|
|
|
}
|
|
|
|
|
_parts = append(_parts, jsonDataAO1)
|
|
|
|
|
return swag.ConcatJSON(_parts...), nil
|
|
|
|
|
}
|
|
|
|
|
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
// Validate validates this encryption configuration
|
|
|
|
|
func (m *EncryptionConfiguration) Validate(formats strfmt.Registry) error {
|
|
|
|
|
var res []error
|
|
|
|
|
|
2020-09-22 15:50:37 -07:00
|
|
|
// validation for a type composition with MetadataFields
|
|
|
|
|
if err := m.MetadataFields.Validate(formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
if err := m.validateAws(formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
if err := m.validateAzure(formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.validateGcp(formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := m.validateGemalto(formats); err != nil {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.validateKmsMtls(formats); err != nil {
|
2021-02-10 18:09:50 -08:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.validateMinioMtls(formats); err != nil {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
if err := m.validateSecurityContext(formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.validateServerTLS(formats); err != nil {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := m.validateVault(formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *EncryptionConfiguration) validateAws(formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if swag.IsZero(m.Aws) { // not required
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if m.Aws != nil {
|
|
|
|
|
if err := m.Aws.Validate(formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("aws")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("aws")
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
func (m *EncryptionConfiguration) validateAzure(formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if swag.IsZero(m.Azure) { // not required
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if m.Azure != nil {
|
|
|
|
|
if err := m.Azure.Validate(formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("azure")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("azure")
|
2021-09-21 20:56:07 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) validateGcp(formats strfmt.Registry) error {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if swag.IsZero(m.Gcp) { // not required
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.Gcp != nil {
|
|
|
|
|
if err := m.Gcp.Validate(formats); err != nil {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("gcp")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("gcp")
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) validateGemalto(formats strfmt.Registry) error {
|
2021-02-10 18:09:50 -08:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if swag.IsZero(m.Gemalto) { // not required
|
2021-02-10 18:09:50 -08:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.Gemalto != nil {
|
|
|
|
|
if err := m.Gemalto.Validate(formats); err != nil {
|
2021-02-10 18:09:50 -08:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("gemalto")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("gemalto")
|
2021-02-10 18:09:50 -08:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) validateKmsMtls(formats strfmt.Registry) error {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if swag.IsZero(m.KmsMtls) { // not required
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.KmsMtls != nil {
|
|
|
|
|
if err := m.KmsMtls.Validate(formats); err != nil {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("kms_mtls")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("kms_mtls")
|
|
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *EncryptionConfiguration) validateMinioMtls(formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if swag.IsZero(m.MinioMtls) { // not required
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if m.MinioMtls != nil {
|
|
|
|
|
if err := m.MinioMtls.Validate(formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("minio_mtls")
|
|
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("minio_mtls")
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
func (m *EncryptionConfiguration) validateSecurityContext(formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if swag.IsZero(m.SecurityContext) { // not required
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if m.SecurityContext != nil {
|
|
|
|
|
if err := m.SecurityContext.Validate(formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("securityContext")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("securityContext")
|
2021-10-19 09:42:36 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) validateServerTLS(formats strfmt.Registry) error {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if swag.IsZero(m.ServerTLS) { // not required
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.ServerTLS != nil {
|
|
|
|
|
if err := m.ServerTLS.Validate(formats); err != nil {
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("server_tls")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("server_tls")
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *EncryptionConfiguration) validateVault(formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if swag.IsZero(m.Vault) { // not required
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if m.Vault != nil {
|
|
|
|
|
if err := m.Vault.Validate(formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("vault")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("vault")
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-08 12:35:39 -07:00
|
|
|
// ContextValidate validate this encryption configuration based on the context it is used
|
|
|
|
|
func (m *EncryptionConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
|
|
// validation for a type composition with MetadataFields
|
|
|
|
|
if err := m.MetadataFields.ContextValidate(ctx, formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := m.contextValidateAws(ctx, formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-21 20:56:07 -07:00
|
|
|
if err := m.contextValidateAzure(ctx, formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.contextValidateGcp(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.contextValidateGemalto(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.contextValidateKmsMtls(ctx, formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := m.contextValidateMinioMtls(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if err := m.contextValidateServerTLS(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := m.contextValidateVault(ctx, formats); err != nil {
|
|
|
|
|
res = append(res, err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *EncryptionConfiguration) contextValidateAws(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if m.Aws != nil {
|
|
|
|
|
if err := m.Aws.ContextValidate(ctx, formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("aws")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("aws")
|
2021-06-08 12:35:39 -07:00
|
|
|
}
|
|
|
|
|
return err
|
2021-09-21 20:56:07 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *EncryptionConfiguration) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if m.Azure != nil {
|
|
|
|
|
if err := m.Azure.ContextValidate(ctx, formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("azure")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("azure")
|
2021-09-21 20:56:07 -07:00
|
|
|
}
|
|
|
|
|
return err
|
2021-06-08 12:35:39 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) contextValidateGcp(ctx context.Context, formats strfmt.Registry) error {
|
2021-06-08 12:35:39 -07:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.Gcp != nil {
|
|
|
|
|
if err := m.Gcp.ContextValidate(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("gcp")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("gcp")
|
2021-06-08 12:35:39 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) contextValidateGemalto(ctx context.Context, formats strfmt.Registry) error {
|
2021-06-08 12:35:39 -07:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.Gemalto != nil {
|
|
|
|
|
if err := m.Gemalto.ContextValidate(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("gemalto")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("gemalto")
|
2021-06-08 12:35:39 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) contextValidateKmsMtls(ctx context.Context, formats strfmt.Registry) error {
|
2021-06-08 12:35:39 -07:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.KmsMtls != nil {
|
|
|
|
|
if err := m.KmsMtls.ContextValidate(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("kms_mtls")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("kms_mtls")
|
|
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *EncryptionConfiguration) contextValidateMinioMtls(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if m.MinioMtls != nil {
|
|
|
|
|
if err := m.MinioMtls.ContextValidate(ctx, formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("minio_mtls")
|
|
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("minio_mtls")
|
2021-06-08 12:35:39 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-19 09:42:36 -07:00
|
|
|
func (m *EncryptionConfiguration) contextValidateSecurityContext(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if m.SecurityContext != nil {
|
|
|
|
|
if err := m.SecurityContext.ContextValidate(ctx, formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("securityContext")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("securityContext")
|
2021-10-19 09:42:36 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
func (m *EncryptionConfiguration) contextValidateServerTLS(ctx context.Context, formats strfmt.Registry) error {
|
2021-06-08 12:35:39 -07:00
|
|
|
|
2022-10-19 12:32:08 -07:00
|
|
|
if m.ServerTLS != nil {
|
|
|
|
|
if err := m.ServerTLS.ContextValidate(ctx, formats); err != nil {
|
2021-06-08 12:35:39 -07:00
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ve.ValidateName("server_tls")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
2022-10-19 12:32:08 -07:00
|
|
|
return ce.ValidateName("server_tls")
|
2021-06-08 12:35:39 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *EncryptionConfiguration) contextValidateVault(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
|
|
if m.Vault != nil {
|
|
|
|
|
if err := m.Vault.ContextValidate(ctx, formats); err != nil {
|
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
|
return ve.ValidateName("vault")
|
2022-01-12 18:59:14 -08:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
|
return ce.ValidateName("vault")
|
2021-06-08 12:35:39 -07:00
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
TLS with user provided certificates and KES support for MinIO (#213)
This PR adds the following features:
- Allow user to provide its own keypair certificates for enable TLS in
MinIO
- Allow user to configure data encryption at rest in MinIO with KES
- Removes JWT schema for login and instead Console authentication will use
encrypted session tokens
Enable TLS between client and MinIO with user provided certificates
Instead of using AutoCert feature now the user can provide `cert` and
`key` via `tls` object, values must be valid `x509.Certificate`
formatted files encoded in `base64`
Enable encryption at rest configuring KES
User can deploy KES via Console/Operator by defining the encryption
object, AutoCert must be enabled or custom certificates for KES must be
provided, KES support 3 KMS backends: `Vault`, `AWS KMS` and `Gemalto`,
previous configuration of the KMS is necessary.
eg of body request for create-tenant
```
{
"name": "honeywell",
"access_key": "minio",
"secret_key": "minio123",
"enable_mcs": false,
"enable_ssl": false,
"service_name": "honeywell",
"zones": [
{
"name": "honeywell-zone-1",
"servers": 1,
"volumes_per_server": 4,
"volume_configuration": {
"size": 256000000,
"storage_class": "vsan-default-storage-policy"
}
}
],
"namespace": "default",
"tls": {
"tls.crt": "",
"tls.key": ""
},
"encryption": {
"server": {
"tls.crt": "",
"tls.key": ""
},
"client": {
"tls.crt": "",
"tls.key": ""
},
"vault": {
"endpoint": "http://vault:8200",
"prefix": "",
"approle": {
"id": "",
"secret": ""
}
}
}
}
```
2020-07-30 17:49:56 -07:00
|
|
|
// MarshalBinary interface implementation
|
|
|
|
|
func (m *EncryptionConfiguration) MarshalBinary() ([]byte, error) {
|
|
|
|
|
if m == nil {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
|
func (m *EncryptionConfiguration) UnmarshalBinary(b []byte) error {
|
|
|
|
|
var res EncryptionConfiguration
|
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
*m = res
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2022-10-19 12:32:08 -07:00
|
|
|
|
|
|
|
|
// EncryptionConfigurationAO1KmsMtls encryption configuration a o1 kms mtls
|
|
|
|
|
//
|
|
|
|
|
// swagger:model EncryptionConfigurationAO1KmsMtls
|
|
|
|
|
type EncryptionConfigurationAO1KmsMtls struct {
|
|
|
|
|
|
|
|
|
|
// ca
|
|
|
|
|
Ca string `json:"ca,omitempty"`
|
|
|
|
|
|
|
|
|
|
// crt
|
|
|
|
|
Crt string `json:"crt,omitempty"`
|
|
|
|
|
|
|
|
|
|
// key
|
|
|
|
|
Key string `json:"key,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Validate validates this encryption configuration a o1 kms mtls
|
|
|
|
|
func (m *EncryptionConfigurationAO1KmsMtls) Validate(formats strfmt.Registry) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ContextValidate validates this encryption configuration a o1 kms mtls based on context it is used
|
|
|
|
|
func (m *EncryptionConfigurationAO1KmsMtls) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MarshalBinary interface implementation
|
|
|
|
|
func (m *EncryptionConfigurationAO1KmsMtls) MarshalBinary() ([]byte, error) {
|
|
|
|
|
if m == nil {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
|
func (m *EncryptionConfigurationAO1KmsMtls) UnmarshalBinary(b []byte) error {
|
|
|
|
|
var res EncryptionConfigurationAO1KmsMtls
|
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
*m = res
|
|
|
|
|
return nil
|
|
|
|
|
}
|