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

CrowdStrike: Added User-Agent string to API Client for tracking #1064

Merged
merged 3 commits into from
Aug 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def get_detections_IDs(self, filter, limit, sort=None):
data = dict()
headers['Content-Type'] = 'application/json'
headers['Accept'] = 'application/json'
headers['user-agent'] = 'oca_stixshifter_1.0'
headers['Authorization'] = f'Bearer {self.get_token()}'
endpoint = self.INCIDENTS_IDS_ENDPOINT
data['filter'] = filter
Expand All @@ -55,6 +56,7 @@ def ping_box(self):
# Sends a GET request
headers = dict()
headers['Authorization'] = f'Bearer {self.get_token()}'
headers['user-agent'] = 'oca_stixshifter_1.0'
endpoint = 'detects/queries/detects/v1' # Test if system alive
return self.client.call_api(endpoint, 'GET', headers=headers, timeout=self.timeout)

Expand All @@ -65,6 +67,7 @@ def get_detections_info(self, ids):
headers = dict()
headers['Content-Type'] = 'application/json'
headers['Accept'] = 'application/json'
headers['user-agent'] = 'oca_stixshifter_1.0'
headers['Authorization'] = f'Bearer {self.get_token()}'
endpoint = self.INCIDENTS_INFO_ENDPOINT
ids_expression = json.dumps({'ids': ids}).encode("utf-8")
Expand All @@ -81,6 +84,7 @@ def get_token(self) -> str:
self.TOKEN_ENDPOINT,
headers={
'accept': 'application/json',
'user-agent': 'oca_stixshifter_1.0',
'Content-Type': 'application/x-www-form-urlencoded'
},
data=(
Expand Down