Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: CC-BY-SA-4.0
The Macie Organization solution will enable Amazon Macie by delegating administration to a member account within the Organization Management Account and configuring Macie within the delegated administrator account for all the existing and future AWS Organization accounts. Macie is also configured to send the findings to a central S3 bucket encrypted with a KMS key.
- All resources are deployed via AWS CloudFormation as a
StackSet
andStack Instance
within the management account or a CloudFormationStack
within a specific account. - The Customizations for AWS Control Tower solution deploys all templates as a CloudFormation
StackSet
. - For parameter details, review the AWS CloudFormation templates.
The Lambda function is required to register the Macie delegated administrator account within each region provided
- All the
AWS Lambda Function
logs are sent to a CloudWatch Log Group</aws/lambda/<LambdaFunctionName>
to help with debugging and traceability of the actions performed. - By default the
AWS Lambda Function
will create the CloudWatch Log Group and logs are encrypted with a CloudWatch Logs service managed encryption key.
- IAM role used by the Lambda function to register the Macie delegated administrator account within each region provided
- Macie is enabled for each existing active account and region during the initial setup
- Macie will automatically enable new member accounts/regions when added to the AWS Organization
- S3 bucket where Macie classifications are exported for each account/region within the AWS Organization
- See 1.5 Macie
- Macie is configured to encrypt the exported findings with a customer managed KMS key
- IAM role assumed by the Lambda function within the management account to configure Macie within each region provided
- See 1.5 Macie
- See 1.5 Macie
- An IAM role is created within all the accounts to disable Macie in a CloudFormation delete event
- AWS Control Tower is deployed.
aws-security-reference-architecture-examples
repository is stored on your local machine or location where you will be deploying from.- Macie is not enabled in any of the accounts within the AWS Organization
- In the
management account (home region)
, launch the AWS CloudFormation Stack using the prereq-controltower-execution-role.yaml template file as the source, to implement theAWSControlTowerExecution
role pre-requisite.- Note: Only do this step, if the
AWSControlTowerExecution
IAM role doesn't already exist in the Control Towermanagement account
.
- Note: Only do this step, if the
- In the
management account (home region)
, launch the AWS CloudFormation StackSet targeting only themanagement account
in all of the enabled regions (include home region) prereq-lambda-s3-bucket.yaml template file as the source, to implement an S3 bucket that will store the Lambda Zip files. (Example Bucket Name:lambda-zips-<Management Account ID>-<AWS Region>
)- For additional guidance see CloudFormation StackSet Instructions
- Take note of the S3 Bucket Name from the CloudFormation Outputs, as you will need it for both the packaging step, and the Solution Deployment Order section.
- Note: Only do this step if you don't already have an S3 bucket to store the Lambda zip files for CloudFormation custom resources in the Control Tower
management account
.- Lambda functions can only access Zip files from an S3 bucket in the same AWS region as the where Lambda function resides.
- Although for this solution, S3 bucket is only needed in the
home region
, it is recommended to deploy the S3 bucket as a stackset, so that you can support future Lambda functions in other regions.
- Package the Lambda code into a zip file and upload it to the S3 bucket (from above step), using the Packaging script.
SRA_REPO
environment variable should point to the folder whereaws-security-reference-architecture-examples
repository is stored.BUCKET
environment variable should point to the S3 Bucket where the Lambda zip files are stored.- See CloudFormation Output from Step 2
- Or follow this syntax:
lambda-zips-<CONTROL-TOWER-MANAGEMENT-ACCOUNT>-<CONTROL-TOWER-HOME-REGION>
- Or follow this syntax:
# Example (assumes repository was downloaded to your home directory)
export SRA_REPO="$HOME"/aws-security-reference-architecture-examples
export BUCKET=sra-staging-123456789012-us-east-1
sh "$SRA_REPO"/aws_sra_examples/utils/packaging_scripts/package-lambda.sh \
--file_name macie-org.zip \
--bucket $BUCKET \
--src_dir "$SRA_REPO"/aws_sra_examples/solutions/macie/macie_org/lambda/src
# Export AWS CLI profile for the 'management account'
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_SESSION_TOKEN=
# Use template below and set the 'SRA_REPO' and 'BUCKET' with your values.
export SRA_REPO=
export BUCKET=
sh "$SRA_REPO"/aws_sra_examples/utils/packaging_scripts/package-lambda.sh \
--file_name macie-org.zip \
--bucket $BUCKET \
--src_dir "$SRA_REPO"/aws_sra_examples/solutions/macie/macie_org/lambda/src
- In the
management account (home region)
, launch an AWS CloudFormation Stack Set and deploy to theAudit account (home region)
using the sra-macie-org-configuration-role.yaml template file as the source. - In the
management account (home region)
, launch an AWS CloudFormation Stack Set and deploy to theAudit account (home region)
using the sra-macie-org-kms-key.yaml template file as the source. - In the
management account (home region)
, launch an AWS CloudFormation Stack Set and deploy to theLog archive account (home region)
using the sra-macie-org-s3-bucket.yaml template file as the source. - In the
management account (home region)
, launch an AWS CloudFormation Stack using the sra-macie-org-configuration.yaml template file as the source. - In the
management account (home region)
, launch an AWS CloudFormation Stack Set and deploy toAll active accounts (home region)
using the sra-macie-org-member-disable-role.yaml
- Log into the Management account and navigate to the Macie page
- Validate that the delegated admin account is set for each region
- Log into the Audit account and navigate to the Macie page
- Verify the correct Macie configurations have been applied to each region
- Verify all existing accounts have been enabled
- Verify the findings export is configured for the S3 bucket
- Generate sample findings to verify S3 delivery
- Log into the Log archive account and navigate to the S3 page
- Verify the sample findings have been delivered
- In the
management account (home region)
, delete the AWS CloudFormation Stack created in step 4 of the solution deployment. - In the
management account (home region)
, delete the AWS CloudFormation StackSet created in step 5 of the solution deployment. Note: there should not be anystack instances
associated with this StackSet. - In the
management account (home region)
, delete the AWS CloudFormation StackSet created in step 3 of the solution deployment. Note: there should not be anystack instances
associated with this StackSet.- In the
Log Archive account (home region)
, empty and delete the S3 bucket created in step 3
- In the
- In the
management account (home region)
, delete the AWS CloudFormation StackSet created in step 2 of the solution deployment. Note: there should not be anystack instances
associated with this StackSet. - In the
management account (home region)
, delete the AWS CloudFormation StackSet created in step 1 of the solution deployment. Note: there should not be anystack instances
associated with this StackSet. - In the
management account (home region)
, delete the AWS CloudWatch Log Group (e.g. /aws/lambda/<solution_name>) for the Lambda function deployed in step 4 of the solution deployment.
If you need to launch an AWS CloudFormation StackSet in the management account
, see below steps (for additional details, see
Create a stack set with self-managed permissions)
- AWS CloudFormation -> StackSets -> Create StackSet
- Choose a Template (upload template)
- Specify StackSet Details (enter parameter values)
- Configure StackSet Options -> Self-service permissions
- IAM Admin Role Name:
AWSControlTowerStackSetRole
- IAM Execution Role Name:
AWSControlTowerExecution
- IAM Admin Role Name:
- Set Deployment Options -> Deploy New Stacks
- Deploy Stacks in Accounts -> enter the AWS Control Tower Management Account ID
- Specify Regions: choose regions you want to deploy stacks too (include home region)
- If in future, you need to update the Stack Set (e.g., add/remove a region), see Getting Started with AWS CloudFormation StackSets