Skip to content

Commit

Permalink
Fix(eos_cli_config_gen): Sort IPsec SA, IKE policies and profiles (#4227
Browse files Browse the repository at this point in the history
)

Co-authored-by: Claus Holbech <[email protected]>
  • Loading branch information
gmuloc and ClausHolbechArista committed Aug 21, 2024
1 parent 55d7297 commit 3cc0195
Show file tree
Hide file tree
Showing 18 changed files with 151 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ interface Management1
| SA-4 | md5 | 3des | - | - |
| SA-5 | sha512 | - | - | - |
| SA-6 | sha384 | - | - | - |
| SA-7 | - | - | - | - |

### IPSec profiles

Expand All @@ -70,6 +71,7 @@ interface Management1
| Profile-1 | IKE-1 | SA-1 | start | - | - | - | transport | - |
| Profile-2 | - | SA-2 | start | - | - | - | tunnel | False |
| Profile-3 | - | SA-3 | start | - | - | - | tunnel | True |
| Profile-4 | - | - | - | - | - | - | - | - |

### Key controller

Expand Down Expand Up @@ -122,6 +124,8 @@ ip security
sa policy SA-6
esp integrity sha384
!
sa policy SA-7
!
profile Profile-1
ike-policy IKE-1
sa-policy SA-1
Expand All @@ -143,6 +147,8 @@ ip security
flow parallelization encapsulation udp
mode tunnel
!
profile Profile-4
!
key controller
profile Profile-1
hardware encryption disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ ip security
sa policy SA-6
esp integrity sha384
!
sa policy SA-7
!
profile Profile-1
ike-policy IKE-1
sa-policy SA-1
Expand All @@ -61,6 +63,8 @@ ip security
flow parallelization encapsulation udp
mode tunnel
!
profile Profile-4
!
key controller
profile Profile-1
hardware encryption disabled
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
### IP Security ###
ip_security:
ike_policies:
# Testing sorting
- name: IKE-2
- name: IKE-1
local_id: 192.168.100.1
ike_lifetime: 24
encryption: aes256
dh_group: 20
- name: IKE-2
- name: IKE-FQDN
local_id_fqdn: fqdn.local
- name: IKE-UFQDN
local_id_fqdn: [email protected]
# local_id won't be rendered as local_id_fqdn takes precedence
local_id: 192.168.42.42
sa_policies:
# Testing sorting
- name: SA-7
- name: SA-1
esp:
encryption: aes128
Expand Down Expand Up @@ -44,6 +47,8 @@ ip_security:
esp:
integrity: sha384
profiles:
# testing sorting
- name: Profile-4
- name: Profile-1
ike_policy: IKE-1
sa_policy: SA-1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,14 @@ ip security
ike policy CP-IKE-POLICY
local-id 192.168.142.1
!
sa policy DP-SA-POLICY
sa policy CP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
sa policy CP-SA-POLICY
sa policy DP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile CP-PROFILE
ike-policy CP-IKE-POLICY
sa-policy CP-SA-POLICY
Expand All @@ -131,6 +124,13 @@ ip security
dpd 10 50 clear
mode transport
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
key controller
profile DP-PROFILE
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,14 @@ ip security
ike policy CP-IKE-POLICY
local-id 192.168.142.2
!
sa policy DP-SA-POLICY
sa policy CP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
sa policy CP-SA-POLICY
sa policy DP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile CP-PROFILE
ike-policy CP-IKE-POLICY
sa-policy CP-SA-POLICY
Expand All @@ -131,6 +124,13 @@ ip security
dpd 10 50 clear
mode transport
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
key controller
profile DP-PROFILE
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,14 @@ ip security
ike policy CP-IKE-POLICY
local-id 192.168.142.3
!
sa policy DP-SA-POLICY
sa policy CP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
sa policy CP-SA-POLICY
sa policy DP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile CP-PROFILE
ike-policy CP-IKE-POLICY
sa-policy CP-SA-POLICY
Expand All @@ -131,6 +124,13 @@ ip security
dpd 10 50 clear
mode transport
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
key controller
profile DP-PROFILE
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,14 @@ ip security
ike policy CP-IKE-POLICY
local-id 192.168.255.1
!
sa policy DP-SA-POLICY
sa policy CP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
sa policy CP-SA-POLICY
sa policy DP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile CP-PROFILE
ike-policy CP-IKE-POLICY
sa-policy CP-SA-POLICY
Expand All @@ -143,6 +136,13 @@ ip security
dpd 10 50 clear
mode transport
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
key controller
profile DP-PROFILE
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,14 @@ ip security
ike policy CP-IKE-POLICY
local-id 192.168.255.1
!
sa policy DP-SA-POLICY
sa policy CP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
sa policy CP-SA-POLICY
sa policy DP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile CP-PROFILE
ike-policy CP-IKE-POLICY
sa-policy CP-SA-POLICY
Expand All @@ -137,6 +130,13 @@ ip security
dpd 10 50 clear
mode transport
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
key controller
profile DP-PROFILE
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ ip security
encryption aes256
dh-group 24
!
sa policy DP-SA-POLICY
sa policy CP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
sa policy CP-SA-POLICY
sa policy DP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
Expand All @@ -268,13 +268,6 @@ ip security
sa lifetime 8 hours
pfs dh-group 24
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile CP-PROFILE
ike-policy CP-IKE-POLICY
sa-policy CP-SA-POLICY
Expand All @@ -283,6 +276,13 @@ ip security
dpd 10 50 clear
mode transport
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile IE-ZSCALER-EXIT-POLICY-1-PROFILE
ike-policy IE-ZSCALER-EXIT-POLICY-1-IKE-POLICY
sa-policy IE-ZSCALER-EXIT-POLICY-1-SA-POLICY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ ip security
encryption aes256
dh-group 24
!
sa policy DP-SA-POLICY
sa policy CP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
sa policy CP-SA-POLICY
sa policy DP-SA-POLICY
esp encryption aes256gcm128
pfs dh-group 14
!
Expand All @@ -279,13 +279,6 @@ ip security
sa lifetime 8 hours
pfs dh-group 24
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile CP-PROFILE
ike-policy CP-IKE-POLICY
sa-policy CP-SA-POLICY
Expand All @@ -294,6 +287,13 @@ ip security
dpd 10 50 clear
mode transport
!
profile DP-PROFILE
sa-policy DP-SA-POLICY
connection start
shared-key 7 ABCDEF1234567890666
dpd 10 50 clear
mode transport
!
profile IE-ZSCALER-EXIT-POLICY-1-PROFILE
ike-policy IE-ZSCALER-EXIT-POLICY-1-IKE-POLICY
sa-policy IE-ZSCALER-EXIT-POLICY-1-SA-POLICY
Expand Down
Loading

0 comments on commit 3cc0195

Please sign in to comment.