Skip to content

Commit e8f169e

Browse files
milldrosterman
andauthored
feat: Decide on Secrets Placement for Terraform (#702)
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
1 parent 4d39a03 commit e8f169e

File tree

2 files changed

+63
-5
lines changed

2 files changed

+63
-5
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: "Decide on Secrets Placement for Terraform"
3+
sidebar_label: "Secrets Placement"
4+
sidebar_position: 5
5+
refarch_id: REFARCH-81
6+
description: "Decide where to store secrets used by Terraform"
7+
---
8+
import Intro from '@site/src/components/Intro';
9+
10+
<Intro>
11+
We need to decide where to store secrets used by Terraform. We have two options: store secrets in each account or store them in a centralized account.
12+
</Intro>
13+
14+
## Context
15+
16+
Often we need to integrate with third-party services or internal services that require API keys or other secrets. We need to decide where to store these secrets so that Terraform can access them. There are two reasonable options for storing secrets in our AWS account architecture. We need to decide which one to use.
17+
18+
### Option 1: Store Secrets in each account
19+
20+
The first option is to store the credential in the same account as the resource. For example, API keys scoped to `dev` would live in `plat-dev`.
21+
22+
#### Pros
23+
24+
- Accounts can easily access their given credentials
25+
- IAM level boundaries are enforced between accounts
26+
27+
#### Cons
28+
29+
- Secret administrators need to access many accounts to create those secrets
30+
- There is no centralized management for all secrets out there
31+
32+
### Option 2: Store Credentials in a Centralized Account
33+
34+
The second option is to store the credentials in a centralized account, such as `corp` or `auto`. Now you would need to share those credentials with each account, for example with [AWS RAM](https://aws.amazon.com/ram/).
35+
36+
#### Pros
37+
38+
- Centralized secrets management
39+
- Secret administrators have a single place to manage secrets
40+
- Once shared, resources in a given account still access their given secrets from their own account. They do not need to reach out to another account
41+
42+
#### Cons
43+
44+
- Complexity with AWS RAM
45+
- Secret administrators must be careful to share secrets with the correct accounts
46+
- You need to decide what account to use as the centralized management account. We could deploy `corp` if you'd like for this or reuse `auto`.
47+
48+
## Decision
49+
50+
We will use AWS SSM Parameter Store for all platform-level secrets used by `infrastructure` and `terraform`.
51+
52+
## Related
53+
54+
- [Decide on Secrets Strategy for Terraform](/layers/project/design-decisions/decide-on-secrets-management-strategy-for-terraform/)
55+

docs/layers/project/design-decisions/decide-on-secrets-management-strategy-for-terraform.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: "Decide on Secrets Management Strategy for Terraform"
33
sidebar_label: "Secrets Management"
44
sidebar_position: 5
55
refarch_id: REFARCH-81
6-
description: "Decide where to manage secrets used by Terraform"
6+
description: "Decide how to manage secrets used by Terraform"
77
---
88
import Intro from '@site/src/components/Intro';
99
import KeyPoints from '@site/src/components/KeyPoints';
1010

1111
<Intro>
12-
Deciding where to store secrets is crucial for securing both platform integration and application data when using Terraform. The appropriate secret store depends on the stack layer and must account for situations where other infrastructure might not yet be in place (e.g. Vault, Kubernetes, etc).
12+
Deciding how to store secrets is crucial for securing both platform integration and application data when using Terraform. The appropriate secret store depends on the stack layer and must account for situations where other infrastructure might not yet be in place (e.g. Vault, Kubernetes, etc).
1313
</Intro>
1414

1515
We need to decide where secrets will be kept. We’ll need to be able to securely store platform integration secrets (e.g. master keys for RDS, HashiCorp Vault unseal keys, etc) as well as application secrets (any secure customer data).
@@ -20,10 +20,13 @@ like ASM/SSM is required.
2020
- e.g. Vault deployed as helm chart in each tenant environment using KMS keys for automatic unsealing (this chart
2121
already exists)
2222

23-
- SSM Parameter Store + KMS for all platform-level secrets used by `infrastructure` and `terraform`
23+
- SSM Parameter Store + KMS for all platform-level secrets used by `infrastructure` and Terraform
2424

25-
- AWS Secrets Manager supports automatic key rotation which almost nothing other than RDS supports and requires
26-
applications to be modified in order to use it to the full extent.
25+
- AWS Secrets Manager supports automatic key rotation which almost nothing other than RDS supports and requires applications to be modified in order to use it to the full extent.
26+
27+
## Recommendation
28+
29+
We will use AWS SSM Parameter Store for all platform-level secrets used by `infrastructure` and Terraform.
2730

2831
## Related
2932

0 commit comments

Comments
 (0)