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

Serverless application repository template #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
25 changes: 23 additions & 2 deletions post-scan-actions/aws-nodejs-securityhub-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,29 @@ Pushes FSS malware detections to AWS Security Hub integration.
Change directory to `/lambda`. Run `npm run package` to install dependencies and zip it all together as `bundle.zip` and upload it to a bucket and take note of the key.
Start a new stack based on this template.

## Template Inputs
## What is AWS Security Hub?
AWS Security Hub provides a comprehensive view of your security posture in Amazon Web Services (AWS) and helps you check your environment against security standards and Malicious file detection using serverless plugin.
In order to push malware finding to AWS Security hub, open source serverless plugin need to be deployed and configured with AWS SNS topic created by Scanner Stack created in previous step.

## Deployment steps
1. Visit plugin from serverless application repository

2. Enter AWS Account details and AWS Security hub ARN
AWSACCOUNTNO: Provide your aws account ID
AWSSecurityHubARN: arn:aws:securityhub:<region>:<aws acc no>:product/<aws acc no>/default


3. Copy ScanResultTopicArn from scanner cloudformation stack output. This is the same ARN that we have used in previous step for Quarantine and promote object.


4. Enter ScanResultTopicARN to serverless application parameter and proceed to Deploy


5. Verify serverless plugin deployment is completed.
Comment on lines +12 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



## Cloudformation Template Inputs

* `snsScanResultTopicArn:` FSS Results SNS Topic ARN
* `LambdaZipBucket` S3 bucket for lambda zip. If your have it under s3://bucket/path/to/zip.zip, enter 'bucket' here.
* `LambdaZipKey` S3 key for lambda zip. If your have it under s3://bucket/path/to/zip.zip, enter 'path/to/zip.zip' here.
* `LambdaZipKey` S3 key for lambda zip. If your have it under s3://bucket/path/to/zip.zip, enter 'path/to/zip.zip' here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31

Parameters:
ScanResultTopicARN:
Type: String
Description: The ARN of the scan result SNS topic in storage stack.
AWSACCOUNTNO:
Type: Number
Description: Provide AWS Account ID.
AWSSecurityHubARN:
Type: String
Description: Provide AWS Security hub ARN from selected region

Resources:
C1FSecurityHub:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://bucket-4716/lambda.zip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea to add a new template and new code from unmanaged bucket. Instead, modify the template.yaml would with a Metadata section like this would make more sense.

Handler: index.handler
Runtime: nodejs12.x
MemorySize: 128
Timeout: 30
Tracing: Active
Environment:
Variables:
ACCOUNT_ID: !Ref AWSACCOUNTNO
SECURITY_HUB_ARN: !Ref AWSSecurityHubARN
Policies:
- Statement:
Effect: Allow
Action:
- securityhub:*
Resource:
- !Ref AWSSecurityHubARN

Events:
ScanResult:
Type: SNS
Properties:
Topic: !Ref ScanResultTopicARN