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

Added a new connector for the Updated Crowdstrike Alerts endpoint. #1710 #1724

Merged
merged 30 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c81f9fa
Temporary Commit.
DerekRushton Jun 11, 2024
6e3ab66
Crowdstrike_temp_commits_2
DerekRushton Jun 27, 2024
83521ce
crowdstrike_3
DerekRushton Jun 27, 2024
49f19fe
commit3
DerekRushton Jun 28, 2024
e29d539
Test4
DerekRushton Jul 4, 2024
6bed4a3
test4
DerekRushton Jul 9, 2024
fd104d3
Draft_final_commit
DerekRushton Jul 19, 2024
4e05ca8
Crowdstrike_Alerts_Final_Draft
DerekRushton Jul 19, 2024
3ff5e3f
Update config.json
DerekRushton Jul 19, 2024
c592a30
Update requirements.txt
DerekRushton Jul 19, 2024
08cf880
Delete requirements.txt
DerekRushton Jul 19, 2024
2d478c8
Update connector.py
DerekRushton Jul 19, 2024
f87a5ce
Update connector.py
DerekRushton Jul 19, 2024
d8fa933
Update connector.py
DerekRushton Jul 19, 2024
15bbf15
Update CHANGELOG.md
DerekRushton Jul 19, 2024
9853df3
Update from_stix_map.json
DerekRushton Jul 19, 2024
36f17cd
Update to_stix_map.json
DerekRushton Jul 19, 2024
f9fbc9e
Update requirements.txt
DerekRushton Jul 22, 2024
e647ebf
Merge branch 'develop' into CrowdStrike_Alert
DerekRushton Jul 22, 2024
9c02d98
Merge branch 'develop' into CrowdStrike_Alert
DerekRushton Aug 19, 2024
4c10d00
Ensuring the configs match.
DerekRushton Aug 19, 2024
a3ff4a8
Fixed some issues with length+offset
DerekRushton Aug 20, 2024
32ba146
Merge branch 'develop' into Crowdstrike_Alerts_2
benjamin-craig Aug 20, 2024
221c60b
Made a mistake with the last small fix.
DerekRushton Aug 21, 2024
a67f176
Changing the display name
DerekRushton Aug 21, 2024
4e8f69b
Fixed STIX 2.1 mapping
DerekRushton Aug 22, 2024
5827692
STIX 2.1
DerekRushton Aug 22, 2024
4d71856
Merge branch 'develop' into Crowdstrike_Alerts_2
benjamin-craig Aug 23, 2024
7d531d3
Merge branch 'develop' into Crowdstrike_Alerts_2
benjamin-craig Aug 27, 2024
d1fba59
Merge branch 'develop' into Crowdstrike_Alerts_2
DerekRushton Sep 13, 2024
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
1 change: 1 addition & 0 deletions docs/supported-mappings.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Stix-shifter currently offers connector support for the following cybersecurity
- [Carbon Black Cloud](../stix_shifter_modules/cbcloud/cbcloud_supported_stix.md)
- [Cisco Secure Email](../stix_shifter_modules/cisco_secure_email/cisco_secure_email_supported_stix.md)
- [CrowdStrike Falcon](../stix_shifter_modules/crowdstrike/crowdstrike_supported_stix.md)
- [CrowdStrike Falcon Alerts API](../stix_shifter_modules/crowdstrike_alerts/crowdstrike_alerts_supported_stix.md)
- [Cybereason](../stix_shifter_modules/cybereason/cybereason_supported_stix.md)
- [Darktrace](../stix_shifter_modules/darktrace/darktrace_supported_stix.md)
- [Datadog](../stix_shifter_modules/datadog/datadog_supported_stix.md)
Expand Down
3 changes: 2 additions & 1 deletion stix_shifter/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ flask==3.0.0
flatten_json==0.1.14
json-fix==1.0.0
jsonmerge==1.9.2
numpy==1.24.4
pyOpenSSL==24.1.0
python-dateutil==2.8.2
stix2-matcher==3.0.0
stix2-patterns==1.3.2
xmltodict==0.13.0
urllib3==1.26.19
regex==2023.12.25
regex==2023.12.25
1 change: 1 addition & 0 deletions stix_shifter/scripts/supported_property_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"cbcloud": "Carbon Black Cloud",
"cisco_secure_email": "Cisco Secure Email",
"crowdstrike": 'CrowdStrike Falcon',
"crowdstrike_alerts": 'CrowdStrike Falcon Alerts API',
"cybereason": "Cybereason",
"darktrace": "Darktrace",
"datadog": "Datadog",
Expand Down
3 changes: 3 additions & 0 deletions stix_shifter_modules/crowdstrike/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CrowdStrike Falcon

