Using Terraform to Integrate with Lacework in AWS Organization
Scope
Lacework, AWS
Solution
There are several ways to integrate Lacework with accounts in an AWS Organization. Lacework provides multiple Terraform modules for this purpose. In this post, we will focus on theaws_org_configurationmodule.
Integration:
The aws_org_configuration module offers seamless automation for integrating Lacework with AWS Configuration and CloudTrail. It simplifies the process by automatically configuring integration across the root account and all associated sub-accounts within the specified organizational unit (OU). Additionally, it creates an SNS topic and Lambda function, ensuring that any new AWS accounts added to the organization are seamlessly integrated with Lacework.
The module will perform the following tasks:
Create the CloudTrail integration at the root account level.
Create AWS Configuration integration for each of the sub-accounts. Note that this is not the same as the AWS Config service. Lacework does not rely on the native AWS Config service.
For Lacework to access configurations in the AWS sub-accounts, theaws_org_configurationmodule creates the necessary IAM roles inside those sub-accounts using CloudFormation templates. These IAM roles are assumed by Lacework to read the AWS configuration.
Usage:
Using the module is straightforward. Below is the basic configuration needed. It is highly recommended to use variables to pass secrets.