Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating policy files to reflect the current Duo Desktop policy structure #267

Merged
17 changes: 12 additions & 5 deletions examples/Admin/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,22 @@ 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):
cisco-jbammel marked this conversation as resolved.
Show resolved Hide resolved
"""
Update a given policy to include Duo Desktop policy
settings. Requires Access or Beyond editions.
"""

json_request = {
"sections": {
"device_health_app": {
"duo_desktop": {
cisco-jbammel marked this conversation as resolved.
Show resolved Hide resolved
"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",
},
Expand Down Expand Up @@ -139,8 +146,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")
Expand Down
18 changes: 12 additions & 6 deletions examples/Admin/policies_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,26 @@ 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):
cisco-jbammel marked this conversation as resolved.
Show resolved Hide resolved
"""
Update a given policy to include Duo Desktop policy
settings. Requires Access or Beyond editions.
"""

json_request = {
"sections": {
"device_health_app": {
"duo_desktop": {
cisco-jbammel marked this conversation as resolved.
Show resolved Hide resolved
"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",
},
Expand Down Expand Up @@ -148,8 +154,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")
Expand Down
Loading