Firewall¶
Firewall Policies¶
-
class
cloudpassage.
FirewallPolicy
(session, **kwargs)¶ Initializing the FirewallPolicy class:
Parameters: session ( cloudpassage.HaloSession
) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.Keyword Arguments: endpoint_version (int) – Endpoint version override. -
create
(object_body)¶ Create from JSON document.
Returns the ID of the new object
-
delete
(object_id)¶ Delete by ID. Success returns None
-
describe
(object_id)¶ Get the detailed configuration by ID
Parameters: object_id (str) – ID to retrieve detailed configuration information for Returns: dictionary object representing the entire object. Return type: dict
-
list_all
(**kwargs)¶ Lists all objects of this type.
Returns: List of objects (represented as dictionary-type objects) Return type: list Note
This method supports query parameters via keyword arguments.
-
update
(object_body)¶ Update. Success returns None
-
Firewall Rules¶
-
class
cloudpassage.
FirewallRule
(session, **kwargs)¶ Initializing the FirewallRule class:
Parameters: session ( cloudpassage.HaloSession
) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.Keyword Arguments: endpoint_version (int) – Endpoint version override. -
create
(firewall_policy_id, rule_body)¶ Creates a rule within a firewall policy.
Parameters: rule_body (dict or str) – string or dict containing the json representation of the firewall policy to be created. Returns: ID of newly-created firewall rule Return type: str Example rule_body:
{ "firewall_rule" : { "chain": "INPUT", "active": true, "firewall_interface": "7b881ca072b1012ec681404096c01709", "firewall_service": "7b6409a072b1012ec681404096c01709", "connection_states": "NEW, ESTABLISHED", "action": "ACCEPT", "log": true, "log_prefix": "East-3 input-accept", "comment": "All servers in group East-3 must include this rule", "position": 4 } }
-
delete
(firewall_policy_id, firewall_rule_id)¶ Delete a firewall policy rule
Parameters: Returns: None if successful. Errors will throw exceptions.
-
describe
(firewall_policy_id, firewall_rule_id)¶ Get the detailed configuration of a firewall rule
Parameters: Returns: dictionary object representing the entire firewall rule.
Return type:
-
endpoint
(policy_id)¶ Return endpoint for API requests.
-
list_all
(firewall_policy_id)¶ List all rules associated with a firewall policy.
Parameters: firewall_policy_id (str) – ID of firewall policy Returns: - Returns a list of rules associated with the firewall policy,
- each of which are represented by an object of type dict.
Return type: list
-
update
(firewall_policy_id, firewall_rule_id, firewall_rule_body)¶ Update a firewall policy rule.
Parameters: Returns: None if successful. Errors will throw exceptions.
Example:
{ "firewall_rule" : { "chain": "INPUT", "active": true, "firewall_interface": "7b881ca072b1012ec681404096c01709", "firewall_service": "7b6409a072b1012ec681404096c01709", "connection_states": "NEW, ESTABLISHED", "action": "ACCEPT", "log": true, "log_prefix": "East-3 input-accept", "comment": "All servers in group East-3 must include this rule", "position": 4 } }
-
Firewall IP Zones¶
-
class
cloudpassage.
FirewallZone
(session, **kwargs)¶ Initializing the FirewallZone class:
Parameters: session ( cloudpassage.HaloSession
) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.Keyword Arguments: endpoint_version (int) – Endpoint version override. -
create
(object_body)¶ Create from JSON document.
Returns the ID of the new object
-
delete
(object_id)¶ Delete by ID. Success returns None
-
describe
(object_id)¶ Get the detailed configuration by ID
Parameters: object_id (str) – ID to retrieve detailed configuration information for Returns: dictionary object representing the entire object. Return type: dict
-
list_all
(**kwargs)¶ Lists all objects of this type.
Returns: List of objects (represented as dictionary-type objects) Return type: list Note
This method supports query parameters via keyword arguments.
-
update
(object_body)¶ Update. Success returns None
-
Firewall Services¶
-
class
cloudpassage.
FirewallService
(session, **kwargs)¶ Initializing the FirewallService class:
Parameters: session ( cloudpassage.HaloSession
) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.Keyword Arguments: endpoint_version (int) – Endpoint version override. -
create
(object_body)¶ Create from JSON document.
Returns the ID of the new object
-
delete
(object_id)¶ Delete by ID. Success returns None
-
describe
(object_id)¶ Get the detailed configuration by ID
Parameters: object_id (str) – ID to retrieve detailed configuration information for Returns: dictionary object representing the entire object. Return type: dict
-
list_all
(**kwargs)¶ Lists all objects of this type.
Returns: List of objects (represented as dictionary-type objects) Return type: list Note
This method supports query parameters via keyword arguments.
-
update
(object_body)¶ Update. Success returns None
-
Firewall Interfaces¶
-
class
cloudpassage.
FirewallInterface
(session, **kwargs)¶ Initializing the FirewallInterface class:
Parameters: session ( cloudpassage.HaloSession
) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.-
create
(object_body)¶ Create from JSON document.
Returns the ID of the new object
-
delete
(object_id)¶ Delete by ID. Success returns None
-
describe
(object_id)¶ Get the detailed configuration by ID
Parameters: object_id (str) – ID to retrieve detailed configuration information for Returns: dictionary object representing the entire object. Return type: dict
-
list_all
(**kwargs)¶ Lists all objects of this type.
Returns: List of objects (represented as dictionary-type objects) Return type: list Note
This method supports query parameters via keyword arguments.
-
update
(object_body)¶ Update. Success returns None
-