Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enforce External ID v2 format via iam-role module #25

Merged
merged 4 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ A Terraform Module for configuring an integration with Lacework and AWS for Clou
| sns\_topic\_arn | The SNS topic ARN. Usually in the form of: arn:aws:sns:<control-tower-region>:<aws\_audit\_account\_id>:aws-controltower-AllConfigNotifications | `string` | n/a | yes |
| cross\_account\_policy\_name | n/a | `string` | `""` | no |
| enable\_log\_file\_validation | Specifies whether cloudtrail log file integrity validation is enabled | `bool` | `false` | no |
| external\_id\_length | The length of the external ID to generate. Max length is 1224. Ignored when use\_existing\_iam\_role is set to true | `number` | `16` | no |
| iam\_role\_arn | The IAM role ARN is required when setting use\_existing\_iam\_role to true | `string` | `""` | no |
| iam\_role\_external\_id | The external ID configured inside the IAM role is required when setting use\_existing\_iam\_role to true | `string` | `""` | no |
| iam\_role\_name | The IAM role name. Required to match with iam\_role\_arn if use\_existing\_iam\_role is set to true | `string` | `""` | no |
Expand Down
3 changes: 1 addition & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,10 @@ module "lacework_ct_iam_role" {
aws = aws.log_archive
}
source = "lacework/iam-role/aws"
version = "~> 0.1"
version = "~> 0.4"
create = var.use_existing_iam_role ? false : true
iam_role_name = local.iam_role_name
lacework_aws_account_id = var.lacework_aws_account_id
external_id_length = var.external_id_length
tags = var.tags
}

Expand Down
2 changes: 2 additions & 0 deletions scripts/ci_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ write_aws_profiles() {
echo "[918733600796_AWSAdministratorAccess]" > ~/.aws/credentials
echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> ~/.aws/credentials
echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> ~/.aws/credentials
echo "aws_session_token = $AWS_SESSION_TOKEN" >> ~/.aws/credentials
echo "[287453222145_AWSAdministratorAccess]" >> ~/.aws/credentials
echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> ~/.aws/credentials
echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> ~/.aws/credentials
echo "aws_session_token = $AWS_SESSION_TOKEN" >> ~/.aws/credentials
chmod 600 ~/.aws/credentials
fi
}
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ variable "iam_role_external_id" {
variable "external_id_length" {
type = number
default = 16
description = "The length of the external ID to generate. Max length is 1224. Ignored when use_existing_iam_role is set to true"
description = "**Deprecated** - Will be removed on our next major release v1.0.0"
}

variable "prefix" {
Expand Down