This tool pulls findings from AWS Security Hub and outputs them for consumption by visualization tools. To use this tool, you need a role ARN that is valid for each account listed in the team map provided to the tool.
go get -u github.com/Enterprise-CMCS/mac-fc-security-hub-collector
security-hub-collector
is a CLI for retrieving Security Hub findings for visualization.
To display a full list of CLI options, build the application and run security-hub-collector -h
.
You will need to create a team map file with a JSON object that describes your teams based on account numbers, environments and role ARN which will be used to query the account. For example:
{
"teams": [
{
"accounts": [
{ "id": "000000000011", "environment": "dev", "roleArn": "arn:aws:iam::000000000011:role/CustomRole" },
{ "id": "000000000012", "environment": "test", "roleArn": "arn:aws:iam::000000000012:role/delegatedadmin/developer/AnotherCustomRole" }
],
"name":"My Team"
}
]
}
To run the Docker image locally for testing, do the following:
- create a local
team_map.json
file based on the example above export TEAM_MAP=$(cat team_map.json | base64)
- set AWS creds in the environment (
AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, AWS_SESSION_TOKEN
) docker build . -t local-collector-test
- run the image:
docker run \
-e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_ACCESS_KEY_ID -e TEAM_MAP \
-e AWS_REGION={region}
-e S3_BUCKET_PATH={bucket name} \
local-collector-test
The repo contains Terraform for:
- an ECR repo that hosts the Collector image, which is deployed in the
MACBIS Shared DSO Dev
account. A team's AWS account ID must be on the access list to have permission to pull the Collector image. The access list is maintained via theecr_read_account_ids
variable interraform/dev/account/terraform.tfvars
. To request access, please open a Jira ticket in theCMCS-MACBIS-DSO
project - those IAM resources needed for the
build-and-push-dev
workflow
This workflow builds and pushes the Collector image to a private ECR registry in MACBIS Shared DSO dev. It tags the image with the SHA and the value v2
, to signify a breaking change in the team map schema from the previous release tag, latest
. We have deprecated the latest
tag, but the image with this tag should not be removed from the repo because it is in use.
This workflow runs pre-commit, Go tests, and a Docker build upon pull requests