Skip to main content

Security Services Data Models

Pydantic models for validating and serializing security service configuration resources in the Strata Cloud Manager SDK.

Overview​

The Strata Cloud Manager SDK uses Pydantic models for data validation and serialization of security services. These models ensure that the data being sent to and received from the Strata Cloud Manager API adheres to the expected structure and constraints. This section documents the models for security service configuration resources.

Model Types​

For each security service configuration, there are corresponding model types:

  • Create Models: Used when creating new security resources ({Object}CreateModel)
  • Update Models: Used when updating existing security resources ({Object}UpdateModel)
  • Response Models: Used when parsing security data retrieved from the API ({Object}ResponseModel)
  • Base Models: Common shared attributes for related security models ({Object}BaseModel)

Common Model Patterns​

Security service models share common patterns:

  • Container validation (exactly one of folder/snippet/device)
  • UUID validation for identifiers
  • Profile name and description validation
  • Reference validation for associated objects
  • Security action and severity validation
  • Rule ordering and positioning logic

Usage Examples​

Creating a Security Rule​

from scm.client import Scm
from scm.models.security import SecurityRuleCreateModel

# Initialize client
client = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id"
)

# Create a new security rule using a model
security_rule = SecurityRuleCreateModel(
name="allow-web-traffic",
source=["any"],
destination=["any"],
application=["web-browsing"],
service=["application-default"],
action="allow",
folder="Security Policies"
)

# Convert the model to a dictionary for the API call
rule_dict = security_rule.model_dump(exclude_unset=True)
result = client.security_rule.create(rule_dict)

Parsing a Response​

from scm.models.security import SecurityRuleResponseModel

response = SecurityRuleResponseModel(**api_response)
print(f"Rule: {response.name}, Action: {response.action}")

Models by Category​

Security Rules​

Anti-Spyware Profile​

Decryption Profile​

Decryption Rule​

DNS Security Profile​

File Blocking Profile​

URL Access Profile​

URL Categories​

Vulnerability Protection Profile​

WildFire Antivirus Profile​

App Override Rule​

Authentication Rule​