-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(roles): updating roles in preparation for sensor_download module
- Loading branch information
1 parent
2ec045c
commit 796a3cc
Showing
5 changed files
with
44 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,24 @@ | ||
--- | ||
- name: CrowdStrike Falcon | Authenticate to CrowdStrike API | ||
ansible.builtin.uri: | ||
url: "https://{{ falcon_cloud }}/oauth2/token" | ||
method: POST | ||
body_format: json | ||
body: | ||
"client_id={{ falcon_client_id }}&client_secret={{ falcon_client_secret }}" | ||
return_content: true | ||
follow_redirects: all | ||
status_code: 201 | ||
headers: | ||
content-type: application/x-www-form-urlencoded | ||
register: falcon_api_oauth2_token | ||
no_log: "{{ falcon_api_enable_no_log }}" | ||
crowdstrike.falcon.auth: | ||
client_id: "{{ falcon_client_id }}" | ||
client_secret: "{{ falcon_client_secret }}" | ||
cloud: "{{ falcon_cloud }}" | ||
register: falcon | ||
run_once: "{{ falcon_api_auth_run_once }}" | ||
|
||
- name: CrowdStrike Falcon | Auto-discover CrowdStrike Cloud Region | ||
ansible.builtin.set_fact: | ||
falcon_cloud: "{{ falcon_cloud_urls[falcon_api_oauth2_token.x_cs_region] }}" | ||
when: | ||
- falcon_cloud_autodiscover | ||
- falcon_api_oauth2_token.x_cs_region | length > 0 | ||
no_log: "{{ falcon_api_enable_no_log }}" | ||
delegate_to: localhost | ||
|
||
- name: Set falcon_cid Block | ||
when: not falcon_cid | ||
block: | ||
- name: CrowdStrike Falcon | Detect Target CID Based on Credentials | ||
ansible.builtin.uri: | ||
url: https://{{ falcon_cloud }}/sensors/queries/installers/ccid/v1 | ||
method: GET | ||
return_content: true | ||
headers: | ||
authorization: "Bearer {{ falcon_api_oauth2_token.json.access_token }}" | ||
Content-Type: application/json | ||
register: falcon_api_target_cid | ||
no_log: "{{ falcon_api_enable_no_log }}" | ||
crowdstrike.falcon.cid_info: | ||
auth: "{{ falcon.auth }}" | ||
register: falcon_api_cid_info | ||
run_once: "{{ falcon_api_auth_run_once }}" | ||
delegate_to: localhost | ||
|
||
- name: CrowdStrike Falcon | Set CID received from API | ||
ansible.builtin.set_fact: | ||
falcon_cid: "{{ falcon_api_target_cid.json.resources[0] }}" | ||
falcon_cid: "{{ falcon_api_cid_info.cid }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters