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

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -829,5 +829,4 @@ opencybersecurityalliance/stix-shifter/pull/1448)
* Bump adal from 1.2.2 to 1.2.7
* Bump pyopenssl from 20.0.1 to 22.0.0
* Bump stix2-validator from 1.1.2 to 3.0.2
* Bump boto3 from 1.17.20 to 1.21.5## 4.0.0 (2022-02-23)## 7.0.11 (2024-07-11)

* Bump boto3 from 1.17.20 to 1.21.5## 4.0.0 (2022-02-23)
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.18
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
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\":\"u9fE7zS4yM25XVDvtKmBY8qUj6d1AohP3pRscLC0\"}}" "[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",
"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 of CrowdStrike Alerts API. 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 Alerts API client. An API Client can be created in the API clients and keys section of the Falcon console"
}
}
}
}
Loading
Loading