From d57446f15b3eeb68187db83106b1ac5e4418ae88 Mon Sep 17 00:00:00 2001 From: Piotr Banas Date: Tue, 23 Apr 2024 22:36:34 +0200 Subject: [PATCH 1/3] AIP model --- .../sdwan/policy_object/__init__.py | 3 +++ .../sdwan/policy_object/security/aip.py | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py index a32092e7..7743434c 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py @@ -20,6 +20,7 @@ from .policy.sla_class import FallbackBestTunnel, SLAAppProbeClass, SLAClassCriteria, SLAClassListEntry, SLAClassParcel from .policy.standard_community import StandardCommunityEntry, StandardCommunityParcel from .policy.tloc_list import TlocEntry, TlocParcel +from .security.aip import AdvancedInspectionProfileParcel from .security.amp import AdvancedMalwareProtectionParcel from .security.application_list import ( SecurityApplicationFamilyListEntry, @@ -39,6 +40,7 @@ AnyPolicyObjectParcel = Annotated[ Union[ + AdvancedInspectionProfileParcel, AdvancedMalwareProtectionParcel, URLParcel, ApplicationListParcel, @@ -71,6 +73,7 @@ ] __all__ = ( + "AdvancedInspectionProfileParcel", "AdvancedMalwareProtectionParcel", "AnyPolicyObjectParcel", "ApplicationFamilyListEntry", diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py new file mode 100644 index 00000000..9007a9d3 --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py @@ -0,0 +1,27 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates + +from typing import Literal + +from pydantic import AliasPath, Field + +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase +from catalystwan.models.configuration.feature_profile.sdwan.transport.bgp import RefIdItem + +TlsDecryptionAction = Literal["decrypt", "neverDecrypt", "skipDecrypt"] + + +class AdvancedInspectionProfileParcel(_ParcelBase): + type_: Literal["unified/advanced-inspection-profile"] = Field( + default="unified/advanced-inspection-profile", exclude=True + ) + description: str = "" + tls_decryption_action: Global[TlsDecryptionAction] = Field( + default=Global[TlsDecryptionAction](value="skipDecrypt"), + validation_alias=AliasPath("data", "tlsDecryptionAction"), + ) + intrusion_prevention: RefIdItem = Field(default=None, validation_alias=AliasPath("data", "intrusionPrevention")) + url_filtering: RefIdItem = Field(default=None, validation_alias=AliasPath("data", "urlFiltering")) + advanced_malware_protection: RefIdItem = Field( + default=None, validation_alias=AliasPath("data", "advancedMalwareProtection") + ) + ssl_decryption_profile: RefIdItem = Field(default=None, validation_alias=AliasPath("data", "sslDecryptionProfile")) From 83435f626fd5885c36f2c2709312acf88e4e96bf Mon Sep 17 00:00:00 2001 From: Piotr Banas Date: Wed, 24 Apr 2024 22:46:01 +0200 Subject: [PATCH 2/3] add parcel type --- catalystwan/models/configuration/feature_profile/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/catalystwan/models/configuration/feature_profile/common.py b/catalystwan/models/configuration/feature_profile/common.py index 3bca973f..8f44347d 100644 --- a/catalystwan/models/configuration/feature_profile/common.py +++ b/catalystwan/models/configuration/feature_profile/common.py @@ -59,6 +59,7 @@ "security-zone", "security-localapp", "security-data-ip-prefix", + "unified/advanced-inspection-profile", ] ProfileType = Literal[ From 46c0be7b9d2844c0f19dfb307eff493b0c514c29 Mon Sep 17 00:00:00 2001 From: Piotr Banas Date: Thu, 25 Apr 2024 15:39:26 +0200 Subject: [PATCH 3/3] change description to parcel_description --- .../feature_profile/sdwan/policy_object/security/aip.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py index 9007a9d3..21d4e691 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/aip.py @@ -14,7 +14,12 @@ class AdvancedInspectionProfileParcel(_ParcelBase): type_: Literal["unified/advanced-inspection-profile"] = Field( default="unified/advanced-inspection-profile", exclude=True ) - description: str = "" + parcel_description: str = Field( + default="", + serialization_alias="description", + validation_alias="description", + description="Set the parcel description", + ) tls_decryption_action: Global[TlsDecryptionAction] = Field( default=Global[TlsDecryptionAction](value="skipDecrypt"), validation_alias=AliasPath("data", "tlsDecryptionAction"),