-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for WildFire Antivirus Profiles Reorganized mkdocs navigation and introduced new models/methods for managing WildFire Antivirus Profiles. Updated SDK documentation and release notes accordingly. Fixed import path for AntiSpywareProfile to match the file renaming. * Update version to 0.1.9 Incremented the project version from 0.1.8 to 0.1.9 in the pyproject.toml file. This change likely includes new features, bug fixes, or improvements to the SDK.
- Loading branch information
Showing
16 changed files
with
1,267 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165 changes: 165 additions & 0 deletions
165
docs/sdk/config/security_services/wildfire_antivirus.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
# WildFire Antivirus Profile Configuration Object | ||
|
||
The `WildfireAntivirusProfile` class is used to manage WildFire Antivirus Profile objects in the Strata Cloud Manager. | ||
It provides methods to create, retrieve, update, delete, and list WildFire Antivirus Profile objects. | ||
|
||
--- | ||
|
||
## Importing the WildfireAntivirusProfile Class | ||
|
||
```python | ||
from scm.config.security import WildfireAntivirusProfile | ||
``` | ||
|
||
## Methods | ||
|
||
### `create(data: Dict[str, Any]) -> WildfireAntivirusProfileResponseModel` | ||
|
||
Creates a new WildFire Antivirus Profile object. | ||
|
||
**Parameters:** | ||
|
||
- `data` (Dict[str, Any]): A dictionary containing the WildFire Antivirus Profile object data. | ||
|
||
**Example:** | ||
|
||
```python | ||
profile_data = { | ||
"name": "test_profile", | ||
"description": "Created via pan-scm-sdk", | ||
"folder": "Prisma Access", | ||
"rules": [ | ||
{ | ||
"name": "rule1", | ||
"direction": "both", | ||
"analysis": "public-cloud" | ||
} | ||
] | ||
} | ||
|
||
new_profile = wildfire_antivirus_profile.create(profile_data) | ||
print(f"Created WildFire Antivirus Profile with ID: {new_profile.id}") | ||
``` | ||
|
||
### `get(object_id: str) -> WildfireAntivirusProfileResponseModel` | ||
|
||
Retrieves a WildFire Antivirus Profile object by its ID. | ||
|
||
**Parameters:** | ||
|
||
- `object_id` (str): The UUID of the WildFire Antivirus Profile object. | ||
|
||
**Example:** | ||
|
||
```python | ||
profile_id = "123e4567-e89b-12d3-a456-426655440000" | ||
profile_object = wildfire_antivirus_profile.get(profile_id) | ||
print(f"Profile Name: {profile_object.name}") | ||
``` | ||
|
||
### `update(object_id: str, data: Dict[str, Any]) -> WildfireAntivirusProfileResponseModel` | ||
|
||
Updates an existing WildFire Antivirus Profile object. | ||
|
||
**Parameters:** | ||
|
||
- `object_id` (str): The UUID of the WildFire Antivirus Profile object. | ||
- `data` (Dict[str, Any]): A dictionary containing the updated WildFire Antivirus Profile data. | ||
|
||
**Example:** | ||
|
||
```python | ||
update_data = { | ||
"description": "Updated description", | ||
} | ||
|
||
updated_profile = wildfire_antivirus_profile.update(profile_id, update_data) | ||
print(f"Updated WildFire Antivirus Profile with ID: {updated_profile.id}") | ||
``` | ||
|
||
### `delete(object_id: str) -> None` | ||
|
||
Deletes a WildFire Antivirus Profile object by its ID. | ||
|
||
**Parameters:** | ||
|
||
- `object_id` (str): The UUID of the WildFire Antivirus Profile object. | ||
|
||
**Example:** | ||
|
||
```python | ||
wildfire_antivirus_profile.delete(profile_id) | ||
print(f"Deleted WildFire Antivirus Profile with ID: {profile_id}") | ||
``` | ||
|
||
### | ||
`list(folder: Optional[str] = None, snippet: Optional[str] = None, device: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, name: Optional[str] = None, **filters) -> List[WildfireAntivirusProfileResponseModel]` | ||
|
||
Lists WildFire Antivirus Profile objects, optionally filtered by folder, snippet, device, or other criteria. | ||
|
||
**Parameters:** | ||
|
||
- `folder` (Optional[str]): The folder to list profiles from. | ||
- `snippet` (Optional[str]): The snippet to list profiles from. | ||
- `device` (Optional[str]): The device to list profiles from. | ||
- `offset` (Optional[int]): The pagination offset. | ||
- `limit` (Optional[int]): The pagination limit. | ||
- `name` (Optional[str]): Filter profiles by name. | ||
- `**filters`: Additional filters. | ||
|
||
**Example:** | ||
|
||
```python | ||
profiles = wildfire_antivirus_profile.list(folder='Prisma Access', limit=10) | ||
|
||
for profile in profiles: | ||
print(f"Profile Name: {profile.name}, ID: {profile.id}") | ||
``` | ||
|
||
--- | ||
|
||
## Usage Example | ||
|
||
```python | ||
from scm.client import Scm | ||
from scm.config.security import WildfireAntivirusProfile | ||
|
||
# Initialize the SCM client | ||
scm = Scm( | ||
client_id="your_client_id", | ||
client_secret="your_client_secret", | ||
tsg_id="your_tsg_id", | ||
) | ||
|
||
# Create a WildfireAntivirusProfile instance | ||
wildfire_antivirus_profile = WildfireAntivirusProfile(scm) | ||
|
||
# Create a new WildFire Antivirus Profile | ||
profile_data = { | ||
"name": "test_profile", | ||
"description": "Created via pan-scm-sdk", | ||
"folder": "Prisma Access", | ||
"rules": [ | ||
{ | ||
"name": "rule1", | ||
"direction": "both", | ||
"analysis": "public-cloud" | ||
} | ||
] | ||
} | ||
|
||
new_profile = wildfire_antivirus_profile.create(profile_data) | ||
print(f"Created WildFire Antivirus Profile with ID: {new_profile.id}") | ||
|
||
# List WildFire Antivirus Profiles | ||
profiles = wildfire_antivirus_profile.list(folder='Prisma Access', limit=10) | ||
for profile in profiles: | ||
print(f"Profile Name: {profile.name}, ID: {profile.id}") | ||
``` | ||
|
||
--- | ||
|
||
## Related Models | ||
|
||
- [WildfireAntivirusProfileRequestModel](models/wildfire_antivirus_profile_models.md#wildfireantivirusprofilerequest) | ||
- [WildfireAntivirusProfileResponseModel](models/wildfire_antivirus_profile_models.md#wildfireantivirusprofileresponse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
docs/sdk/models/security_services/wildfire_antivirus_profile_models.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# WildFire Antivirus Profile Models | ||
|
||
This section covers the data models associated with the `WildfireAntivirusProfile` configuration object. | ||
|
||
--- | ||
|
||
## WildfireAntivirusProfileRequestModel | ||
|
||
Used when creating or updating a WildFire Antivirus Profile object. | ||
|
||
### Attributes | ||
|
||
- `name` (str): **Required.** The name of the WildFire Antivirus Profile object. | ||
- `description` (Optional[str]): A description of the WildFire Antivirus Profile object. | ||
- `packet_capture` (Optional[bool]): Whether packet capture is enabled. | ||
- `mlav_exception` (Optional[List[MlavExceptionEntry]]): List of MLAV exceptions. | ||
- `rules` (List[RuleBase]): **Required.** List of rules for the profile. | ||
- `threat_exception` (Optional[List[ThreatExceptionEntry]]): List of threat exceptions. | ||
- **Container Type Fields** (Exactly one must be provided): | ||
- `folder` (Optional[str]): The folder where the profile is defined. | ||
- `snippet` (Optional[str]): The snippet where the profile is defined. | ||
- `device` (Optional[str]): The device where the profile is defined. | ||
|
||
### Example | ||
|
||
```python | ||
profile_request = WildfireAntivirusProfileRequestModel( | ||
name="test-profile", | ||
description="Sample WildFire Antivirus Profile", | ||
folder="Prisma Access", | ||
rules=[ | ||
RuleRequest( | ||
name="rule1", | ||
direction="both", | ||
analysis="public-cloud" | ||
) | ||
] | ||
) | ||
``` | ||
|
||
--- | ||
|
||
## WildfireAntivirusProfileResponseModel | ||
|
||
Used when parsing WildFire Antivirus Profile objects retrieved from the API. | ||
|
||
### Attributes | ||
|
||
- `id` (str): The UUID of the WildFire Antivirus Profile object. | ||
- `name` (str): The name of the WildFire Antivirus Profile object. | ||
- `description` (Optional[str]): A description of the WildFire Antivirus Profile object. | ||
- `packet_capture` (Optional[bool]): Whether packet capture is enabled. | ||
- `mlav_exception` (Optional[List[MlavExceptionEntry]]): List of MLAV exceptions. | ||
- `rules` (List[RuleBase]): List of rules for the profile. | ||
- `threat_exception` (Optional[List[ThreatExceptionEntry]]): List of threat exceptions. | ||
- **Container Type Fields**: | ||
- `folder` (Optional[str]): The folder where the profile is defined. | ||
- `snippet` (Optional[str]): The snippet where the profile is defined. | ||
- `device` (Optional[str]): The device where the profile is defined. | ||
|
||
### Example | ||
|
||
```python | ||
profile_response = WildfireAntivirusProfileResponseModel( | ||
id="123e4567-e89b-12d3-a456-426655440000", | ||
name="test-profile", | ||
description="Sample WildFire Antivirus Profile", | ||
folder="Prisma Access", | ||
rules=[ | ||
RuleResponse( | ||
name="rule1", | ||
direction="both", | ||
analysis="public-cloud" | ||
) | ||
] | ||
) | ||
``` | ||
|
||
--- | ||
|
||
## RuleBase | ||
|
||
Base class for Rule objects used in WildFire Antivirus Profiles. | ||
|
||
### Attributes | ||
|
||
- `name` (str): **Required.** Rule name. | ||
- `analysis` (Optional[Analysis]): Analysis type (public-cloud or private-cloud). | ||
- `application` (List[str]): List of applications (default: ["any"]). | ||
- `direction` (Direction): **Required.** Direction (download, upload, or both). | ||
- `file_type` (List[str]): List of file types (default: ["any"]). | ||
|
||
--- | ||
|
||
## MlavExceptionEntry | ||
|
||
Represents an entry in the 'mlav_exception' list. | ||
|
||
### Attributes | ||
|
||
- `name` (str): **Required.** Exception name. | ||
- `description` (Optional[str]): Description of the exception. | ||
- `filename` (str): **Required.** Filename for the exception. | ||
|
||
--- | ||
|
||
## ThreatExceptionEntry | ||
|
||
Represents an entry in the 'threat_exception' list. | ||
|
||
### Attributes | ||
|
||
- `name` (str): **Required.** Threat exception name. | ||
- `notes` (Optional[str]): Notes for the threat exception. | ||
|
||
--- | ||
|
||
## Enums | ||
|
||
### Analysis | ||
|
||
Enumeration of analysis types: | ||
|
||
- `public_cloud` | ||
- `private_cloud` | ||
|
||
### Direction | ||
|
||
Enumeration of directions: | ||
|
||
- `download` | ||
- `upload` | ||
- `both` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pan-scm-sdk" | ||
version = "0.1.8" | ||
version = "0.1.9" | ||
description = "Python SDK for Palo Alto Networks Strata Cloud Manager." | ||
authors = ["Calvin Remsburg <[email protected]>"] | ||
license = "Apache 2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# scm/config/security/__init__.py | ||
|
||
from .anti_spyware_profiles import AntiSpywareProfile | ||
from .anti_spyware_profile import AntiSpywareProfile | ||
from .wildfire_antivirus_profile import WildfireAntivirusProfile |
2 changes: 1 addition & 1 deletion
2
scm/config/security/anti_spyware_profiles.py → scm/config/security/anti_spyware_profile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.