/
npds.pb.go
1772 lines (1585 loc) · 72.4 KB
/
npds.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v4.23.4
// source: cilium/api/npds.proto
package cilium
import (
context "context"
_ "github.com/cilium/proxy/go/envoy/annotations"
v3 "github.com/cilium/proxy/go/envoy/config/core/v3"
v31 "github.com/cilium/proxy/go/envoy/config/route/v3"
v33 "github.com/cilium/proxy/go/envoy/service/discovery/v3"
v32 "github.com/cilium/proxy/go/envoy/type/matcher/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// Action specifies what to do when the header matches.
type HeaderMatch_MatchAction int32
const (
HeaderMatch_CONTINUE_ON_MATCH HeaderMatch_MatchAction = 0 // Keep checking other matches (default)
HeaderMatch_FAIL_ON_MATCH HeaderMatch_MatchAction = 1 // Drop the request if no other rule matches
HeaderMatch_DELETE_ON_MATCH HeaderMatch_MatchAction = 2 // Remove the whole matching header
)
// Enum value maps for HeaderMatch_MatchAction.
var (
HeaderMatch_MatchAction_name = map[int32]string{
0: "CONTINUE_ON_MATCH",
1: "FAIL_ON_MATCH",
2: "DELETE_ON_MATCH",
}
HeaderMatch_MatchAction_value = map[string]int32{
"CONTINUE_ON_MATCH": 0,
"FAIL_ON_MATCH": 1,
"DELETE_ON_MATCH": 2,
}
)
func (x HeaderMatch_MatchAction) Enum() *HeaderMatch_MatchAction {
p := new(HeaderMatch_MatchAction)
*p = x
return p
}
func (x HeaderMatch_MatchAction) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (HeaderMatch_MatchAction) Descriptor() protoreflect.EnumDescriptor {
return file_cilium_api_npds_proto_enumTypes[0].Descriptor()
}
func (HeaderMatch_MatchAction) Type() protoreflect.EnumType {
return &file_cilium_api_npds_proto_enumTypes[0]
}
func (x HeaderMatch_MatchAction) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use HeaderMatch_MatchAction.Descriptor instead.
func (HeaderMatch_MatchAction) EnumDescriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{5, 0}
}
type HeaderMatch_MismatchAction int32
const (
HeaderMatch_FAIL_ON_MISMATCH HeaderMatch_MismatchAction = 0 // Drop the request if no other rule matches (default)
HeaderMatch_CONTINUE_ON_MISMATCH HeaderMatch_MismatchAction = 1 // Keep checking other matches, log the mismatch
HeaderMatch_ADD_ON_MISMATCH HeaderMatch_MismatchAction = 2 // Add 'value' to the multivalued header
HeaderMatch_DELETE_ON_MISMATCH HeaderMatch_MismatchAction = 3 // Remove the whole mismatching header
HeaderMatch_REPLACE_ON_MISMATCH HeaderMatch_MismatchAction = 4 // Replace the whole mismatching header with 'value'
)
// Enum value maps for HeaderMatch_MismatchAction.
var (
HeaderMatch_MismatchAction_name = map[int32]string{
0: "FAIL_ON_MISMATCH",
1: "CONTINUE_ON_MISMATCH",
2: "ADD_ON_MISMATCH",
3: "DELETE_ON_MISMATCH",
4: "REPLACE_ON_MISMATCH",
}
HeaderMatch_MismatchAction_value = map[string]int32{
"FAIL_ON_MISMATCH": 0,
"CONTINUE_ON_MISMATCH": 1,
"ADD_ON_MISMATCH": 2,
"DELETE_ON_MISMATCH": 3,
"REPLACE_ON_MISMATCH": 4,
}
)
func (x HeaderMatch_MismatchAction) Enum() *HeaderMatch_MismatchAction {
p := new(HeaderMatch_MismatchAction)
*p = x
return p
}
func (x HeaderMatch_MismatchAction) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (HeaderMatch_MismatchAction) Descriptor() protoreflect.EnumDescriptor {
return file_cilium_api_npds_proto_enumTypes[1].Descriptor()
}
func (HeaderMatch_MismatchAction) Type() protoreflect.EnumType {
return &file_cilium_api_npds_proto_enumTypes[1]
}
func (x HeaderMatch_MismatchAction) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use HeaderMatch_MismatchAction.Descriptor instead.
func (HeaderMatch_MismatchAction) EnumDescriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{5, 1}
}
// A network policy that is enforced by a filter on the network flows to/from
// associated hosts.
type NetworkPolicy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// IPs of the endpoint to which this policy applies.
// Required.
EndpointIps []string `protobuf:"bytes,1,rep,name=endpoint_ips,json=endpointIps,proto3" json:"endpoint_ips,omitempty"`
// The endpoint identifier associated with the network policy.
// Required.
EndpointId uint64 `protobuf:"varint,2,opt,name=endpoint_id,json=endpointId,proto3" json:"endpoint_id,omitempty"`
// The part of the policy to be enforced at ingress by the filter, as a set
// of per-port network policies, one per destination L4 port.
// Every PortNetworkPolicy element in this set has a unique port / protocol
// combination.
// Optional. If empty, all flows in this direction are denied.
IngressPerPortPolicies []*PortNetworkPolicy `protobuf:"bytes,3,rep,name=ingress_per_port_policies,json=ingressPerPortPolicies,proto3" json:"ingress_per_port_policies,omitempty"`
// The part of the policy to be enforced at egress by the filter, as a set
// of per-port network policies, one per destination L4 port.
// Every PortNetworkPolicy element in this set has a unique port / protocol
// combination.
// Optional. If empty, all flows in this direction are denied.
EgressPerPortPolicies []*PortNetworkPolicy `protobuf:"bytes,4,rep,name=egress_per_port_policies,json=egressPerPortPolicies,proto3" json:"egress_per_port_policies,omitempty"`
// Name of the conntrack map to use with this policy.
// The paths to various Cilium conntrack maps are derived using this name.
// Optional. If empty, ipcache or hostmap lookup is used instead of conntrack
// map.
ConntrackMapName string `protobuf:"bytes,5,opt,name=conntrack_map_name,json=conntrackMapName,proto3" json:"conntrack_map_name,omitempty"`
}
func (x *NetworkPolicy) Reset() {
*x = NetworkPolicy{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NetworkPolicy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NetworkPolicy) ProtoMessage() {}
func (x *NetworkPolicy) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NetworkPolicy.ProtoReflect.Descriptor instead.
func (*NetworkPolicy) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{0}
}
func (x *NetworkPolicy) GetEndpointIps() []string {
if x != nil {
return x.EndpointIps
}
return nil
}
func (x *NetworkPolicy) GetEndpointId() uint64 {
if x != nil {
return x.EndpointId
}
return 0
}
func (x *NetworkPolicy) GetIngressPerPortPolicies() []*PortNetworkPolicy {
if x != nil {
return x.IngressPerPortPolicies
}
return nil
}
func (x *NetworkPolicy) GetEgressPerPortPolicies() []*PortNetworkPolicy {
if x != nil {
return x.EgressPerPortPolicies
}
return nil
}
func (x *NetworkPolicy) GetConntrackMapName() string {
if x != nil {
return x.ConntrackMapName
}
return ""
}
// A network policy to whitelist flows to a specific destination L4 port,
// as a conjunction of predicates on L3/L4/L7 flows.
// If all the predicates of a policy match a flow, the flow is whitelisted.
type PortNetworkPolicy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The flows' destination L4 port number, as an unsigned 16-bit integer.
// If 0, all destination L4 port numbers are matched by this predicate.
Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"`
// The end of the destination port range, if non-zero.
EndPort uint32 `protobuf:"varint,4,opt,name=end_port,json=endPort,proto3" json:"end_port,omitempty"`
// The flows' L4 transport protocol.
// Required.
Protocol v3.SocketAddress_Protocol `protobuf:"varint,2,opt,name=protocol,proto3,enum=envoy.config.core.v3.SocketAddress_Protocol" json:"protocol,omitempty"`
// The network policy rules to be enforced on the flows to the port.
// Optional. A flow is matched by this predicate if either the set of
// rules is empty or any of the rules matches it.
Rules []*PortNetworkPolicyRule `protobuf:"bytes,3,rep,name=rules,proto3" json:"rules,omitempty"`
}
func (x *PortNetworkPolicy) Reset() {
*x = PortNetworkPolicy{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PortNetworkPolicy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PortNetworkPolicy) ProtoMessage() {}
func (x *PortNetworkPolicy) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PortNetworkPolicy.ProtoReflect.Descriptor instead.
func (*PortNetworkPolicy) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{1}
}
func (x *PortNetworkPolicy) GetPort() uint32 {
if x != nil {
return x.Port
}
return 0
}
func (x *PortNetworkPolicy) GetEndPort() uint32 {
if x != nil {
return x.EndPort
}
return 0
}
func (x *PortNetworkPolicy) GetProtocol() v3.SocketAddress_Protocol {
if x != nil {
return x.Protocol
}
return v3.SocketAddress_TCP
}
func (x *PortNetworkPolicy) GetRules() []*PortNetworkPolicyRule {
if x != nil {
return x.Rules
}
return nil
}
type TLSContext struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// CA certificates. If present, the counterparty must provide a valid
// certificate.
// Deprecated, use 'validation_context_sds_secret' instead.
TrustedCa string `protobuf:"bytes,1,opt,name=trusted_ca,json=trustedCa,proto3" json:"trusted_ca,omitempty"`
// Certificate chain.
// Deprecated, use 'tls_sds_secret' instead.
CertificateChain string `protobuf:"bytes,2,opt,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"`
// Private key
// Deprecated, use 'tls_sds_secret' instead.
PrivateKey string `protobuf:"bytes,3,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
// Server Name Indicator. For downstream this helps choose the certificate to
// present to the client. For upstream this will be used as the SNI on the
// client connection.
ServerNames []string `protobuf:"bytes,4,rep,name=server_names,json=serverNames,proto3" json:"server_names,omitempty"`
// Name of an SDS secret for CA certificates. Secret is fetched from the same gRPC source as
// this Network Policy. If present, the counterparty must provide a valid certificate.
// May not be used at the same time with 'trusted_ca'.
ValidationContextSdsSecret string `protobuf:"bytes,5,opt,name=validation_context_sds_secret,json=validationContextSdsSecret,proto3" json:"validation_context_sds_secret,omitempty"`
// Name of an SDS secret for both TLS private key and certificate chain. Secret is fetched
// from the same gRPC source as this Network Policy.
// May not be used at the same time with 'certificate_chain' or 'private_key'.
TlsSdsSecret string `protobuf:"bytes,6,opt,name=tls_sds_secret,json=tlsSdsSecret,proto3" json:"tls_sds_secret,omitempty"`
}
func (x *TLSContext) Reset() {
*x = TLSContext{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TLSContext) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TLSContext) ProtoMessage() {}
func (x *TLSContext) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TLSContext.ProtoReflect.Descriptor instead.
func (*TLSContext) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{2}
}
func (x *TLSContext) GetTrustedCa() string {
if x != nil {
return x.TrustedCa
}
return ""
}
func (x *TLSContext) GetCertificateChain() string {
if x != nil {
return x.CertificateChain
}
return ""
}
func (x *TLSContext) GetPrivateKey() string {
if x != nil {
return x.PrivateKey
}
return ""
}
func (x *TLSContext) GetServerNames() []string {
if x != nil {
return x.ServerNames
}
return nil
}
func (x *TLSContext) GetValidationContextSdsSecret() string {
if x != nil {
return x.ValidationContextSdsSecret
}
return ""
}
func (x *TLSContext) GetTlsSdsSecret() string {
if x != nil {
return x.TlsSdsSecret
}
return ""
}
// A network policy rule, as a conjunction of predicates on L3/L7 flows.
// If all the predicates of a rule match a flow, the flow is matched by the
// rule.
type PortNetworkPolicyRule struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Traffic on this port is denied for all `remote_policies` if true
Deny bool `protobuf:"varint,8,opt,name=deny,proto3" json:"deny,omitempty"`
// Optional name for the rule, can be used in logging and error messages.
Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
// The set of numeric remote security IDs explicitly allowed or denied.
// A flow is matched by this predicate if the identifier of the policy
// applied on the flow's remote host is contained in this set.
// Optional. If not specified, any remote host is matched by this predicate.
// This field is deprecated, use remote_policies instead.
// TODO: Remove when Cilium 1.14 no longer supported.
DeprecatedRemotePolicies_64 []uint64 `protobuf:"varint,1,rep,packed,name=deprecated_remote_policies_64,json=deprecatedRemotePolicies64,proto3" json:"deprecated_remote_policies_64,omitempty"`
RemotePolicies []uint32 `protobuf:"varint,7,rep,packed,name=remote_policies,json=remotePolicies,proto3" json:"remote_policies,omitempty"`
// Optional downstream TLS context. If present, the incoming connection must
// be a TLS connection.
DownstreamTlsContext *TLSContext `protobuf:"bytes,3,opt,name=downstream_tls_context,json=downstreamTlsContext,proto3" json:"downstream_tls_context,omitempty"`
// Optional upstream TLS context. If present, the outgoing connection will use
// TLS.
UpstreamTlsContext *TLSContext `protobuf:"bytes,4,opt,name=upstream_tls_context,json=upstreamTlsContext,proto3" json:"upstream_tls_context,omitempty"`
// Optional allowed SNIs in TLS handshake.
ServerNames []string `protobuf:"bytes,6,rep,name=server_names,json=serverNames,proto3" json:"server_names,omitempty"`
// Optional L7 protocol parser name. This is only used if the parser is not
// one of the well knows ones. If specified, the l7 parser having this name
// needs to be built in to libcilium.so.
L7Proto string `protobuf:"bytes,2,opt,name=l7_proto,json=l7Proto,proto3" json:"l7_proto,omitempty"`
// Optional. If not specified, any L7 request is matched by this predicate.
// All rules on any given port must have the same type of L7 rules!
//
// Types that are assignable to L7:
//
// *PortNetworkPolicyRule_HttpRules
// *PortNetworkPolicyRule_KafkaRules
// *PortNetworkPolicyRule_L7Rules
L7 isPortNetworkPolicyRule_L7 `protobuf_oneof:"l7"`
}
func (x *PortNetworkPolicyRule) Reset() {
*x = PortNetworkPolicyRule{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PortNetworkPolicyRule) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PortNetworkPolicyRule) ProtoMessage() {}
func (x *PortNetworkPolicyRule) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PortNetworkPolicyRule.ProtoReflect.Descriptor instead.
func (*PortNetworkPolicyRule) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{3}
}
func (x *PortNetworkPolicyRule) GetDeny() bool {
if x != nil {
return x.Deny
}
return false
}
func (x *PortNetworkPolicyRule) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *PortNetworkPolicyRule) GetDeprecatedRemotePolicies_64() []uint64 {
if x != nil {
return x.DeprecatedRemotePolicies_64
}
return nil
}
func (x *PortNetworkPolicyRule) GetRemotePolicies() []uint32 {
if x != nil {
return x.RemotePolicies
}
return nil
}
func (x *PortNetworkPolicyRule) GetDownstreamTlsContext() *TLSContext {
if x != nil {
return x.DownstreamTlsContext
}
return nil
}
func (x *PortNetworkPolicyRule) GetUpstreamTlsContext() *TLSContext {
if x != nil {
return x.UpstreamTlsContext
}
return nil
}
func (x *PortNetworkPolicyRule) GetServerNames() []string {
if x != nil {
return x.ServerNames
}
return nil
}
func (x *PortNetworkPolicyRule) GetL7Proto() string {
if x != nil {
return x.L7Proto
}
return ""
}
func (m *PortNetworkPolicyRule) GetL7() isPortNetworkPolicyRule_L7 {
if m != nil {
return m.L7
}
return nil
}
func (x *PortNetworkPolicyRule) GetHttpRules() *HttpNetworkPolicyRules {
if x, ok := x.GetL7().(*PortNetworkPolicyRule_HttpRules); ok {
return x.HttpRules
}
return nil
}
func (x *PortNetworkPolicyRule) GetKafkaRules() *KafkaNetworkPolicyRules {
if x, ok := x.GetL7().(*PortNetworkPolicyRule_KafkaRules); ok {
return x.KafkaRules
}
return nil
}
func (x *PortNetworkPolicyRule) GetL7Rules() *L7NetworkPolicyRules {
if x, ok := x.GetL7().(*PortNetworkPolicyRule_L7Rules); ok {
return x.L7Rules
}
return nil
}
type isPortNetworkPolicyRule_L7 interface {
isPortNetworkPolicyRule_L7()
}
type PortNetworkPolicyRule_HttpRules struct {
// The set of HTTP network policy rules.
// An HTTP request is matched by this predicate if any of its rules matches
// the request.
HttpRules *HttpNetworkPolicyRules `protobuf:"bytes,100,opt,name=http_rules,json=httpRules,proto3,oneof"`
}
type PortNetworkPolicyRule_KafkaRules struct {
// The set of Kafka network policy rules.
// A Kafka request is matched by this predicate if any of its rules matches
// the request.
KafkaRules *KafkaNetworkPolicyRules `protobuf:"bytes,101,opt,name=kafka_rules,json=kafkaRules,proto3,oneof"`
}
type PortNetworkPolicyRule_L7Rules struct {
// Set of Generic policy rules used when 'l7_proto' is defined.
// Only to be used for l7 protocols for which a specific oneof
// is not defined
L7Rules *L7NetworkPolicyRules `protobuf:"bytes,102,opt,name=l7_rules,json=l7Rules,proto3,oneof"`
}
func (*PortNetworkPolicyRule_HttpRules) isPortNetworkPolicyRule_L7() {}
func (*PortNetworkPolicyRule_KafkaRules) isPortNetworkPolicyRule_L7() {}
func (*PortNetworkPolicyRule_L7Rules) isPortNetworkPolicyRule_L7() {}
// A set of network policy rules that match HTTP requests.
type HttpNetworkPolicyRules struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The set of HTTP network policy rules.
// An HTTP request is matched if any of its rules matches the request.
// Required and may not be empty.
HttpRules []*HttpNetworkPolicyRule `protobuf:"bytes,1,rep,name=http_rules,json=httpRules,proto3" json:"http_rules,omitempty"`
}
func (x *HttpNetworkPolicyRules) Reset() {
*x = HttpNetworkPolicyRules{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HttpNetworkPolicyRules) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HttpNetworkPolicyRules) ProtoMessage() {}
func (x *HttpNetworkPolicyRules) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HttpNetworkPolicyRules.ProtoReflect.Descriptor instead.
func (*HttpNetworkPolicyRules) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{4}
}
func (x *HttpNetworkPolicyRules) GetHttpRules() []*HttpNetworkPolicyRule {
if x != nil {
return x.HttpRules
}
return nil
}
type HeaderMatch struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // empty for presence match. For secret data use 'value_sds_secret' instead.
MatchAction HeaderMatch_MatchAction `protobuf:"varint,3,opt,name=match_action,json=matchAction,proto3,enum=cilium.HeaderMatch_MatchAction" json:"match_action,omitempty"`
MismatchAction HeaderMatch_MismatchAction `protobuf:"varint,4,opt,name=mismatch_action,json=mismatchAction,proto3,enum=cilium.HeaderMatch_MismatchAction" json:"mismatch_action,omitempty"`
// Generic secret name for fetching value via SDS. Secret is fetched from the same gRPC source as
// this Network Policy.
ValueSdsSecret string `protobuf:"bytes,5,opt,name=value_sds_secret,json=valueSdsSecret,proto3" json:"value_sds_secret,omitempty"`
}
func (x *HeaderMatch) Reset() {
*x = HeaderMatch{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HeaderMatch) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HeaderMatch) ProtoMessage() {}
func (x *HeaderMatch) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HeaderMatch.ProtoReflect.Descriptor instead.
func (*HeaderMatch) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{5}
}
func (x *HeaderMatch) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *HeaderMatch) GetValue() string {
if x != nil {
return x.Value
}
return ""
}
func (x *HeaderMatch) GetMatchAction() HeaderMatch_MatchAction {
if x != nil {
return x.MatchAction
}
return HeaderMatch_CONTINUE_ON_MATCH
}
func (x *HeaderMatch) GetMismatchAction() HeaderMatch_MismatchAction {
if x != nil {
return x.MismatchAction
}
return HeaderMatch_FAIL_ON_MISMATCH
}
func (x *HeaderMatch) GetValueSdsSecret() string {
if x != nil {
return x.ValueSdsSecret
}
return ""
}
// An HTTP network policy rule, as a conjunction of predicates on HTTP requests.
// If all the predicates of a rule match an HTTP request, the request is
// allowed. Otherwise, it is denied.
type HttpNetworkPolicyRule struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// A set of matchers on the HTTP request's headers' names and values.
// If all the matchers in this set match an HTTP request, the request is
// allowed by this rule. Otherwise, it is denied.
//
// Some special header names are:
//
// * *:uri*: The HTTP request's URI.
// * *:method*: The HTTP request's method.
// * *:authority*: Also maps to the HTTP 1.1 *Host* header.
//
// Optional. If empty, matches any HTTP request.
Headers []*v31.HeaderMatcher `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"`
// header_matches is a set of HTTP header name and value pairs that
// will be matched against the request headers, if all the other match
// requirements in 'headers' are met. Each HeaderAction determines what to do
// when there is a match or mismatch.
//
// Optional.
HeaderMatches []*HeaderMatch `protobuf:"bytes,2,rep,name=header_matches,json=headerMatches,proto3" json:"header_matches,omitempty"`
}
func (x *HttpNetworkPolicyRule) Reset() {
*x = HttpNetworkPolicyRule{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HttpNetworkPolicyRule) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HttpNetworkPolicyRule) ProtoMessage() {}
func (x *HttpNetworkPolicyRule) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HttpNetworkPolicyRule.ProtoReflect.Descriptor instead.
func (*HttpNetworkPolicyRule) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{6}
}
func (x *HttpNetworkPolicyRule) GetHeaders() []*v31.HeaderMatcher {
if x != nil {
return x.Headers
}
return nil
}
func (x *HttpNetworkPolicyRule) GetHeaderMatches() []*HeaderMatch {
if x != nil {
return x.HeaderMatches
}
return nil
}
// A set of network policy rules that match Kafka requests.
type KafkaNetworkPolicyRules struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The set of Kafka network policy rules.
// A Kafka request is matched if any of its rules matches the request.
// Required and may not be empty.
KafkaRules []*KafkaNetworkPolicyRule `protobuf:"bytes,1,rep,name=kafka_rules,json=kafkaRules,proto3" json:"kafka_rules,omitempty"`
}
func (x *KafkaNetworkPolicyRules) Reset() {
*x = KafkaNetworkPolicyRules{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *KafkaNetworkPolicyRules) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*KafkaNetworkPolicyRules) ProtoMessage() {}
func (x *KafkaNetworkPolicyRules) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use KafkaNetworkPolicyRules.ProtoReflect.Descriptor instead.
func (*KafkaNetworkPolicyRules) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{7}
}
func (x *KafkaNetworkPolicyRules) GetKafkaRules() []*KafkaNetworkPolicyRule {
if x != nil {
return x.KafkaRules
}
return nil
}
// A Kafka network policy rule, as a conjunction of predicates on Kafka
// requests. If all the predicates of a rule match a Kafka request, the request
// is allowed. Otherwise, it is denied.
type KafkaNetworkPolicyRule struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The Kafka request's API version.
// If < 0, all Kafka requests are matched by this predicate.
ApiVersion int32 `protobuf:"varint,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
// Set of allowed API keys in the Kafka request.
// If none, all Kafka requests are matched by this predicate.
ApiKeys []int32 `protobuf:"varint,2,rep,packed,name=api_keys,json=apiKeys,proto3" json:"api_keys,omitempty"`
// The Kafka request's client ID.
// Optional. If not specified, all Kafka requests are matched by this
// predicate. If specified, this predicates only matches requests that contain
// this client ID, and never matches requests that don't contain any client
// ID.
ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
// The Kafka request's topic.
// Optional. If not specified, this rule will not consider the Kafka request's
// topics. If specified, this predicates only matches requests that contain
// this topic, and never matches requests that don't contain any topic.
// However, messages that can not contain a topic will also me matched.
Topic string `protobuf:"bytes,4,opt,name=topic,proto3" json:"topic,omitempty"`
}
func (x *KafkaNetworkPolicyRule) Reset() {
*x = KafkaNetworkPolicyRule{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *KafkaNetworkPolicyRule) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*KafkaNetworkPolicyRule) ProtoMessage() {}
func (x *KafkaNetworkPolicyRule) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use KafkaNetworkPolicyRule.ProtoReflect.Descriptor instead.
func (*KafkaNetworkPolicyRule) Descriptor() ([]byte, []int) {
return file_cilium_api_npds_proto_rawDescGZIP(), []int{8}
}
func (x *KafkaNetworkPolicyRule) GetApiVersion() int32 {
if x != nil {
return x.ApiVersion
}
return 0
}
func (x *KafkaNetworkPolicyRule) GetApiKeys() []int32 {
if x != nil {
return x.ApiKeys
}
return nil
}
func (x *KafkaNetworkPolicyRule) GetClientId() string {
if x != nil {
return x.ClientId
}
return ""
}
func (x *KafkaNetworkPolicyRule) GetTopic() string {
if x != nil {
return x.Topic
}
return ""
}
// A set of network policy rules that match generic L7 requests.
type L7NetworkPolicyRules struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The set of allowing l7 policy rules.
// A request is allowed if any of these rules matches the request,
// and the request does not match any of the deny rules.
// Optional. If missing or empty then all requests are allowed, unless
// denied by a deny rule.
L7AllowRules []*L7NetworkPolicyRule `protobuf:"bytes,1,rep,name=l7_allow_rules,json=l7AllowRules,proto3" json:"l7_allow_rules,omitempty"`
// The set of denying l7 policy rules.
// A request is denied if any of these rules matches the request.
// A request that is not denied may be allowed by 'l7_allow_rules'.
// Optional.
L7DenyRules []*L7NetworkPolicyRule `protobuf:"bytes,2,rep,name=l7_deny_rules,json=l7DenyRules,proto3" json:"l7_deny_rules,omitempty"`
}
func (x *L7NetworkPolicyRules) Reset() {
*x = L7NetworkPolicyRules{}
if protoimpl.UnsafeEnabled {
mi := &file_cilium_api_npds_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *L7NetworkPolicyRules) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*L7NetworkPolicyRules) ProtoMessage() {}
func (x *L7NetworkPolicyRules) ProtoReflect() protoreflect.Message {
mi := &file_cilium_api_npds_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {