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

ALB deletion protection #542

Merged
merged 10 commits into from
Jan 18, 2024
Merged

Conversation

SammySteiner
Copy link
Contributor

Prevent ALB Deletion for security compliance

Resolves #161

Changes

Use the terraform.workspace name to determine if this is a test environment and therefore the alb should not get deletion protection, otherwise, enable deletion protection. Terratest prefixes workspaces it createst with "t-<unique_id>" therefore we should enable deletion protection for elbs in all workspaces that do not start with t-

Addresses:
ELB.6 check: NIST-800 53

@SammySteiner SammySteiner changed the title ELB deletion protection ALB deletion protection Jan 17, 2024
infra/app/service/main.tf Outdated Show resolved Hide resolved
@@ -7,11 +7,12 @@ BACKEND_CONFIG_FILE="dev.s3.tfbackend"

sed -i.bak 's/force_destroy = false/force_destroy = true/g' infra/modules/service/access-logs.tf
sed -i.bak 's/force_destroy = false/force_destroy = true/g' infra/modules/storage/main.tf
sed -i.bak 's/enable_deletion_protection = var.is_temp_environment/enable_deletion_protection = false/g' infra/modules/service/load-balancer.tf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you just copy pasted my snippet, but you have to make sure that the line you are replacing is the same as the actual line. looks like you named the variable is_temporary rather than is_temp_environment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

Copy link
Contributor

@lorenyu lorenyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Left some final nits/cleanup but feel free to merge on your own after you resolve those.

infra/modules/service/load-balancer.tf Outdated Show resolved Hide resolved
infra/app/service/outputs.tf Outdated Show resolved Hide resolved
infra/modules/service/variables.tf Outdated Show resolved Hide resolved
SammySteiner and others added 2 commits January 18, 2024 09:36
Co-authored-by: Loren Yu <loren@navapbc.com>
@SammySteiner SammySteiner merged commit a03da3b into main Jan 18, 2024
7 checks passed
@SammySteiner SammySteiner deleted the sammysteiner/161-elb-deletion-protection branch January 18, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent alb deletion for security compliance
2 participants