-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
103 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -27,6 +27,9 @@ primary_key = | |
|
||
[aws] | ||
region = | ||
|
||
[aws_sqs] | ||
region = | ||
sqs_queue_name = | ||
|
||
[workspaceone] | ||
|
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# AWS SQS Backend | ||
|
||
Integration with AWS SQS -- pushes raw events from CrowdStrike event stream to AWS SQS. Deduplication of the events is done on SQS side. | ||
|
||
### Example Configuration file | ||
|
||
[config/config.ini](https://github.com/CrowdStrike/falcon-integration-gateway/blob/main/config/config.ini) configures Falcon Integration Gateway. Below is a minimal configuration example for AWS SQS backend: | ||
``` | ||
[main] | ||
# Cloud backends that are enabled. The gateway will push events to the cloud providers specified below | ||
backends=AWS_SQS | ||
[aws_sqs] | ||
# AWS section is applicable only when AWS backend is enabled in the [main] section. | ||
# Uncomment to provide aws region. Alternatively, use AWS_REGION env variable | ||
#region=eu-west-1 | ||
# Uncomment to provide name of AWS SQS. Alternatively, use AWS_SQS env variable | ||
#sqs_queue_name = my-sqs-queue-for-falcon | ||
``` | ||
|
||
### Developer Guide | ||
|
||
- Build the image | ||
``` | ||
docker build . -t falcon-integration-gateway | ||
``` | ||
- Run the application | ||
``` | ||
docker run -it --rm \ | ||
-e FALCON_CLIENT_ID="$FALCON_CLIENT_ID" \ | ||
-e FALCON_CLIENT_SECRET="$FALCON_CLIENT_SECRET" \ | ||
-e FALCON_CLOUD_REGION="us-1" \ | ||
-e AWS_SQS=my-queue \ | ||
-e AWS_REGION=mars-west-2 \ | ||
-v ~/.aws:/fig/.aws \ | ||
falcon-integration-gateway:latest | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import json | ||
import boto3 | ||
from botocore.exceptions import ClientError | ||
from ...config import config | ||
from ...log import log | ||
|
||
|
||
class Submitter(): | ||
def __init__(self): | ||
aws_region = config.get('aws_sqs', 'region') | ||
sqs_queue_name = config.get('aws_sqs', 'sqs_queue_name') | ||
log.debug("Attempting to connect to AWS (region %s) SQS: %s", aws_region, sqs_queue_name) | ||
try: | ||
aws_client = boto3.resource('sqs', region_name=aws_region) | ||
self.queue = aws_client.get_queue_by_name(QueueName=sqs_queue_name) | ||
except ClientError: # pylint: disable=W0703 | ||
log.exception("Cannot configure AWS SQS Queue: %s in %s", aws_region, sqs_queue_name) | ||
self.queue = None | ||
raise | ||
|
||
def submit(self, event): | ||
self.queue.send_message(MessageBody=json.dumps(event.original_event)) | ||
|
||
|
||
class Runtime(): | ||
RELEVANT_EVENT_TYPES = ['DetectionSummaryEvent'] | ||
|
||
def __init__(self): | ||
log.info("AWS SQS Backend is enabled.") | ||
self.submitter = Submitter() | ||
|
||
def is_relevant(self, falcon_event): | ||
return True | ||
|
||
def process(self, falcon_event): | ||
self.submitter.submit(falcon_event) | ||
|
||
|
||
__all__ = ['Runtime'] |
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