Skip to content

Commit

Permalink
New Role install_agent (#25)
Browse files Browse the repository at this point in the history
* Added new module sentinelone_download_agent module and install_agent role
* Fix Pipeline
  • Loading branch information
mwester117 authored Mar 27, 2024
1 parent ee9ca9a commit 68082a3
Show file tree
Hide file tree
Showing 31 changed files with 792 additions and 102 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
strategy:
matrix:
ansible:
- stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
Expand All @@ -28,13 +27,11 @@ jobs:
- '3.10'
- '3.11'
exclude:
- ansible: stable-2.13
python: '3.11'
- ansible: stable-2.16
python: '3.9'
include:
- ansible: stable-2.13
python: '3.8'
- ansible: stable-2.16
python: '3.12'

runs-on: ubuntu-latest
steps:
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ Sva.Sentinelone Release Notes

.. contents:: Topics

v1.1.0
======

Release Summary
---------------

This is the release v1.1.0 of the ``sva.sentinelone`` collection. It introduces new modules and roles.
Modules: sentinelone_download_agent
Roles: install_agent

New Modules
-----------

- sva.sentinelone.sentinelone_download_agent - Download SentinelOne agent from Management Console

New Roles
---------

- sva.sentinelone.install_agent - A role to download and install SentinelAgent on Windows and Linux hosts

v1.0.3
======
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ It provides several modules which helps to configure and manage SentinelOne Mana
- [sentinelone_path_exclusions](https://svalabs.github.io/sva.sentinelone/branch/main/collections/sva/sentinelone/sentinelone_path_exclusions_module.html)
- [sentinelone_policies](https://svalabs.github.io/sva.sentinelone/branch/main/collections/sva/sentinelone/sentinelone_policies_module.html)

- **Roles:**
- [install_agent](roles/install_agent/README.md)

## Requirements
### Ansible
- ansible >= 6 **or** ansible-core >= 2.13
- ansible >= 7 **or** ansible-core >= 2.14 (Lower versions may work but they have not been tested)

### Python
- Python >= 3.6 (deepdiff requirement)
- Python >= 3.9 (Ansible control node requirement)

### External
This collection needs the following Python modules:
Expand All @@ -34,13 +37,11 @@ This collection needs the following Python modules:
## Tested with Ansible and the following Python versions

Tested Ansible versions:
- 2.13
- 2.14
- 2.15
- 2.16

Tested Python versions:
- 3.8
- 3.9
- 3.10
- 3.11
Expand Down Expand Up @@ -77,7 +78,9 @@ See [Ansible Using collections](https://docs.ansible.com/ansible/devel/user_guid
The module documentation can be found [here](https://svalabs.github.io/sva.sentinelone/branch/main/collections/index_module.html).

## Changelog
**v1.0.3**: Increased request timeout and implemented error handling for requests that timed out.
**v1.1.0**: Added new sentinelone_download_agent module and install_agent role

**v1.0.3**: Increased request timeout and implemented error handling for requests that timed out

**v1.0.2**: Added detailed error message to module output if an API call fails

Expand All @@ -92,4 +95,4 @@ Detailed Changelog can be found at [CHANGELOG](CHANGELOG.rst)
- [ ] Unit tests needs to be written

## Licensing
The SVA SentinelOne collection is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.
The SVA SentinelOne collection is licensed under the GNU General Public License v3.0+. See [LICENSE](LICENSE) for the full license text.
7 changes: 6 additions & 1 deletion changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ plugins:
name: sentinelone_config_overrides
namespace: ''
version_added: 1.0.0
sentinelone_download_agent:
description: Download SentinelOne agent from Management Console
name: sentinelone_download_agent
namespace: ''
version_added: 1.1.0
sentinelone_filters:
description: Manage SentinelOne Filters
name: sentinelone_filters
Expand Down Expand Up @@ -48,4 +53,4 @@ plugins:
shell: {}
strategy: {}
vars: {}
version: 1.0.3
version: 1.1.0
23 changes: 23 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,26 @@ releases:
fragments:
- v1.0.3.yml
release_date: '2023-03-13'
1.1.0:
changes:
release_summary: 'This is the release v1.1.0 of the ``sva.sentinelone`` collection.
It introduces new modules and roles.
Modules: sentinelone_download_agent
Roles: install_agent
'
fragments:
- v1.1.0.yml
modules:
- description: Download SentinelOne agent from Management Console
name: sentinelone_download_agent
namespace: ''
objects:
role:
- description: A role to download and install SentinelAgent on Windows and Linux
hosts
name: install_agent
namespace: null
release_date: '2024-03-14'
20 changes: 14 additions & 6 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
### REQUIRED
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
Expand All @@ -8,14 +9,14 @@ namespace: "sva"
name: "sentinelone"

# The version of the collection. Must be compatible with semantic versioning
version: "1.0.3"
version: "1.1.0"

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: "README.md"

# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
authors:
- Marco Wester <marco.wester@sva.de>

### OPTIONAL but strongly recommended
Expand All @@ -24,14 +25,17 @@ description: "Collection for Sentinelone Modules"

# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
license: "Apache-2.0"
license:
- "GPL-3.0-or-later"
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
license_file: ""
license_file: "LICENSE"

# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags:
tags:
- application
- security
- sentinelone
- sentinelone_config_overrides
- sentinelone_filters
Expand All @@ -40,6 +44,10 @@ tags:
- sentinelone_policies
- sentinelone_sites
- sentinelone_upgrade_policies
- install_agent

dependencies:
ansible.windows: "*"

# The URL of the originating SCM repository
repository: "https://github.com/svalabs/sva.sentinelone"
Expand All @@ -57,6 +65,6 @@ issues: "https://github.com/svalabs/sva.sentinelone/issues"
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
# and '.git' are always filtered
build_ignore:
build_ignore:
- .github/**
- .gitignore
4 changes: 2 additions & 2 deletions meta/execution-environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 1

version: 3
dependencies:
python: requirements.txt
galaxy: requirements.yml
14 changes: 7 additions & 7 deletions plugins/modules/sentinelone_config_overrides.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright: (c) 2023, Marco Wester <marco.wester@sva.de>
# Copyright: (c) 2024, Marco Wester <marco.wester@sva.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
Expand Down Expand Up @@ -108,15 +108,15 @@
EXAMPLES = r'''
---
- name: Create/Update config_override for all agents on site
sentinelone_config_overrides:
sva.sentinelone.sentinelone_config_overrides:
console_url: "https://XXXXX.sentinelone.net"
token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
site_name: "test"
name: "test_override"
os_type: "windows"
config_override: { powershellProtection: true }
- name: Create/Update config_override for all agents on group
sentinelone_config_overrides:
sva.sentinelone.sentinelone_config_overrides:
console_url: "https://XXXXX.sentinelone.net"
token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
site_name: "test"
Expand All @@ -126,7 +126,7 @@
config_override:
powershellProtection: true
- name: Create/Update config_override for specific agent version on group
sentinelone_config_overrides:
sva.sentinelone.sentinelone_config_overrides:
console_url: "https://XXXXX.sentinelone.net"
token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
site_name: "test"
Expand All @@ -137,15 +137,15 @@
config_override:
powershellProtection: true
- name: Delete config_override for all agents on group
sentinelone_config_overrides:
sva.sentinelone.sentinelone_config_overrides:
console_url: "https://XXXXX.sentinelone.net"
token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
site_name: "test"
state: "absent"
group: "testgroup"
os_type: "windows"
- name: Delete config_override for specific agent version on site
sentinelone_config_overrides:
sva.sentinelone.sentinelone_config_overrides:
console_url: "https://XXXXX.sentinelone.net"
token: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
site_name: "test"
Expand Down Expand Up @@ -507,7 +507,7 @@ def run_module():

result = dict(
changed=False,
original_message=str(diffs),
original_message=diffs,
message=basic_message
)

Expand Down
Loading

0 comments on commit 68082a3

Please sign in to comment.