This lambda function is meant to allow you listen to an S3 bucket for HDF results and push them to a Heimdall Server.
- How Does This Lambda Work?
- How Can I Deploy This Lambda with Terraform?
- What Format Do JSON Files Need to Be in for the Function to Process Results?
The lambda function is triggered when new files hit an S3 bucket that you specify under the unprocessed/*
folder. The lambda will then take several steps to process the results:
- Fetch the new file from S3
- Form a valid API request for a Heimdall server and tag the result with
HeimdallPusher
- Send the API request to the configured Heimdall server
- Save the HDF to the same S3 bucket under
hdf/*
- Save the original file to the same S3 bucket under
processed/*
- Delete the unprocessed version of the file from the S3 bucket
Before deploying with terraform you will need to pull the docker image to your deployment machine
docker pull ghcr.io/mitre/serverless-heimdall-pusher-lambda:<version>
##
# Heimdall Pusher Lambda function
#
# https://github.com/mitre/serverless-heimdall-pusher-lambda
#
module "serverless-heimdall-pusher-lambda" {
source = "github.com/mitre/serverless-heimdall-pusher-lambda"
heimdall_url = "https://target-heimdall.com"
heimdall_user = ""
heimdall_password = ""
results_bucket_id = "bucket_name"
subnet_ids = ["subnet-00000000000000000"]
security_groups = ["sg-00000000000000000"]
lambda_role_arn = aws_iam_role.InSpecRole.arn
lambda_name = "serverless-heimdall-pusher-lambda"
}
New files that are added to the S3 bucket under unprocessed/*
and are in the below format can trigger the lambda and have it process the results properly.
{
"data": {}, // This is where the HDF results go
"eval_tags": "ServerlessInspec,RHEL7" // These are any tags that should be assigned in Heimdall
}
© 2019-2021 The MITRE Corporation.
Approved for Public Release; Distribution Unlimited. Case Number 18-3678.
MITRE hereby grants express written permission to use, reproduce, distribute, modify, and otherwise leverage this software to the extent permitted by the licensed terms provided in the LICENSE.md file included with this project.
This software was produced for the U. S. Government under Contract Number W56KGU-18-D-0004, and is subject to Federal Acquisition Regulation Clause 52.227-14, Rights in Data-General.
No other use other than that granted to the U. S. Government, or to those acting on behalf of the U. S. Government under that Clause is authorized without the express written permission of The MITRE Corporation.