From 36bfab6dc132d9029b8354fa2e5d239269473574 Mon Sep 17 00:00:00 2001 From: Jen Bammel <135041996+cisco-jbammel@users.noreply.github.com> Date: Thu, 2 May 2024 11:02:55 -0400 Subject: [PATCH 1/6] Update policies.py to use Duo Desktop section The Duo Desktop section replaced the device_health_app section in the official admin API docs, but this example was never updated to reflect that. This commit updates this to use the correct section. --- examples/Admin/policies.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/Admin/policies.py b/examples/Admin/policies.py index 031720f..b9b652c 100755 --- a/examples/Admin/policies.py +++ b/examples/Admin/policies.py @@ -78,19 +78,19 @@ def bulk_delete_section(policy_keys, print_response=False): pretty = json.dumps(response, indent=4, sort_keys=True, default=str) print(pretty) -def update_policy_with_device_health_app(policy_key, print_response=False): +def update_policy_with_duo_desktop(policy_key, print_response=False): """ - Update a given policy to include Duo Device Health App policy + Update a given policy to include Duo Desktop policy settings. Requires Access or Beyond editions. """ json_request = { "sections": { - "device_health_app": { + "duo_desktop": { "enforce_encryption": ["windows"], "enforce_firewall": ["windows"], "prompt_to_install": ["windows"], - "requires_DHA": ["windows"], + "requires_duo_desktop": ["windows"], "windows_endpoint_security_list": ["cisco-amp"], "windows_remediation_note": "Please install Windows agent", }, @@ -139,8 +139,8 @@ def main(): policy_key_a = create_empty_policy("Test New Policy - a") policy_key_b = create_empty_policy("Test New Policy - b") - # Update policy with Duo Device Health App settings. - update_policy_with_device_health_app(policy_key_b) + # Update policy with Duo Desktop settings. + update_policy_with_duo_desktop(policy_key_b) # Create an empty policy and delete it. policy_key_c = create_empty_policy("Test New Policy - c") From a8aa0730cf04278c996c83dc1e7baf7ad8545712 Mon Sep 17 00:00:00 2001 From: Jen Bammel <135041996+cisco-jbammel@users.noreply.github.com> Date: Thu, 2 May 2024 11:04:06 -0400 Subject: [PATCH 2/6] Update policies_advanced.py to use Duo Desktop The Duo Desktop section replaced the device_health_app section in the official admin API docs, but this example was never updated to reflect that. This commit updates this to use the correct section. --- examples/Admin/policies_advanced.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/Admin/policies_advanced.py b/examples/Admin/policies_advanced.py index 82bb30d..f545849 100755 --- a/examples/Admin/policies_advanced.py +++ b/examples/Admin/policies_advanced.py @@ -86,19 +86,19 @@ def bulk_delete_section(policy_keys, print_response=False): print(pretty) -def update_policy_with_device_health_app(policy_key, print_response=False): +def update_policy_with_duo_desktop(policy_key, print_response=False): """ - Update a given policy to include Duo Device Health App policy + Update a given policy to include Duo Desktop policy settings. Requires Access or Beyond editions. """ json_request = { "sections": { - "device_health_app": { + "duo_desktop": { "enforce_encryption": ["windows"], "enforce_firewall": ["windows"], "prompt_to_install": ["windows"], - "requires_DHA": ["windows"], + "requires_duo_desktop": ["windows"], "windows_endpoint_security_list": ["cisco-amp"], "windows_remediation_note": "Please install Windows agent", }, @@ -148,8 +148,8 @@ def main(): policy_key_a = create_empty_policy("Test New Policy - a") policy_key_b = create_empty_policy("Test New Policy - b") - # Update policy with Duo Device Health App settings. - update_policy_with_device_health_app(policy_key_b) + # Update policy with Duo Desktop settings. + update_policy_with_duo_desktop(policy_key_b) # Create an empty policy and delete it. policy_key_c = create_empty_policy("Test New Policy - c") From 55747509c529ea72189254fa9ef4b0a1efd00697 Mon Sep 17 00:00:00 2001 From: Jen Bammel <135041996+cisco-jbammel@users.noreply.github.com> Date: Thu, 2 May 2024 11:25:47 -0400 Subject: [PATCH 3/6] Remove the prompt_to_install, its not a param anymore --- examples/Admin/policies.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/Admin/policies.py b/examples/Admin/policies.py index b9b652c..7be9c0c 100755 --- a/examples/Admin/policies.py +++ b/examples/Admin/policies.py @@ -89,7 +89,6 @@ def update_policy_with_duo_desktop(policy_key, print_response=False): "duo_desktop": { "enforce_encryption": ["windows"], "enforce_firewall": ["windows"], - "prompt_to_install": ["windows"], "requires_duo_desktop": ["windows"], "windows_endpoint_security_list": ["cisco-amp"], "windows_remediation_note": "Please install Windows agent", From 66213843a7ea7a9eab93e9135b82ef7a44f4a53e Mon Sep 17 00:00:00 2001 From: Jen Bammel <135041996+cisco-jbammel@users.noreply.github.com> Date: Thu, 2 May 2024 11:26:43 -0400 Subject: [PATCH 4/6] Ensuring the prompt_to_install param isn't there, as that got removed --- examples/Admin/policies_advanced.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/Admin/policies_advanced.py b/examples/Admin/policies_advanced.py index f545849..4ac1ba2 100755 --- a/examples/Admin/policies_advanced.py +++ b/examples/Admin/policies_advanced.py @@ -97,7 +97,6 @@ def update_policy_with_duo_desktop(policy_key, print_response=False): "duo_desktop": { "enforce_encryption": ["windows"], "enforce_firewall": ["windows"], - "prompt_to_install": ["windows"], "requires_duo_desktop": ["windows"], "windows_endpoint_security_list": ["cisco-amp"], "windows_remediation_note": "Please install Windows agent", From 8c0822466555bc094612e0f5766dcce5f903a87f Mon Sep 17 00:00:00 2001 From: Jen Bammel <135041996+cisco-jbammel@users.noreply.github.com> Date: Thu, 2 May 2024 12:10:27 -0400 Subject: [PATCH 5/6] Ensuring the old device_health_app function is still there for backwards compatibility --- examples/Admin/policies.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/Admin/policies.py b/examples/Admin/policies.py index 7be9c0c..fd3262a 100755 --- a/examples/Admin/policies.py +++ b/examples/Admin/policies.py @@ -78,6 +78,14 @@ def bulk_delete_section(policy_keys, print_response=False): pretty = json.dumps(response, indent=4, sort_keys=True, default=str) print(pretty) +def update_policy_with_device_health_app(policy_key, print_response=False): + """ + Update a given policy to include Duo Device Health App policy + settings. Requires Access or Beyond editions. + NOTE: this function is deprecated, please use update_policy_with_duo_desktop + """ + return update_policy_with_duo_desktop(policy_key, print_response) + def update_policy_with_duo_desktop(policy_key, print_response=False): """ Update a given policy to include Duo Desktop policy From a3c73ca46fe2d001dd73a372fd499f8545c01670 Mon Sep 17 00:00:00 2001 From: Jen Bammel <135041996+cisco-jbammel@users.noreply.github.com> Date: Thu, 2 May 2024 12:11:15 -0400 Subject: [PATCH 6/6] Ensuring device_health_app function is maintained for backwards compatibility --- examples/Admin/policies_advanced.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/Admin/policies_advanced.py b/examples/Admin/policies_advanced.py index 4ac1ba2..7117de0 100755 --- a/examples/Admin/policies_advanced.py +++ b/examples/Admin/policies_advanced.py @@ -85,6 +85,13 @@ def bulk_delete_section(policy_keys, print_response=False): pretty = json.dumps(response, indent=4, sort_keys=True, default=str) print(pretty) +def update_policy_with_device_health_app(policy_key, print_response=False): + """ + Update a given policy to include Duo Device Health App policy + settings. Requires Access or Beyond editions. + NOTE: this function is deprecated, please use update_policy_with_duo_desktop + """ + return update_policy_with_duo_desktop(policy_key, print_response) def update_policy_with_duo_desktop(policy_key, print_response=False): """