devz-docz

Aggregation of onboarding and general devz standards that I have gatherd over my career.

View on GitHub

InfraSec / Project Teardown Guide

When a project reaches the end of its lifetime and the client doesn’t want to continue it, I need to teardown all the infrastructure I’ve created for the project – sometimes on relatively short notice. This guide is intended to provide a step-by-step procedure for tearing down infrastructure I’ve created for a project and highlight any potential sources of trouble.

Terraform and AWS

Your first task should be shutting down all the AWS infrastructure you’ve built for your project. When you do this, you’ll need to proceed in basically the reverse order you created all the resources. Here are some guidelines when tearing down Terraform namespaces:

SSL certificates

For most projects, I’ll hopefully be able to use AWS ACM certificates, and those will get torn down with my Terraform teardown above. However, if I’ve bought additional SSL certificates through another vendor, such as SSLMate, I should revoke those certificates and close that account as well.

gitlab

Once you’ve torn down your AWS infrastructure and CircleCI, you can shutdown your gitlab organization for the project. Here are the guidelines for taking down your gitlab organization:

1Password

Deleting your 1Password account and vault for the project should be the very last thing you do. This is (hopefully) where you’ve kept all your credentials for services, software, and accounts that this project uses, so getting rid of this makes it extremely difficult to clean up anything else you were using for your project. I recommend that you carefully review the previous steps of this guide and look at the credentials kept in 1Password to ensure that you’ve closed down everything else that you are relying on 1Password for.