Create an EKS Audit Log Integration Manually
tip
You must enable audit logging on the clusters that you want to integrate.
To complete the integration, you must:
- Create an integration in the Lacework Console.
- Instrument each EKS cluster for the EKS integration created in Step 1.
- Enable EKS logs
- Integrate EKS clusters
Prerequisite
Audit logging must be enabled on the clusters that you want to integrate. You can do this via the AWS CLI using the following command:
aws eks --region <region> update-cluster-config --name <cluster_name> \
--logging '{"clusterLogging":[{"types":["audit"],"enabled":true}]}'
Navigate to EKS Audit Log Integration
- Log in to the Lacework Console.
- Go to Settings > Integrations > Cloud accounts.
- Click + Add New.
- Click Amazon Web Services and select EKS Audit Log.
- Click Next.
- Click Manual Configuration.
- Follow the steps in the next section.
Create an Integration in the Lacework Console
Ensure you have completed the preparatory steps described in AWS Integration Prerequisites.
- For Name, enter a unique name that displays in the Lacework Console.
- For External ID, enter the AWS external ID that is associated with the cross-account role that Lacework uses to access your AWS resource.
- For Role ARN, enter the ARN of the cross-account role that Lacework uses to access your AWS resources.
- For SNS ARN, enter the ARN of the topic that Lacework uses to communicate with your AWS resources.
- Click Save to finish the AWS integration and save your onboarding progress.
Instrument EKS Clusters
Instrument each EKS cluster for the EKS integration you just created.
Enable EKS Logs
Ensure audit logging is enabled on the clusters that you want to integrate.
For more information, go to Amazon EKS control plane logging.
Integrate EKS Clusters
After enabling audit logging, follow these steps:
- In the Lacework Console, go to Settings > Integrations > Cloud accounts.
- Click the EKS Audit Log integration.
- Click Run CloudFormation script. If you are already logged in to your AWS account, this redirects you to the Specify template page.
- Review the Specify template page and click Next. The Lacework script populates the Amazon S3 URL for you.
- On the Specify stack details page, provide the EKSClusterName. The script populates the FirehoseARN. If desired, update the ResourceNamePrefix if desired. When finished, click Next.
- On the Configure stack options page, click Next.
- Verify the information on the Review page and click Create stack.
note
If you have multiple AWS accounts with distributed ownership, you may want to use the Download CloudFormation script option instead.
- In the Lacework Console, go to Settings > Integrations > Cloud accounts.
- Click the EKS Audit Log integration.
- Click Download CloudFormation script.
- Log in to your AWS account if you are not already logged in.
- Select the CloudFormation service and click Create stack.
- For Template source, click Upload a template file.
- Upload the Lacework CloudFormation script and click Next.
- On the Specify stack details page, provide the EKSClusterName. The script populates the FirehoseARN. If desired, update the ResourceNamePrefix. When finished, click Next.
- On the Configure stack options page, click Next.
- Verify the information on the Review page and click Create stack.
Verify the Integration is Set Up
To verify logs are flowing from the CloudWatch log group to the S3 bucket, look for objects created in the S3 bucket under the prefix eks_audit_logs/<aws-account-id>/
.
To verify SNS notifications for the creation of S3 objects:
- Create an email subscription on the SNS topic and ensure you confirm the subscription by clicking the link sent to your inbox. Every time a log is written, you should receive an email with the key details.
- Logs are created every 5 minutes.