The CrowdStrike connector is set for deprecation and will no longer be supported. To continue receiving data, use the CrowdStrike Alerts connector instead.
The CrowdStrike Alerts connector will collect the same data as this one, except it uses the newer alerts endpoint instead of the detections endpoint.

## Supported STIX Mappings

See the [table of mappings](crowdstrike_supported_stix.md) for the STIX objects and operators supported by this connector.
Expand Down
4 changes: 2 additions & 2 deletions stix_shifter_modules/crowdstrike/configuration/lang_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"type" : "fields",
"client_id": {
"label": "Client ID",
"description": "Unique identifier of CrowdStrike API. It can be found in the API client table in the Falcon console"
"description": "Unique identifier for CrowdStrike APIs. An API Client can be created in the API clients and keys section of the Falcon console"
},
"client_secret": {
"label": "Client secret",
"description": "Secret code of CrowdStrike API client. It can be found while creating a API client in Falcon console"
"description": "Secret code for CrowdStrike API client. An API Client can be created in the API clients and keys section of the Falcon console"
}
}
}
Expand Down
132 changes: 132 additions & 0 deletions stix_shifter_modules/crowdstrike_alerts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# CrowdStrike Falcon Alerts

## About this connector

This connector replaces the now deprecated crowdstrike connector for collecting CrowdStrike Falcon detection and alert data.

## Supported STIX Mappings

See the [table of mappings](crowdstrike_alerts_supported_stix.md) for the STIX objects and operators supported by this connector.

## CrowdStrike Alerts Requirements

The CrowdStrike Alerts API requires the following to work.

1. A CrowdStrike environment with Endpoint Security set-up.
2. An OAuth2 API Client created with Alerts Scope enabled for read and the Detections Scope enabled for read.
3. Both the Client ID and Secret.

## CrowdStrike Alerts Sample Curl Commands

The Crowdstrike alerts API works via the following mechanisms.

1. Use the OAuth2 API Client Credentials to obtain a bearer token (this token expires after a set amount of time).
2. Using the bearer token, create a request for a list of ID's that match the query with a set limit.
3. Create a query for the data results using the list of ID's.

Curl command to get a bearer token.

```curl --location 'https://[host]/oauth2/token' \
--header 'accept: application/json' \
--header 'user-agent: oca_stixshifter_1.0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=[id]' \
--data-urlencode 'client_secret=[secret]'
```

Curl command to get a list of ID's.

```curl --location 'https://[host]/alerts/queries/alerts/v2' \
--header 'accept: application/json' \
--header 'user-agent: oca_stixshifter_1.0' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [bearer token]'
```

Curl command to get the ID details

```curl --location 'https://[host]/alerts/queries/alerts/v2' \
--header 'accept: application/json' \
--header 'user-agent: oca_stixshifter_1.0' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [bearer token]' \
--data '{"composite_ids":[ID List]}'
```

## CrowdStrike Supported STIX Pattern values (Querying):

The supported query values are defined in the mapping file from_stix_map.json. For detailed list of supported STIX Pattern values refer to the crowdstrike_alerts_supported_stix.md.

### Execute a STIX pattern on a CrowdStrike instance

```bash
$ python3 main.py execute crowdstrike_alerts crowdstrike_alerts "<data_source>" "<connection>" "<configuration>" "<query>"
```


