sva.sentinelone.sentinelone_upgrade_policies module – Manage SentinelOne Upgrade Policies

Note

This module is part of the sva.sentinelone collection (version 2.0.5).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sva.sentinelone. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sva.sentinelone.sentinelone_upgrade_policies.

New in sva.sentinelone 1.0.0

Synopsis

  • This module is able to update ‘Upgrade Policies’ in SentinelOne

Requirements

The below requirements are needed on the host that executes this module.

  • deepdiff >= 5.6

Parameters

Parameter

Comments

console_url

string / required

Insert your management console URL

groups

list / elements=string

Set this option to set the scope to group level

A list with groupnames where the upgrade policy should be changed

Default: []

inherit_maintenance_windows

boolean

Inherit ‘Maintenance Windows Settings’ from upper scope

If inherit_maintenance_windows=yes maintenance_windows will be ignored and the settings will be inherited from upper scope

Choices:

  • false ← (default)

  • true

inherit_max_concurrent_downloads

boolean

Inherit ‘Maximum Concurrent Downloads’ from upper scope

If inherit_max_concurrent_downloads=yes max_concurrent_downloads will be ignored and

the settings will be inherited from upper scope

Choices:

  • false ← (default)

  • true

maintenance_windows

dictionary

Define the settings which should be set in policy. Available options can be referred in API documentation

Usage see examples section

Required if inherit_maintenance_windows=no

Will be ignored if inherit_maintenance_windows=yes

max_concurrent_downloads

integer

Set the ‘Maximum Concurrent Downloads’. Needs to be lower or equal to the value set in the upper scope

Required if inherit_max_concurrent_downloads=no

Will be ignored if inherit_max_concurrent_downloads=yes

site_name

string / required

Name of the site in SentinelOne

timezone

string

Set the timezone

Example value: +01:00

Default: "+00:00"

token

string / required

SentinelOne API auth token to authenticate at the management API

Notes

Note

  • Python module deepdiff. Tested with version >=5.6. Lower version may work too

  • Currently only supported in single-account management consoles

  • Currently not applicable for account level upgrade policies

Examples

- name: Set custom 'Maximum Concurrent Downloads' on multiple groups
  sva.sentinelone.sentinelone_upgrade_policies:
    console_url: "https://XXXXX.sentinelone.net"
    token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
    site_name: "test"
    groups:
      - group1
      - group2
    max_concurrent_downloads: 1000
- name: Enable inheritance for 'Maximum Concurrent Downloads' and for 'Maintenance Windows Settings' on site scope
  sva.sentinelone.sentinelone_upgrade_policies:
    console_url: "https://XXXXX.sentinelone.net"
    token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
    site_name: "test"
    inherit_max_concurrent_downloads: true
    inherit_maintenance_windows: true
- name: Set custom 'Maintenance Windows' for monday and tuesday on single group
  sva.sentinelone.sentinelone_upgrade_policies:
    console_url: "https://XXXXX.sentinelone.net"
    token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
    site_name: "test"
    groups:
      - group1
    inherit_max_concurrent_downloads: true
    inherit_maintenance_windows: false
    maintenance_windows:
      monday:
        - from: "8:00 am"
          to: "11:00 pm"
      tuesday:
        - from: "8:00 am"
          to: "12:00 pm"
        - from: "3:00 pm"
          to: "7:00 pm"
- name: Set custom 'Maintenance Windows' for monday on single group and use specific timezone
  sva.sentinelone.sentinelone_upgrade_policies:
    console_url: "https://XXXXX.sentinelone.net"
    token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
    site_name: "test"
    groups:
      - group1
    inherit_max_concurrent_downloads: true
    inherit_maintenance_windows: false
    maintenance_windows:
      monday:
        - from: "8:00 am"
          to: "11:00 pm"
    timezone: "+02:00"
- name: Set custom 'Maintenance Windows' for whole wednesday on site scope
  sva.sentinelone.sentinelone_upgrade_policies:
    console_url: "https://XXXXX.sentinelone.net"
    token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
    site_name: "test"
    inherit_max_concurrent_downloads: true
    inherit_maintenance_windows: false
    maintenance_windows:
      wednesday:

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

message

list / elements=string

Get basic infos about the changes made

Returned: on success

Sample: ["Updating upgrade policy for group group1", "Updating upgrade policy for group group2"]

original_message

string

Get detailed infos about the changes made

Returned: on success

Sample: "[{'SiteId': '9999999999999999999', 'changes': {'dictionary_item_removed': [\"root['data']['maintenanceWindowsByDay']['Friday']\", \"root['data']['maintenanceWindowsByDay']['Saturday']\", \"root['data']['maintenanceWindowsByDay']['Sunday']\", \"root['data']['maintenanceWindowsByDay']['Thursday']\"], 'iterable_item_added': {\"root['data']['maintenanceWindowsByDay']['Monday']['maintenanceHours'][0]\": {'fromTime': '8:00 am', 'toTime': '11:00 pm'}, \"root['data']['maintenanceWindowsByDay']['Tuesday']['maintenanceHours'][0]\": {'fromTime': '8:00 am', 'toTime': '12:00 pm'}, \"root['data']['maintenanceWindowsByDay']['Tuesday']['maintenanceHours'][1]\": {'fromTime': '3:00 pm', 'toTime': '7:00 pm'}}, 'values_changed': {\"root['data']['inheritParentMaintenanceConfig']\": {'new_value': False, 'old_value': True}, \"root['data']['maintenanceWindowsByDay']['Monday']['isMaintenanceAllDay']\": {'new_value': False, 'old_value': True}, \"root['data']['maintenanceWindowsByDay']['Tuesday']['isMaintenanceAllDay']\": {'new_value': False, 'old_value': True}}}}]"

Authors

  • Marco Wester (@mwester117)