Skip to main content

Application

The Application service manages custom application definitions in Strata Cloud Manager, allowing fine-grained control over application characteristics, risk levels, and security behaviors.

Class Overview​

The Application class provides CRUD operations for custom application objects. It is accessed through the client.application attribute on an initialized Scm instance.

from scm.client import Scm

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

# Access the Application service
applications = client.application

Key Attributes​

AttributeTypeRequiredDescription
namestrYesName of application (max 63 chars)
idUUIDYes*Unique identifier (*response only)
categorystrYesHigh-level category (max 50 chars)
subcategorystrYesSpecific sub-category (max 50 chars)
technologystrYesUnderlying technology (max 50 chars)
riskintYesRisk level (1-5)
descriptionstrNoDescription (max 1023 chars)
portsList[str]NoAssociated TCP/UDP ports
tagList[str]NoTags associated with the application
folderstrYes**Folder location (**one container required)
snippetstrYes**Snippet location (**one container required)
evasiveboolNoUses evasive techniques
pervasiveboolNoWidely used
excessive_bandwidth_useboolNoUses excessive bandwidth
used_by_malwareboolNoUsed by malware
transfers_filesboolNoTransfers files
has_known_vulnerabilitiesboolNoHas known vulnerabilities
tunnels_other_appsboolNoTunnels other applications
prone_to_misuseboolNoProne to misuse
no_certificationsboolNoLacks certifications

* Exactly one of folder, snippet, or device is required.

Methods​

List Applications​

Retrieves a list of application objects with optional filtering.

apps = client.application.list(
folder="Texas",
category=["business-systems"],
risk=[3, 4, 5]
)

for app in apps:
print(f"Name: {app.name}, Category: {app.category}, Risk: {app.risk}")

Fetch an Application​

Retrieves a single application by name and container.

app = client.application.fetch(name="custom-database", folder="Texas")
print(f"Found application: {app.name}")

Create an Application​

Creates a new custom application definition.

new_app = client.application.create({
"name": "custom-database",
"category": "business-systems",
"subcategory": "database",
"technology": "client-server",
"risk": 3,
"description": "Custom database application",
"ports": ["tcp/1521"],
"folder": "Texas"
})

Update an Application​

Updates an existing application object.

existing = client.application.fetch(name="custom-database", folder="Texas")
existing.risk = 4
existing.has_known_vulnerabilities = True
existing.ports = ["tcp/1521", "tcp/1522"]

updated = client.application.update(existing)

Delete an Application​

Deletes an application object by ID.

client.application.delete("123e4567-e89b-12d3-a456-426655440000")

Use Cases​

Defining a Custom Application with Security Attributes​

Create an application with full security characteristics.

from scm.client import Scm

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

client.application.create({
"name": "secure-chat",
"category": "collaboration",
"subcategory": "instant-messaging",
"technology": "client-server",
"risk": 2,
"description": "Secure internal chat application",
"ports": ["tcp/8443"],
"folder": "Texas",
"transfers_files": True,
"has_known_vulnerabilities": False,
"evasive": False,
"pervasive": True
})

Filtering Applications by Risk and Category​

Find applications matching specific risk and category criteria.

# Find high-risk business applications
high_risk = client.application.list(
folder="Texas",
category=["business-systems"],
risk=[4, 5]
)

for app in high_risk:
print(f"{app.name}: risk={app.risk}, category={app.category}")

# Exact match with exclusions
filtered = client.application.list(
folder="Texas",
exact_match=True,
exclude_folders=["All"],
exclude_snippets=["default"]
)

Error Handling​

from scm.client import Scm
from scm.exceptions import (
InvalidObjectError,
MissingQueryParameterError,
NameNotUniqueError,
ObjectNotPresentError,
ReferenceNotZeroError
)

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

try:
new_app = client.application.create({
"name": "test-app",
"category": "business-systems",
"subcategory": "database",
"technology": "client-server",
"risk": 3,
"folder": "Texas",
"ports": ["tcp/1521"]
})
except InvalidObjectError as e:
print(f"Invalid application data: {e.message}")
except NameNotUniqueError as e:
print(f"Application name already exists: {e.message}")
except ObjectNotPresentError as e:
print(f"Application not found: {e.message}")
except ReferenceNotZeroError as e:
print(f"Application still in use: {e.message}")
except MissingQueryParameterError as e:
print(f"Missing parameter: {e.message}")