waft.cf_dashboard.zero_trust.device_posture module

class waft.cf_dashboard.zero_trust.device_posture.DevicePostureOperations(dash_client: CfDashboardClient, account_id: str)

Bases: CfDashboardResource

Class to define interactions with Device Posture Rules over Cloudflare python SDK

create_file_rule(name: str, path: str, exists: bool, platform: Literal['mac', 'windows', 'linux'], schedule: str | None = None, sha256: str | None = None, thumbprint: str | None = None) DevicePostureRule

Creates a new file based device posture rule with the given parameters

Parameters:
  • name – Name of the rule to be created.

  • path – Path to the file being used in the test.

  • exists – Whether the file should exist for the test to pass. (ex. Test will fail if set to false and file exists)

  • platform – Literal for the platform to check for file existence.

  • schedule – Schedule on which the test should be running (Default 5 minutes)

  • sha256 – Optional parameter for SHA-256 value of file.

  • thumbprint – Thumbprint of the publishing certificate used to sign the file.

Raises:

RuntimeError – if rule is not found

Returns:

device posture object

Return type:

DevicePostureRule

delete(rule_id: str) None

Delete Device Posture Rule with given rule ID

Parameters:

rule_id – ID of Device posture rule to delete

Raises:

ValueError – In the case of an unknown rule ID

get(rule_id: str) DevicePostureRule

Get device posture object for posture rule with given rule ID

Parameters:

rule_id (str) – rule ID to request and return

Raises:

RuntimeError – if rule is not found

Returns:

device posture object

Return type:

DevicePostureRule

list() List[DevicePostureRule]

List all currently defined device posture rules

Returns:

A list of device posture rules defined in the current account

Return type:

List[DevicePostureRule]