From 9cd6b7dc1949ec07052f3de9d4d42519cbd31293 Mon Sep 17 00:00:00 2001 From: mischa Date: Fri, 8 Jul 2022 21:45:21 +0200 Subject: [PATCH] major change in alkira.cnf (see example.cnf), for all json files, except FWs, config of CXP, SIZE, SEGMENTS, GROUPS and BILLINTAGS is done in the alkira.cnf file --- config/connectors.cnf | 218 +++++++++++++++++++++--------------------- config/cxp-eu.cnf | 118 +++++++++++------------ config/cxp-us.cnf | 100 +++++++++---------- config/demo-chkp.cnf | 202 +++++++++++++++++++------------------- config/demo-ftnt.cnf | 198 +++++++++++++++++++------------------- config/demo-small.cnf | 118 +++++++++++------------ config/demo.cnf | 218 +++++++++++++++++++++--------------------- config/minimal.cnf | 60 ++++++------ config/single.cnf | 15 +-- example.cnf | 2 + push.py | 25 +++-- 11 files changed, 640 insertions(+), 634 deletions(-) diff --git a/config/connectors.cnf b/config/connectors.cnf index ecd2a2e..435f778 100644 --- a/config/connectors.cnf +++ b/config/connectors.cnf @@ -1,154 +1,154 @@ [ipsecconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors3] -cxp = US-EAST-2 -size = SMALL -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE1 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors5] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors6] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = SMALL -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE1 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [internetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +billingtags = TAG1 [internetconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +billingtags = TAG2 [awsvpcconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [awsvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [azurevnetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [azurevnetconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [azurevnetconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [azurevnetconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [gcpvpcconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [gcpvpcconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [gcpvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [gcpvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ocivcnconnectors1] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ocivcnconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ftntfwservices1.txt] -cxp = US-EAST-2 +cxp = CXP1 diff --git a/config/cxp-eu.cnf b/config/cxp-eu.cnf index a83c70c..af4dd35 100644 --- a/config/cxp-eu.cnf +++ b/config/cxp-eu.cnf @@ -1,82 +1,82 @@ [ipsecconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors5] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors6] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = SMALL -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE1 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [internetconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +billingtags = TAG2 [awsvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [awsvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [azurevnetconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [azurevnetconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [gcpvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [gcpvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Pre Prod -group = Development -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG1 [ocivcnconnectors1] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ocivcnconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 diff --git a/config/cxp-us.cnf b/config/cxp-us.cnf index ebb6e5d..b56bbd4 100644 --- a/config/cxp-us.cnf +++ b/config/cxp-us.cnf @@ -1,71 +1,71 @@ [ipsecconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors3] -cxp = US-EAST-2 -size = SMALL -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE1 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [internetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +billingtags = TAG1 [awsvpcconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [azurevnetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [gcpvpcconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [gcpvpcconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Pre Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG1 [ftntfwservices1.txt] -cxp = US-EAST-2 +cxp = CXP1 diff --git a/config/demo-chkp.cnf b/config/demo-chkp.cnf index c4a06c0..66a10b3 100644 --- a/config/demo-chkp.cnf +++ b/config/demo-chkp.cnf @@ -1,146 +1,146 @@ [ipsecconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [internetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +billingtags = TAG1 [internetconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +billingtags = TAG2 [awsvpcconnectors1] -cxp = US-EAST-2 -size = LARGE -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [awsvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [azurevnetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [azurevnetconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [gcpvpcconnectors1] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [gcpvpcconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [gcpvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [gcpvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [ocivcnconnectors1] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ocivcnconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [chkpfwservices1.txt] -cxp = US-EAST-2 +cxp = CXP1 [chkpfwservices2.txt] -cxp = US-EAST-2 +cxp = CXP1 [chkpfwservices3.txt] -cxp = US-EAST-2 +cxp = CXP1 diff --git a/config/demo-ftnt.cnf b/config/demo-ftnt.cnf index 65f8a6b..6128152 100644 --- a/config/demo-ftnt.cnf +++ b/config/demo-ftnt.cnf @@ -1,140 +1,140 @@ [ipsecconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [internetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +billingtags = TAG1 [internetconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +billingtags = TAG2 [awsvpcconnectors1] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [awsvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [azurevnetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [azurevnetconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [gcpvpcconnectors1] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [gcpvpcconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [gcpvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [gcpvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [ocivcnconnectors1] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ocivcnconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ftntfwservices1.txt] -cxp = US-EAST-2 +cxp = CXP1 diff --git a/config/demo-small.cnf b/config/demo-small.cnf index 251d317..ab5e6c3 100644 --- a/config/demo-small.cnf +++ b/config/demo-small.cnf @@ -1,84 +1,84 @@ [ipsecconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [internetconnectors1] -size = MEDIUM -cxp = US-EAST-2 -segments = Corporate -billingtags = 333 +size = SIZE2 +cxp = CXP1 +segments = SEGMENT1 +billingtags = TAG1 [internetconnectors2] -size = LARGE -cxp = GERMANYWESTCENTRAL-AZURE-1 -segments = Corporate -billingtags = 333 +size = SIZE3 +cxp = CXP2 +segments = SEGMENT1 +billingtags = TAG1 [awsvpcconnectors1] -cxp = US-EAST-2 -size = LARGE -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [awsvpcconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [awsvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [azurevnetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [azurevnetconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ftntfwservices1.txt] -cxp = US-EAST-2 +cxp = CXP1 diff --git a/config/demo.cnf b/config/demo.cnf index 661af6b..29ec449 100644 --- a/config/demo.cnf +++ b/config/demo.cnf @@ -1,154 +1,154 @@ [ipsecconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors3] -cxp = US-EAST-2 -size = SMALL -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE1 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ipsecconnectors5] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ipsecconnectors6] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = SMALL -segments = Pre Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE1 +segments = Pre SEGMENT2 +group = GROUP2 +billingtags = TAG2 [internetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +billingtags = TAG1 [internetconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +billingtags = TAG2 [awsvpcconnectors1] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [awsvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [awsvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [azurevnetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors2] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [azurevnetconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [azurevnetconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [gcpvpcconnectors1] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [gcpvpcconnectors2] -cxp = US-EAST-2 -size = LARGE -segments = Prod -group = Development -billingtags = 333 +cxp = CXP1 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG1 [gcpvpcconnectors3] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [gcpvpcconnectors4] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 343 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 [ocivcnconnectors1] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = MEDIUM -segments = Corporate -group = Users -billingtags = 333 +cxp = CXP2 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 [ocivcnconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -size = LARGE -segments = Prod -group = Development -billingtags = 343 +cxp = CXP2 +size = SIZE3 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 [ftntfwservices1.txt] -cxp = US-EAST-2 +cxp = CXP1 diff --git a/config/minimal.cnf b/config/minimal.cnf index 5414f56..ab331f4 100644 --- a/config/minimal.cnf +++ b/config/minimal.cnf @@ -1,43 +1,43 @@ [ipsecconnectors1] -cxp = US-EAST-2 -segments = Corporate -group = Users -billingtags = 333 -size = MEDIUM +cxp = CXP1 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 +size = SIZE2 [internetconnectors1] -cxp = US-EAST-2 -segments = Corporate -billingtags = 333 -size = MEDIUM +cxp = CXP1 +segments = SEGMENT1 +billingtags = TAG1 +size = SIZE2 [awsvpcconnectors1] -cxp = US-EAST-2 -segments = Prod -group = Development -billingtags = 343 -size = LARGE +cxp = CXP1 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 +size = SIZE3 [azurevnetconnectors1] -cxp = US-EAST-2 -segments = Corporate -group = Users -billingtags = 343 -size = MEDIUM +cxp = CXP1 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG2 +size = SIZE2 [gcpvpcconnectors1] -cxp = US-EAST-2 -segments = Prod -group = Development -billingtags = 343 -size = LARGE +cxp = CXP1 +segments = SEGMENT2 +group = GROUP2 +billingtags = TAG2 +size = SIZE3 [ocivcnconnectors1] -cxp = GERMANYWESTCENTRAL-AZURE-1 -segments = Corporate -group = Users -billingtags = 333 -size = MEDIUM +cxp = CXP2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 +size = SIZE2 [ftntfwservices1.txt] -cxp = US-EAST-2 +cxp = CXP1 diff --git a/config/single.cnf b/config/single.cnf index 9e36f8e..ee75767 100644 --- a/config/single.cnf +++ b/config/single.cnf @@ -1,11 +1,6 @@ [internetconnectors1] -cxp = US-EAST-2 -size = MEDIUM -segments = Corporate -billingtags = 333 - -[internetconnectors2] -cxp = GERMANYWESTCENTRAL-AZURE-1 -segments = Corporate -billingtags = 333 -size = LARGE +cxp = CXP1 +size = SIZE2 +segments = SEGMENT1 +group = GROUP1 +billingtags = TAG1 diff --git a/example.cnf b/example.cnf index c7cb535..8775941 100644 --- a/example.cnf +++ b/example.cnf @@ -15,6 +15,7 @@ CIDR_CXP = US-EAST-2 CXP1 = US-EAST-2 CXP2 = GERMANYWESTCENTRAL-AZURE-1 CXP3 = +CXP4 = [size] SIZE1 = SMALL SIZE2 = MEDIUM @@ -35,3 +36,4 @@ SEGMENT4 = TAG1 = 333 TAG2 = 343 TAG3 = +TAG4 = diff --git a/push.py b/push.py index 5cf185f..3c470f9 100755 --- a/push.py +++ b/push.py @@ -4,6 +4,7 @@ # push.py # Version 0.1 - 20220617 - initial release # Version 0.2 - 20220620 - added collection of credentialId +# Version 0.3 - 20220708 - config everywhere!! # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -68,6 +69,7 @@ ALKIRA_USERNAME = alkira.get('alkira', 'ALKIRA_USERNAME') ALKIRA_PASSWORD = alkira.get('alkira', 'ALKIRA_PASSWORD') ALKIRA_BASE_URI = f'https://{ALKIRA_TENANT}/api' AWS_SERVICE_USERNAME = alkira.get('services', 'AWS_SERVICE_USERNAME') +AZURE_SERVICE_USERNAME = alkira.get('services', 'AZURE_SERVICE_USERNAME') SERVICE_PASSWORD = alkira.get('services', 'SERVICE_PASSWORD') CIDR_NAME = alkira.get('globalcidr', 'CIDR_NAME') CIDR_DESCR = alkira.get('globalcidr', 'CIDR_DESCR') @@ -265,22 +267,29 @@ for connector in config.sections(): for key in ['cxp', 'size', 'group']: if key in body: logging.debug(f"JSON {key}: {body[key]}") - if key in section: + if key in section: + try: + if alkira.get(key, section[key]): + logging.debug(f"CNF CONFIG {key}: {alkira.get(key, section[key])}") + body[key] = alkira.get(key, section[key]) + except: + logging.debug(f"{key} not defined in main config") logging.debug(f"CONFIG {key}: {section[key]}") body[key] = section[key] for key in ['segments', 'billingTags']: if key in body: - logging.debug(f"JSON key: {body[key][0]}") - if key in section: + logging.debug(f"JSON {key}: {body[key][0]}") + if key in section: + try: + if alkira.get(key, section[key]): + logging.debug(f"CNF CONFIG {key}: {alkira.get(key, section[key])}") + body[key][0] = alkira.get(key, section[key]) + except: + logging.debug(f"{key} not defined in main config") logging.debug(f"CONFIG key: {section[key]}") body[key][0] = section[key] - if 'group' not in body: - if 'group' in section: - logging.debug(f"CONFIG group: {section['group']}") - body['group'] = section['group'] - if 'services' in connector_name and 'credentialId' in body and 'service_credentialid' in locals(): logging.debug(f'API credentialid: {service_credentialid}') body['credentialId'] = service_credentialid