-
Notifications
You must be signed in to change notification settings - Fork 4
/
netgate-ipsec.yang
1582 lines (1378 loc) · 29.4 KB
/
netgate-ipsec.yang
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
module netgate-ipsec {
yang-version 1.1;
namespace "urn:netgate:xml:yang:netgate-ipsec";
prefix "ngipsec";
import ietf-inet-types {
prefix "inet";
}
import netgate-cli-extensions {
prefix "ngcliext";
}
import netgate-common {
prefix "ngcom";
}
import netgate-system {
prefix "ngsys";
}
organization "Netgate";
contact "Web: <http://www.netgate.com>";
description
"This YANG module provides mappings of the CLI command structure
to the underlying data-model elements for the Netgate router.
Copyright 2016-2023 Rubicon Communications, LLC.
";
revision 2024-02-01 {
description
"TNSR Release 24.02.";
}
revision 2023-11-01 {
description
"TNSR Release 23.11.";
}
revision 2023-02-15 {
description
"TNSR Release 23.02.";
}
revision 2022-10-15 {
description
"TNSR Release 22.10.";
}
revision 2022-06-15 {
description
"TNSR Release 22.06.";
}
revision 2022-02-15 {
description
"TNSR Release 22.02.";
}
revision 2021-02-15 {
description
"TNSR Release 21.02.";
}
revision 2020-06-15 {
description
"TNSR Release 20.06.";
}
revision 2020-02-15 {
description
"TNSR Release 20.02.";
}
revision 2019-08-30 {
description
"TNSR Release 19.08.";
}
revision 2019-05-30 {
description
"TNSR Release 19.05.";
}
revision 2019-02-15 {
description
"TNSR Release 19.02.";
}
revision 2016-12-19 {
description
"Initial revision.";
}
typedef ng-ike-encryption-algorithm-t {
type enumeration {
enum aes128 {
description
"128 bit AES-CBC";
}
enum aes192 {
description
"192 bit AES-CBC";
}
enum aes256 {
description
"256 bit AES-CBC";
}
enum aes128ctr {
description
"128 bit AES-Counter";
}
enum aes192ctr {
description
"192 bit AES-Counter";
}
enum aes256ctr {
description
"256 bit AES-Counter";
}
enum aes128ccm8 {
description
"128 bit AES-CCM with 8 byte ICV";
}
enum aes192ccm8 {
description
"192 bit AES-CCM with 8 byte ICV";
}
enum aes256ccm8 {
description
"256 bit AES-CCM with 8 byte ICV";
}
enum aes128ccm12 {
description
"128 bit AES-CCM with 12 byte ICV";
}
enum aes192ccm12 {
description
"192 bit AES-CCM with 12 byte ICV";
}
enum aes256ccm12 {
description
"256 bit AES-CCM with 12 byte ICV";
}
enum aes128ccm16 {
description
"128 bit AES-CCM with 16 byte ICV";
}
enum aes192ccm16 {
description
"192 bit AES-CCM with 16 byte ICV";
}
enum aes256ccm16 {
description
"256 bit AES-CCM with 16 byte ICV";
}
enum aes128gcm8 {
description
"128 bit AES-GCM with 8 byte ICV";
}
enum aes192gcm8 {
description
"192 bit AES-GCM with 8 byte ICV";
}
enum aes256gcm8 {
description
"256 bit AES-GCM with 8 byte ICV";
}
enum aes128gcm12 {
description
"128 bit AES-GCM with 12 byte ICV";
}
enum aes192gcm12 {
description
"192 bit AES-GCM with 12 byte ICV";
}
enum aes256gcm12 {
description
"256 bit AES-GCM with 12 byte ICV";
}
enum aes128gcm16 {
description
"128 bit AES-GCM with 16 byte ICV";
}
enum aes192gcm16 {
description
"192 bit AES-GCM with 16 byte ICV";
}
enum aes256gcm16 {
description
"256 bit AES-GCM with 16 byte ICV";
}
enum camellia128 {
description
"128 bit Camellia";
}
enum camellia192 {
description
"192 bit Camellia";
}
enum camellia256 {
description
"256 bit Camellia";
}
enum camellia128ctr {
description
"128 bit Camellia-Counter";
}
enum camellia192ctr {
description
"192 bit Camellia-Counter";
}
enum camellia256ctr {
description
"256 bit Camellia-Counter";
}
enum camellia128ccm8 {
description
"128 bit Camellia-CCM with 8 byte ICV";
}
enum camellia192ccm8 {
description
"192 bit Camellia-CCM with 8 byte ICV";
}
enum camellia256ccm8 {
description
"256 bit Camellia-CCM with 8 byte ICV";
}
enum camellia128ccm12 {
description
"128 bit Camellia-CCM with 12 byte ICV";
}
enum camellia192ccm12 {
description
"192 bit Camellia-CCM with 12 byte ICV";
}
enum camellia256ccm12 {
description
"256 bit Camellia-CCM with 12 byte ICV";
}
enum camellia128ccm16 {
description
"128 bit Camellia-CCM with 16 byte ICV";
}
enum camellia192ccm16 {
description
"192 bit Camellia-CCM with 16 byte ICV";
}
enum camellia256ccm16 {
description
"256 bit Camellia-CCM with 16 byte ICV";
}
enum chacha20poly1305 {
description
"256 bit ChaCha20/Poly1305 with 16 byte ICV";
}
}
description
"Transform Type 1 - Internet Key Exchange (IKE) "+
"encryption algorithms.";
}
typedef dataplane-esp-encryption-algorithm-t {
type enumeration {
enum aes128gcm16 {
description
"128 bit AES-GCM with 16 byte ICV";
}
enum aes192gcm16 {
description
"192 bit AES-GCM with 16 byte ICV";
}
enum aes256gcm16 {
description
"256 bit AES-GCM with 16 byte ICV";
}
enum chacha20poly1305 {
description
"256 bit ChaCha20/Poly1305 with 16 byte ICV";
}
enum aes128 {
description
"128 bit AES-CBC";
}
enum aes192 {
description
"192 bit AES-CBC";
}
enum aes256 {
description
"256 bit AES-CBC";
}
}
description
"Subset of encryption algorithms supported for IPsec in
dataplane.";
}
typedef ng-ike-integrity-algorithm-t {
type enumeration {
enum sha1 {
description
"SHA1 96";
}
enum aesxcbc {
value 5;
description
"AES-XCBC 96";
}
enum aescmac {
description
"AES-CMAC 96";
}
enum sha256 {
description
"SHA2 256 bit blocks, 128 bits output";
}
enum sha384 {
description
"SHA2 384 bit blocks, 192 bits output";
}
enum sha512 {
description
"SHA2 512 bit blocks, 256 bits output";
}
}
description
"Transform Type 3 - Internet Key Exchange (IKE) "+
"Integrity Algorithms.";
}
typedef dataplane-esp-integrity-algorithm-t {
type enumeration {
enum sha1 {
description
"SHA1 96";
}
enum sha256 {
description
"SHA2 256 bit blocks, 128 bits output";
}
enum sha384 {
description
"SHA2 384 bit blocks, 192 bits output";
}
enum sha512 {
description
"SHA2 512 bit blocks, 256 bits output";
}
}
description
"Subset of integrity algorithms supported for ESP in dataplane.";
}
typedef ng-diffie-hellman-group-t {
type enumeration {
enum modp768 {
description
"Group 1 (768 bit modulus)";
}
enum modp1024 {
description
"Group 2 (1024 bit modulus)";
}
enum modp1536 {
description
"Group 5 (1536 bit modulus)";
}
enum modp2048 {
description
"Group 14 (2048 bit modulus)";
}
enum modp3072 {
description
"Group 15 (3072 bit modulus)";
}
enum modp4096 {
description
"Group 16 (4096 bit modulus)";
}
enum modp6144 {
description
"Group 17 (6144 bit modulus)";
}
enum modp8192 {
description
"Group 18 (8192 bit modulus)";
}
enum ecp256 {
description
"Group 19 (256 bit ECP)";
}
enum ecp384 {
description
"Group 20 (384 bit ECP)";
}
enum ecp521 {
description
"Group 21 (521 bit ECP)";
}
enum modp1024s160 {
description
"Group 22 (1024 bit modulus, 160 bit POS)";
}
enum modp2048s224 {
description
"Group 23 (2048 bit modulus, 224 bit POS)";
}
enum modp2048s256 {
description
"Group 24 (2048 bit modulus, 256 bit POS)";
}
enum curve25519 {
description
"Group 31 (Elliptic Curve 25519, 256 bit)";
}
}
description
"Diffie-Hellman Groups (RFC 5996).";
}
typedef ng-pseudo-random-function-t {
type enumeration {
enum prfsha1 {
value 2;
description
"SHA1 PRF";
}
enum prfsha256 {
value 5;
description
"SHA2-256 PRF";
}
enum prfsha384 {
value 6;
description
"SHA2-384 PRF";
}
enum prfsha512 {
value 7;
description
"SHA2-512 PRF";
}
}
description
"Available Pseudo-Random Functions (PRF).";
}
typedef ike-identity-type-t {
type enumeration {
enum none {
description
"No particular value.";
}
enum email {
description
"Email address.";
}
enum fqdn {
description
"Fully qualified domain name.";
}
enum dn {
description
"X509 distinguished name.";
}
enum key-id {
description
"Opaque key-id string.";
}
enum address {
description
"IP address.";
}
}
}
typedef connection-type-t {
type enumeration {
enum initiator-only {
value 0;
description
"Managed device will always initiate IKE SA."+
" Will not respond to incoming requests from peer.";
}
enum responder-only {
value 1;
description
"Managed device will never initiate IKE SA." +
" Will only respond to incoming requests from peer.";
}
enum both {
value 2;
description
"both: Managed device can act as initiator or responder.";
}
}
description
"Connection type for IKE session.";
}
typedef ipsec-protocol-t {
type enumeration {
enum "esp" {
value 0;
description
"ESP Encryption";
}
}
description
"IPsec security protocols.";
}
typedef ipsec-mode-t {
type enumeration {
enum "tunnel" {
description
"Tunnel mode";
}
/* future support
enum "transport" {
description
"Transport mode";
}
*/
}
description
"IPsec modes";
}
typedef peer-position-t {
type enumeration {
enum "remote" {
description
"The remote endpoint of an SA.";
}
enum "local" {
description
"The local device.";
}
}
description
"Location of the peer relative to the device being configured.";
}
typedef ipsec-tunnel-type-t {
type enumeration {
enum "interface" {
description
"An IPsec tunnel associated with a tunnel interface.";
}
/* policy-based added in the future
enum "policy" {
description
"An IPsec tunnel associated with IPsec policies.";
}
*/
}
description
"Whether a tunnel is interface/route-based or policy-based.";
}
typedef ipsec-crypto-config-type-t {
type enumeration {
enum "ike" {
value 0;
description
"Tunnel crypto parameters determined dynamically with IKE";
}
enum "manual" {
value 1;
description
"Tunnel crypto parameters manually set (static keys)";
}
}
description
"Tunnel crypto/keying method";
}
typedef ipsec-seq-number-type-t {
type enumeration {
enum "esn" {
value 0;
description
"Use extended sequence numbers";
}
enum "noesn" {
value 1;
description
"Use standard sequence numbers";
}
}
description
"IPsec sequence number type";
}
typedef key-renewal-t {
type enumeration {
enum "reauth" {
description
"Full teardown/re-establishment of IKE/child SAs";
}
enum "rekey" {
description
"Inline rekeying while SA stays active. Only in IKEv2";
}
}
description
"Methods for updating keys on an established IKE SA.";
}
typedef ipsec-peer-type-t {
type enumeration {
enum "gateway" {
value 0;
description
"The peer is a gateway (site-to-site)";
}
enum "endpoint" {
value 1;
description
"The peer is an endpoint (remote access)";
}
}
description
"Type of IKE/IPsec peer";
}
typedef ike-unique-policy-t {
type enumeration {
enum "never" {
description
"Never enforce peer ID uniqueness.";
}
enum "no" {
description
"Do not enforce peer ID uniqueness unless initial contact notify received.";
}
enum "keep" {
description
"Enforce peer ID uniqueness - keep existing IKE SAs.";
}
enum "replace" {
description
"Enforce peer ID uniqueness - replace existing IKE SAs.";
}
}
}
rpc ike-control {
input {
leaf operation {
mandatory true;
type ngcom:service-operation;
description
"One of the strings 'start', 'stop', 'restart', " +
"or 'status'.";
}
}
output {
leaf stdout {
type string;
}
}
}
rpc ike-coredump {
input {
leaf operation {
type ngcom:service-op-enable-disable;
mandatory true;
description
"One of the strings 'enable', or 'disable'.";
}
}
output {
leaf stdout {
type string;
}
}
}
container ipsec-config {
description
"Internet Key Exchange (IKE) configuration for IPsec.";
ngcliext:parent-fmt "ipsec";
container global-options {
description
"Global IPsec options.";
ngcliext:parent-fmt "$< $%";
container eap-radius {
description
"EAP-RADIUS plugin settings.";
ngcliext:parent-fmt "$< $%";
leaf server-group {
description
"The RADIUS server group for IPsec.";
type leafref {
path "/ngsys:system/ngsys:auth/ngsys:server-groups/ngsys:server-group/ngsys:name";
}
must "/ngsys:system/ngsys:auth/ngsys:server-groups/ngsys:server-group[ngsys:name=current()]/ngsys:type = 'radius'" {
error-message "IPsec EAP-RADIUS server group must have type 'radius'";
}
ngcliext:node-fmt "$< $% @@$n";
}
container accounting {
description
"RADIUS accounting settings.";
ngcliext:parent-fmt "$< $%";
leaf enabled {
description
"If true, send accounting packets for remote access IPsec tunnels.";
type boolean;
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< $%$n";
}
leaf interim-interval {
description
"Seconds between interim updates.";
type uint16 {
range "1..65535";
}
ngcliext:node-fmt "$< $% @@$n";
}
}
}
}
list tunnel {
key "instance";
description
"IPsec tunnel configurations";
ngcliext:node-fmt "$< tunnel @{instance}$n";
ngcliext:pre-children-op "push";
leaf instance {
type uint32;
description
"Numeric identifier of tunnel";
}
leaf remote-type {
type ipsec-peer-type-t;
default "gateway";
description
"Remote tunnel peer is a gateway or a user/device";
}
leaf tunnel-type {
type ipsec-tunnel-type-t;
default "interface";
}
leaf tunnel-enable {
type boolean;
default false;
ngcliext:node-op "bool";
ngcliext:node-fmt "^disable$n|^enable$n";
}
container crypto {
description
"Tunnel cryptographic settings";
ngcliext:parent-fmt "^crypto";
leaf config-type {
type ipsec-crypto-config-type-t;
default "ike";
description
"Crypto config/keying method";
ngcliext:node-fmt "$< $% @@$n";
}
container ike {
ngcliext:node-fmt "$< ike$n";
ngcliext:pre-children-op "push";
leaf version {
type uint8 {
range "1..2";
}
default 2;
ngcliext:node-fmt "^$% @@$n";
}
leaf role {
type connection-type-t;
default both;
}
leaf lifetime {
type uint32 {
range "120..214783647";
}
default 14400;
description
"Lifetime of IKE SA in seconds.";
ngcliext:node-fmt "^$% @@$n";
}
leaf dpd-poll-interval {
type uint16;
description
"Seconds between DPD peer status checks.";
ngcliext:node-fmt "^dpd-interval @@$n";
}
leaf key-renewal {
type key-renewal-t;
description
"IKE SA key renewal method - rekey or reauth";
ngcliext:node-fmt "^$% @@$n";
}
leaf mobike {
type empty;
description
"Enable MOBIKE mobility/multihoming extension.";
ngcliext:node-fmt "^$%$n";
}
leaf udp-encapsulation {
type boolean;
default false;
description
"Force UDP encapsulation.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
leaf unique-id-policy {
type ike-unique-policy-t;
description
"Policy for enforcing uniqueness of remote peer ID.";
ngcliext:node-fmt "^$% @@$n";
}
list proposals {
key "name";
description
"Proposed parameters for IKE SA";
ngcliext:node-fmt "^proposal @{name}$n";
ngcliext:pre-children-op "push";
leaf "name" {
type string;
description
"IKE proposal name.";
}
leaf encryption-algorithm {
type ng-ike-encryption-algorithm-t;
mandatory true;
description
"IKE encryption algorithm.";
ngcliext:node-fmt "^encryption @@$n";
}
leaf integrity-algorithm {
type ng-ike-integrity-algorithm-t;
description
"IKE integrity algorithm.";
ngcliext:node-fmt "^integrity @@$n";
}
leaf dh-group {
type ng-diffie-hellman-group-t;
mandatory true;
description
"IKE Diffie-Hellman group.";
ngcliext:node-fmt "^group @@$n";
}
leaf prf {
type ng-pseudo-random-function-t;
description
"IKE pseudo-random function.";
ngcliext:node-fmt "^$% @@$n";
}
}
list identity {
key "peer";
description
"The ID data for one peer in the SA";
ngcliext:node-fmt "^$% @{peer}$n";
ngcliext:pre-children-op "push";
leaf peer {
type peer-position-t;
description
"Whether ID is for for the local or
remote peer.";
}
leaf type {
type ike-identity-type-t;
mandatory true;
description
"Type of ID used by the peer.";
ngcliext:node-fmt "^$% @@$n";
}
leaf value {
type string;
description
"The ID of the peer.";
ngcliext:node-fmt "^$% @@$n";
}
}
list authentication {
key "peer";
description
"The auth data for an IKE peer";
ngcliext:node-fmt "^$% @{peer}$n";
ngcliext:pre-children-op "push";
leaf peer {
type peer-position-t;
description
"Which peer this data is for.";
}
list round {
key "number";
ngcliext:node-fmt "^$% @{number}$n";
ngcliext:pre-children-op "push";
description
"An authentication round for one peer.";
leaf number {
type uint8 {
range "1..2";
}
description
"Numeric field to order multiple
authentications";
}
choice auth-type-and-peer {
mandatory true;
case psk-both {
leaf psk {
type string;
description
"Pre Shared Key";
ngcliext:node-fmt "^$% @@$n";
}
}
case pubkey-local {
leaf certificate {
type string;
description
"Name of a certificate file";
ngcliext:node-fmt "^$% @@$n";
}
}
case pubkey-remote {
leaf ca-certificate {
type string;
description
"Name of a CA certificate file";
ngcliext:node-fmt "^$% @@$n";
}