A Terraform Module to integrate Amazon Elastic Kubernetes Service (EKS) with Lacework.
Audit logging must be enabled on the cluster(s) which you wish to integrate. This can be done via the AWS CLI using the following command:
aws eks --region <region> update-cluster-config --name <cluster_name> \
--logging '{"clusterLogging":[{"types":["audit"],"enabled":true}]}'
- KMS key
- KMS key alias
- KMS ket policy
- SNS topic
- Topic policy
- S3 bucket
- S3 bucket notification
- S3 bucket server side encryption
- S3 bucket logging
- S3 bucket public access block
- Firehose
- Firehose IAM role & policy
- Cross account IAM role & policy
- Cloudwatch IAM role & policy
- Cloudwatch subscription filter
Name | Version |
---|---|
terraform | >= 0.15 |
aws | >= 5.0 |
lacework | ~> 2.0 |
random | >= 2.1 |
time | ~> 0.6 |
Name | Version |
---|---|
aws | >= 5.0 |
lacework | ~> 2.0 |
random | >= 2.1 |
time | ~> 0.6 |
Name | Source | Version |
---|---|---|
lacework_eks_audit_iam_role | lacework/iam-role/aws | ~> 0.4 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
access_log_prefix | Optional value to specify a key prefix for access log objects for logging S3 bucket | string |
"log/" |
no |
allow_debugging_permissions | To allow debugging permissions, set this parameter to true | bool |
false |
no |
bucket_arn | The S3 bucket ARN is required when setting use_existing_bucket to true | string |
"" |
no |
bucket_enable_mfa_delete | Set this to true to require MFA for object deletion (Requires versioning) |
bool |
false |
no |
bucket_encryption_enabled | Set this to true to enable encryption on a created S3 bucket |
bool |
true |
no |
bucket_force_destroy | Force destroy bucket (if disabled, terraform will not be able do destroy non-empty bucket) | bool |
true |
no |
bucket_key_arn | The ARN of the KMS encryption key to be used for S3 (Required when bucket_sse_algorithm is aws:kms and using an existing aws_kms_key) |
string |
"" |
no |
bucket_lifecycle_enabled | Set this to true to enable S3 buckets lifecycle configuration (incompatible with MFA delete) |
bool |
true |
no |
bucket_lifecycle_expiration_days | The lifetime, in days, of the bucket objects. The value must be a non-zero positive integer. | number |
180 |
no |
bucket_logs_disabled | Set this to true to disable access logging on a created S3 bucket |
bool |
false |
no |
bucket_sse_algorithm | The encryption algorithm to use for S3 bucket server-side encryption | string |
"aws:kms" |
no |
bucket_versioning_enabled | Set this to true to enable access versioning on a created S3 bucket |
bool |
true |
no |
cloudwatch_iam_role_arn | IAM role arn to use for the Cloudwatch filter if use_existing_cloudwatch_iam_role is set to true | string |
"" |
no |
cloudwatch_regions | A set of regions, to allow Cloudwatch Logs to be streamed from | list(string) |
n/a | yes |
cluster_names | A set of cluster names, to integrate with. Defaults to [] if no_cw_subscription_filter is set to true |
set(string) |
[] |
no |
external_id_length | Deprecated - Will be removed on our next major release v2.0.0 | number |
16 |
no |
filter_pattern | The Cloudwatch Log Subscription Filter pattern | string |
"{ $.stage = \"ResponseComplete\" && $.requestURI != \"/version\" && $.requestURI != \"/version?*\" && $.requestURI != \"/metrics\" && $.requestURI != \"/metrics?*\" && $.requestURI != \"/logs\" && $.requestURI != \"/logs?*\" && $.requestURI != \"/swagger*\" && $.requestURI != \"/livez*\" && $.requestURI != \"/readyz*\" && $.requestURI != \"/healthz*\" }" |
no |
firehose_iam_role_arn | IAM role arn to use for the Kinesis Firehose if use_existing_firehose_iam_role is set to true | string |
"" |
no |
iam_role_arn | IAM role arn to use for cross-account access if use_existing_cross_account_iam_role is set to true | string |
"" |
no |
iam_role_external_id | External ID for the cross-account IAM role if use_existing_cross_account_iam_role is set to true | string |
"" |
no |
integration_name | The name of the AWS EKS Audit Log integration in Lacework. | string |
"TF AWS EKS Audit Log" |
no |
kinesis_firehose_encryption_enabled | Set this to false to disable encryption on the Kinesis Firehose. Defaults to true |
bool |
true |
no |
kinesis_firehose_key_arn | The ARN of an existing KMS encryption key to be used for the Kinesis Firehose | string |
"" |
no |
kms_key_deletion_days | The waiting period, specified in number of days | number |
30 |
no |
kms_key_multi_region | Whether the KMS key is a multi-region or regional key | bool |
true |
no |
kms_key_rotation | Enable KMS automatic key rotation | bool |
true |
no |
lacework_aws_account_id | The Lacework AWS account that the IAM role will grant access | string |
"434813966438" |
no |
log_bucket_name | Name of the S3 bucket for access logs. Is required when setting use_existing_access_log_bucket to true |
string |
"" |
no |
no_cw_subscription_filter | Set to true to create an integration with no Cloudwatch Subscription filter for your cluster(s) | bool |
false |
no |
prefix | The prefix that will be use at the beginning of every generated resource | string |
"lw-eks-al" |
no |
sns_topic_encryption_enabled | Set this to false to disable encryption on the sns topic. Defaults to true |
bool |
true |
no |
sns_topic_key_arn | The ARN of an existing KMS encryption key to be used for the SNS topic | string |
"" |
no |
tags | A map/dictionary of Tags to be assigned to created resources | map(string) |
{} |
no |
use_existing_access_log_bucket | Set this to true to use an existing bucket for access logging. Default behavior creates a new access log bucket if logging is enabled |
bool |
false |
no |
use_existing_bucket | Set this to true to use an existing bucket for the logs. Default behavior creates a new log bucket |
bool |
false |
no |
use_existing_cloudwatch_iam_role | Set this to true to use an existing IAM role for the Cloudwatch subscription filter | bool |
false |
no |
use_existing_cross_account_iam_role | Set this to true to use an existing IAM role for cross-account access | bool |
false |
no |
use_existing_firehose_iam_role | Set this to true to use an existing IAM role for the Kinesis Firehose | bool |
false |
no |
wait_time | Amount of time between setting up AWS resources, and creating the Lacework integration. | string |
"20s" |
no |
Name | Description |
---|---|
bucket_arn | Lacework AWS EKS Audit Log S3 Bucket ARN |
bucket_name | Lacework AWS EKS Audit Log S3 Bucket name |
cloudwatch_iam_role_arn | The Cloudwatch IAM Role ARN |
cloudwatch_iam_role_name | The Cloudwatch IAM Role name |
cross_account_iam_role_arn | The Cross Account IAM Role ARN |
cross_account_iam_role_name | The Cross Account IAM Role name |
external_id | The External ID configured into the IAM role |
filter_pattern | The Cloudwatch Log Subscription Filter pattern |
filter_prefix | The Cloudwatch Log Subscription filter prefix |
firehose_arn | The Firehose delivery stream ARN |
firehose_iam_role_arn | The Firehose IAM Role ARN |
firehose_iam_role_name | The Firehose IAM Role name |
sns_arn | SNS Topic ARN |
sns_name | SNS Topic name |