This solution integrates CrowdStrike Falcon Quick Scan with AWS S3, AWS Security Hub and AWS Systems Manager (Parameter Store), allowing for files to be scanned and threats remediated as objects are added to the bucket.
- Files are uploaded to the bucket.
- Bucket triggers the lambda function.
- Lambda function reads in Falcon API credentials from Systems Manager Parameter Store.
- Lambda function uploads file to Falcon X Sandbox for analysis.
- Lambda function retrieves the scan results.
- Malicious files are immediately removed from the bucket.
- A finding is generated in Security Hub for all malicious uploads.
All lambda activity is also logged to Amazon CloudWatch.
This solution leverages an S3 bucket trigger to call AWS Lambda for processing. The serverless lambda function leverages the CrowdStrike FalconPy SDK to interact with the CrowdStrike Falcon API to scan the files as the are uploaded to the bucket.
Any bucket can be protected by enabling the bucket notification trigger to call the lambda function.
- Bucket
- Bucket notification
s3:ObjectCreated:*
-> Lambda trigger
A single serverless function is deployed for this solution.
- Python 3
- Must contain a
crowdstrike-falconpy
layer - Policy statement
- Execution role
- Environment variables
- Statement ID:
AllowExecutionFromS3Bucket
- Principal:
s3.amazonaws.com
- Effect:
Allow
- Action:
lambda:InvokeFunction
- Conditions
{ "ArnLike": { "AWS:SourceArn": "arn:aws:s3:::{LAMBDA_FUNCTION_NAME}" } }
base_url
: CrowdStrike API base URL (only required for GovCloud users.)CLIENT_ID_PARAM
: Name of the Parameter store parameter containing the CrowdStrike API Key.CLIENT_SECRET_PARAM
: Name of the Parameter store parameter containing the CrowdStrike API Secret.MITIGATE_THREATS
: Boolean representing if identified threats should be removed from the bucket. Set toFALSE
to disable mitigation, defaults toTRUE
.
IAM is utilized to store execution permissions for our Lambda function.
The execution role for the Lambda function contains policies for SecurityHub, Systems Manager, S3 and CloudWatch.
{
"Statement": [
{
"Action": "securityhub:GetFindings",
"Effect": "Allow",
"Resource": "arn:aws:securityhub:{REGION}:{ACCOUNT_ID}:hub/default",
"Sid": ""
},
{
"Action": "securityhub:BatchImportFindings",
"Effect": "Allow",
"Resource": "arn:aws:securityhub:{REGION}:517716713836:product/crowdstrike/*",
"Sid": ""
}
],
"Version": "2012-10-17"
}
Note: The resource ARN for
securityhub:BatchImportFindings
must use the account ID specified above.
{
"Statement": [
{
"Action": [
"s3:GetObjectVersion",
"s3:GetObject",
"s3:DeleteObjectVersion",
"s3:DeleteObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::{BUCKET_NAME}/*",
"Sid": ""
}
],
"Version": "2012-10-17"
}
{
"Statement": [
{
"Action": [
"ssm:GetParametersByPath",
"ssm:GetParameters",
"ssm:GetParameterHistory",
"ssm:GetParameter"
],
"Effect": "Allow",
"Resource": "arn:aws:ssm:{REGION}:{ACCOUNT_ID}:parameter/*",
"Sid": ""
}
],
"Version": "2012-10-17"
}
{
"Statement": [
{
"Action": "logs:CreateLogGroup",
"Effect": "Allow",
"Resource": "arn:aws:logs:{REGION}:{ACCOUNT_ID}:*",
"Sid": ""
},
{
"Action": [
"logs:PutLogEvents",
"logs:CreateLogStream"
],
"Effect": "Allow",
"Resource": "arn:aws:logs:{REGION}:{ACCOUNT_ID}:log-group:/aws/lambda/{LAMBDA_FUNCTION_NAME}:*",
"Sid": ""
}
],
"Version": "2012-10-17"
}
Systems Manager Parameter Store is utilized to securely store our CrowdStrike API credentials.
- CrowdStrike API Key (SecureString)
- CrowdStrike API Secret (SecureString)
A demonstration has been developed for this integration. This demonstration creates a new bucket, implements S3 Bucket Protection on that bucket, and then deploys an instance with several test scripts and sample files for testing the integration in a real environment. You may access this demonstration by executing the demo.sh
script.
For more details regard this demonstration, review the content located here.
For scenarios where you either do not want to implement real-time protection, or where you are wanting to confirm the contents of a bucket before implementing protection, an on-demand scanning solution is provided as part of this integration.
This solution leverages the same APIs and logic that is implemented by the serverless handler that provides real-time protection.
The read more about this component, review the documentation located here.
A helper routine is provided as part of this integration that assists with deploying protection to an existing bucket. This helper leverages Terraform, and can be started by executing the existing.sh
script.
For more details about deploying protection to a pre-existing bucket, review the documentation located here.