From e536651716b9017910813f2b235839e7bdf4d9da Mon Sep 17 00:00:00 2001 From: Wenqi Mou Date: Tue, 17 Sep 2024 10:22:55 -0400 Subject: [PATCH] add secrets fields for aws --- pkg/encryptionpb/encryptionpb.pb.go | 451 +++++++++++++++++++++++----- proto/encryptionpb.proto | 8 +- scripts/proto.lock | 20 ++ 3 files changed, 401 insertions(+), 78 deletions(-) diff --git a/pkg/encryptionpb/encryptionpb.pb.go b/pkg/encryptionpb/encryptionpb.pb.go index 6f05c8956..bd4fd2eda 100644 --- a/pkg/encryptionpb/encryptionpb.pb.go +++ b/pkg/encryptionpb/encryptionpb.pb.go @@ -573,7 +573,9 @@ type MasterKeyKms struct { // optional, used to set up azure master key backend AzureKms *AzureKms `protobuf:"bytes,5,opt,name=azure_kms,json=azureKms,proto3" json:"azure_kms,omitempty"` // optional, used to set up gcp master key backend - GcpKms *GcpKms `protobuf:"bytes,6,opt,name=gcp_kms,json=gcpKms,proto3" json:"gcp_kms,omitempty"` + GcpKms *GcpKms `protobuf:"bytes,6,opt,name=gcp_kms,json=gcpKms,proto3" json:"gcp_kms,omitempty"` + // optional, used to set up aws master key backend + AwsKms *AwsKms `protobuf:"bytes,7,opt,name=aws_kms,json=awsKms,proto3" json:"aws_kms,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -654,6 +656,13 @@ func (m *MasterKeyKms) GetGcpKms() *GcpKms { return nil } +func (m *MasterKeyKms) GetAwsKms() *AwsKms { + if m != nil { + return m.AwsKms + } + return nil +} + type AzureKms struct { TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` @@ -814,6 +823,61 @@ func (m *GcpKms) GetCredential() string { return "" } +type AwsKms struct { + AccessKey string `protobuf:"bytes,1,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` + SecretAccessKey string `protobuf:"bytes,2,opt,name=secret_access_key,json=secretAccessKey,proto3" json:"secret_access_key,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AwsKms) Reset() { *m = AwsKms{} } +func (m *AwsKms) String() string { return proto.CompactTextString(m) } +func (*AwsKms) ProtoMessage() {} +func (*AwsKms) Descriptor() ([]byte, []int) { + return fileDescriptor_a483860494a778a2, []int{11} +} +func (m *AwsKms) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AwsKms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AwsKms.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AwsKms) XXX_Merge(src proto.Message) { + xxx_messageInfo_AwsKms.Merge(m, src) +} +func (m *AwsKms) XXX_Size() int { + return m.Size() +} +func (m *AwsKms) XXX_DiscardUnknown() { + xxx_messageInfo_AwsKms.DiscardUnknown(m) +} + +var xxx_messageInfo_AwsKms proto.InternalMessageInfo + +func (m *AwsKms) GetAccessKey() string { + if m != nil { + return m.AccessKey + } + return "" +} + +func (m *AwsKms) GetSecretAccessKey() string { + if m != nil { + return m.SecretAccessKey + } + return "" +} + type EncryptedContent struct { // Metadata of the encrypted content. // Eg. IV, method and KMS key ID @@ -837,7 +901,7 @@ func (m *EncryptedContent) Reset() { *m = EncryptedContent{} } func (m *EncryptedContent) String() string { return proto.CompactTextString(m) } func (*EncryptedContent) ProtoMessage() {} func (*EncryptedContent) Descriptor() ([]byte, []int) { - return fileDescriptor_a483860494a778a2, []int{11} + return fileDescriptor_a483860494a778a2, []int{12} } func (m *EncryptedContent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -921,7 +985,7 @@ func (m *FileEncryptionInfo) Reset() { *m = FileEncryptionInfo{} } func (m *FileEncryptionInfo) String() string { return proto.CompactTextString(m) } func (*FileEncryptionInfo) ProtoMessage() {} func (*FileEncryptionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a483860494a778a2, []int{12} + return fileDescriptor_a483860494a778a2, []int{13} } func (m *FileEncryptionInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1028,7 +1092,7 @@ func (m *PlainTextDataKey) Reset() { *m = PlainTextDataKey{} } func (m *PlainTextDataKey) String() string { return proto.CompactTextString(m) } func (*PlainTextDataKey) ProtoMessage() {} func (*PlainTextDataKey) Descriptor() ([]byte, []int) { - return fileDescriptor_a483860494a778a2, []int{13} + return fileDescriptor_a483860494a778a2, []int{14} } func (m *PlainTextDataKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1069,7 +1133,7 @@ func (m *MasterKeyBased) Reset() { *m = MasterKeyBased{} } func (m *MasterKeyBased) String() string { return proto.CompactTextString(m) } func (*MasterKeyBased) ProtoMessage() {} func (*MasterKeyBased) Descriptor() ([]byte, []int) { - return fileDescriptor_a483860494a778a2, []int{14} + return fileDescriptor_a483860494a778a2, []int{15} } func (m *MasterKeyBased) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1120,6 +1184,7 @@ func init() { proto.RegisterType((*MasterKeyKms)(nil), "encryptionpb.MasterKeyKms") proto.RegisterType((*AzureKms)(nil), "encryptionpb.AzureKms") proto.RegisterType((*GcpKms)(nil), "encryptionpb.GcpKms") + proto.RegisterType((*AwsKms)(nil), "encryptionpb.AwsKms") proto.RegisterType((*EncryptedContent)(nil), "encryptionpb.EncryptedContent") proto.RegisterMapType((map[string][]byte)(nil), "encryptionpb.EncryptedContent.MetadataEntry") proto.RegisterType((*FileEncryptionInfo)(nil), "encryptionpb.FileEncryptionInfo") @@ -1130,78 +1195,82 @@ func init() { func init() { proto.RegisterFile("encryptionpb.proto", fileDescriptor_a483860494a778a2) } var fileDescriptor_a483860494a778a2 = []byte{ - // 1135 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x49, 0x6f, 0x23, 0x45, - 0x14, 0x76, 0x3b, 0xde, 0xfa, 0x79, 0xc1, 0x53, 0x64, 0xf1, 0x38, 0xc8, 0x58, 0x3d, 0x0c, 0x58, - 0x30, 0x63, 0x34, 0x1e, 0x08, 0x33, 0x20, 0x10, 0x49, 0x26, 0x60, 0xcb, 0xc4, 0x13, 0x75, 0x32, - 0x80, 0xc4, 0xa1, 0x55, 0xe9, 0x7e, 0xb1, 0x5b, 0x76, 0x77, 0x5b, 0xdd, 0x65, 0x27, 0xe6, 0x97, - 0xc0, 0x11, 0x4e, 0xfc, 0x05, 0xc4, 0x85, 0x23, 0x47, 0x2e, 0x48, 0x1c, 0x51, 0xb8, 0xf0, 0x33, - 0x50, 0x2d, 0x5e, 0x3a, 0x0b, 0x62, 0x4e, 0xae, 0xb7, 0x7c, 0xaf, 0xeb, 0x7d, 0x55, 0xef, 0x2b, - 0x03, 0x41, 0xdf, 0x0e, 0x67, 0x63, 0xe6, 0x06, 0xfe, 0xf8, 0xb4, 0x39, 0x0e, 0x03, 0x16, 0x90, - 0xc2, 0xaa, 0xaf, 0xba, 0xde, 0x0f, 0xfa, 0x81, 0x08, 0xbc, 0xcb, 0x57, 0x32, 0xa7, 0xfa, 0x4a, - 0x38, 0x89, 0x98, 0x58, 0x4a, 0x87, 0xf1, 0x01, 0x94, 0x0e, 0x16, 0xb0, 0x43, 0x64, 0x94, 0x6c, - 0x40, 0x66, 0x88, 0x33, 0xcb, 0x75, 0x2a, 0x5a, 0x5d, 0x6b, 0xa4, 0xcc, 0xf4, 0x10, 0x67, 0x1d, - 0x87, 0x94, 0x20, 0xe9, 0x4e, 0x2b, 0xc9, 0xba, 0xd6, 0x28, 0x98, 0x49, 0x77, 0x6a, 0xb8, 0x90, - 0xfb, 0xcc, 0x1d, 0x61, 0xc7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6b, 0xda, 0x5f, 0x97, 0x35, 0xed, 0xbb, 0xbf, 0x6b, 0x09, 0x28, - 0x07, 0x61, 0xbf, 0xc9, 0xdc, 0xe1, 0xb4, 0x39, 0x9c, 0x8a, 0x7f, 0x61, 0xa7, 0x19, 0xf1, 0xf3, - 0xf8, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x62, 0x5d, 0xc5, 0xd7, 0x09, 0x00, 0x00, + // 1190 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcf, 0x92, 0xdb, 0xc4, + 0x13, 0xb6, 0xb4, 0xb6, 0x6c, 0xb5, 0xff, 0xc4, 0x99, 0xdf, 0x26, 0xeb, 0x38, 0x3f, 0x8c, 0x4b, + 0x21, 0xe0, 0x0a, 0x89, 0xa9, 0x38, 0xb0, 0x24, 0x50, 0x50, 0xec, 0x26, 0x0b, 0x76, 0x99, 0x75, + 0xb6, 0xb4, 0x1b, 0xa0, 0x8a, 0x83, 0x6a, 0x56, 0xea, 0xd8, 0x2a, 0x5b, 0x92, 0x4b, 0x1a, 0x7b, + 0x63, 0xce, 0x3c, 0x04, 0x1c, 0xe1, 0xc4, 0x2b, 0x50, 0x5c, 0x38, 0x72, 0xe4, 0xc8, 0x91, 0x0a, + 0x17, 0x1e, 0x83, 0x9a, 0x19, 0x59, 0xb6, 0x76, 0xbd, 0x14, 0x39, 0x69, 0xba, 0xfb, 0xfb, 0x7a, + 0x66, 0xbe, 0x99, 0xee, 0x11, 0x10, 0xf4, 0xed, 0x70, 0x31, 0x65, 0x6e, 0xe0, 0x4f, 0x4f, 0xdb, + 0xd3, 0x30, 0x60, 0x01, 0x29, 0xad, 0xfb, 0xea, 0xdb, 0xc3, 0x60, 0x18, 0x88, 0xc0, 0x3b, 0x7c, + 0x24, 0x31, 0xf5, 0x2b, 0xe1, 0x2c, 0x62, 0x62, 0x28, 0x1d, 0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 0x4b, 0xfd, 0x2c, 0x5c, 0x5e, 0x2e, 0x6b, + 0x79, 0x75, 0xe4, 0x1d, 0x6c, 0xfc, 0xfb, 0x1d, 0x34, 0x77, 0x1c, 0x99, 0xfe, 0x7c, 0xe0, 0xce, + 0x38, 0xb9, 0xe2, 0xab, 0x3d, 0x15, 0x21, 0xff, 0x6c, 0xd0, 0x1f, 0x3c, 0xfd, 0x72, 0x50, 0xcd, + 0x90, 0x32, 0xe8, 0x47, 0x9f, 0xef, 0xf5, 0x06, 0x27, 0x07, 0x5f, 0x9d, 0x54, 0x15, 0x52, 0x01, + 0xd8, 0x3b, 0x38, 0xbe, 0xdf, 0x79, 0x68, 0x3d, 0x3e, 0x31, 0xab, 0xea, 0xd2, 0x7e, 0xd4, 0x11, + 0xf6, 0x56, 0x6c, 0x77, 0xde, 0xdb, 0x15, 0x76, 0x96, 0xe7, 0x3a, 0x3e, 0x7c, 0x57, 0x18, 0xb9, + 0xfd, 0x37, 0xff, 0xf8, 0xa9, 0xa0, 0xfc, 0xf6, 0xb2, 0xa1, 0xfc, 0xfe, 0xb2, 0xa1, 0xfc, 0xf9, + 0xb2, 0xa1, 0x7c, 0xf7, 0x57, 0x23, 0x03, 0xd5, 0x20, 0x1c, 0xb6, 0x99, 0x3b, 0x9e, 0xb7, 0xc7, + 0x73, 0xf1, 0x27, 0x78, 0xaa, 0x89, 0xcf, 0x83, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x2c, + 0xa1, 0xd2, 0x5b, 0x0a, 0x00, 0x00, } func (m *EncryptionMeta) Marshal() (dAtA []byte, err error) { @@ -1634,6 +1703,18 @@ func (m *MasterKeyKms) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.AwsKms != nil { + { + size, err := m.AwsKms.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEncryptionpb(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } if m.GcpKms != nil { { size, err := m.GcpKms.MarshalToSizedBuffer(dAtA[:i]) @@ -1813,6 +1894,47 @@ func (m *GcpKms) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AwsKms) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AwsKms) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AwsKms) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SecretAccessKey) > 0 { + i -= len(m.SecretAccessKey) + copy(dAtA[i:], m.SecretAccessKey) + i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.SecretAccessKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.AccessKey) > 0 { + i -= len(m.AccessKey) + copy(dAtA[i:], m.AccessKey) + i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.AccessKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *EncryptedContent) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2298,6 +2420,10 @@ func (m *MasterKeyKms) Size() (n int) { l = m.GcpKms.Size() n += 1 + l + sovEncryptionpb(uint64(l)) } + if m.AwsKms != nil { + l = m.AwsKms.Size() + n += 1 + l + sovEncryptionpb(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2368,6 +2494,26 @@ func (m *GcpKms) Size() (n int) { return n } +func (m *AwsKms) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AccessKey) + if l > 0 { + n += 1 + l + sovEncryptionpb(uint64(l)) + } + l = len(m.SecretAccessKey) + if l > 0 { + n += 1 + l + sovEncryptionpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *EncryptedContent) Size() (n int) { if m == nil { return 0 @@ -3748,6 +3894,42 @@ func (m *MasterKeyKms) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AwsKms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEncryptionpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEncryptionpb + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEncryptionpb + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AwsKms == nil { + m.AwsKms = &AwsKms{} + } + if err := m.AwsKms.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEncryptionpb(dAtA[iNdEx:]) @@ -4192,6 +4374,121 @@ func (m *GcpKms) Unmarshal(dAtA []byte) error { } return nil } +func (m *AwsKms) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEncryptionpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AwsKms: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AwsKms: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEncryptionpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEncryptionpb + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEncryptionpb + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AccessKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretAccessKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEncryptionpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEncryptionpb + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEncryptionpb + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecretAccessKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEncryptionpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEncryptionpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EncryptedContent) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/proto/encryptionpb.proto b/proto/encryptionpb.proto index af03b9d66..a5af3f84c 100644 --- a/proto/encryptionpb.proto +++ b/proto/encryptionpb.proto @@ -100,7 +100,8 @@ message MasterKeyKms { AzureKms azure_kms = 5; // optional, used to set up gcp master key backend GcpKms gcp_kms = 6; - + // optional, used to set up aws master key backend + AwsKms aws_kms = 7; } message AzureKms { @@ -122,6 +123,11 @@ message GcpKms { string credential = 1; } +message AwsKms { + string access_key = 1; + string secret_access_key = 2; +} + message EncryptedContent { // Metadata of the encrypted content. // Eg. IV, method and KMS key ID diff --git a/scripts/proto.lock b/scripts/proto.lock index ebb86d492..b50a5a8dc 100644 --- a/scripts/proto.lock +++ b/scripts/proto.lock @@ -5498,6 +5498,11 @@ "id": 6, "name": "gcp_kms", "type": "GcpKms" + }, + { + "id": 7, + "name": "aws_kms", + "type": "AwsKms" } ] }, @@ -5561,6 +5566,21 @@ } ] }, + { + "name": "AwsKms", + "fields": [ + { + "id": 1, + "name": "access_key", + "type": "string" + }, + { + "id": 2, + "name": "secret_access_key", + "type": "string" + } + ] + }, { "name": "EncryptedContent", "fields": [