Skip to content

Commit

Permalink
CrowdStrike: Added User-Agent string to API Client for tracking (#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
PacketJockey authored Aug 15, 2022
1 parent 7b015f1 commit fcb4b52
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit fcb4b52

Please sign in to comment.