```bash
$ python3 main.py execute crowdstrike_alerts crowdstrike_alerts "{\"type\":\"identity\",\"id\":\"identity--f431f809-377b-45e0-aa1c-6a4751cae5ff\",\"name\":\"Crowdstrike\",\"identity_class\":\"events\", \"created\":\"2022-05-22T13:22:50.336Z\",\"modified\":\"2022-05-25T13:22:50.336Z\"}" "{\"host\":\"[host\"}" "{\"auth\":{\"client_id\":\"[id]\", \"client_secret\":\"[secret]\"}}" "[ipv4-addr:value != '1.1.1.1'] START t'2024-03-01T11:00:00.000Z' STOP t'2024-07-03T11:54:00.000Z'" -r 100
```

Note in this example some logging is omitted.

Translated CrowdStrike query and parsed STIX expression:

```bash
$ python3 main.py translate crowdstrike_alerts query '{}' "[process:name = 'cmd.exe']"

"queries": [
"(((filename: 'cmd.exe',grandparent_details.filename: 'cmd.exe',parent_details.filename: 'cmd.exe')) %2B timestamp:> '2024-07-19T14:53:37.560762')"
]
```

## Example I - Converting from STIX patterns to FQL queries (STIX attributes)

STIX to sentinel field mapping is defined in from_stix_map.json

This example input pattern:

```bash
$ python3 main.py translate crowdstrike_alerts query '{}' "[process:name = 'cmd.exe']"
```

Returns the following native query:

```bash
"queries": [
"(((filename: 'cmd.exe',grandparent_details.filename: 'cmd.exe',parent_details.filename: 'cmd.exe')) %2B timestamp:> '2024-07-19T14:53:37.560762')"
]
```


## Example - Converting from CrowdStrike alerts to STIX (STIX attributes)

Sentinel data to STIX mapping is defined in to_stix_map.json

Sample data:

CrowdStrike data to Stix mapping is defined in to_stix_map.json which is located in the crowdstrike module.

For an example of an untranslated result see the file under crowdstrike_alerts/tests/stix_translation/sample_results_data.json.
For an example of a translated result see the file under crowdstrike_alerts/tests/stix_translation/sample_results_transformed.json.

## Operator Support (Data Source)
AND (Comparison)
OR (Comparison)
=
!=
>
>=
<
<=
IN

## Exclusions

FQL does not supports the following operators:
* LIKE
* Matches

## Limitations

Not all fields may be supported. The Alerts endpoint can pull results from multiple products. The current implementation will only support detection alerts.
Empty file.
41 changes: 41 additions & 0 deletions stix_shifter_modules/crowdstrike_alerts/configuration/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"connection": {
"type": {
"displayName": "CrowdStrike Falcon Alerts",
"group": "crowdstrike"
},
"host": {
"type": "text",
"regex": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_:/\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9_:/\\-]*[A-Za-z0-9])$"
},
"port": {
"type": "number",
"default": 443,
"min": 1,
"max": 65535
},
"help": {
"default": "data-sources-crowdstrike-falcon.html",
"type": "link"
},
"options": {
"validate_pattern": {
"default": false
},
"result_limit": {
"default": 1000
}
}
},
"configuration": {
"auth": {
"type" : "fields",
"client_id": {
"type": "password"
},
"client_secret": {
"type": "password"
}
}
}
}
29 changes: 29 additions & 0 deletions stix_shifter_modules/crowdstrike_alerts/configuration/lang_en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"connection": {
"host": {
"label": "Management IP address or hostname",
"description": "Specify the IP address or hostname of the data source"
},
"port": {
"label": "Host port",
"description": "Set the port number that is associated with the hostname or IP address"
},
"help": {
"label": "Need additional help?",
"description": "More details on the data source setting can be found in the specified link"
}
},
"configuration": {
"auth": {
"type" : "fields",
"client_id": {
"label": "Client ID",
"description": "Unique identifier for CrowdStrike APIs. An API Client can be created in the API clients and keys section of the Falcon console"
},
"client_secret": {
"label": "Client secret",
"description": "Secret code for CrowdStrike API client. An API Client can be created in the API clients and keys section of the Falcon console"
}
}
}
}
Loading
Loading