1
- # Secrets
1
+ # Secrets in a workspace
2
2
3
3
<blockquote class =" info " >
4
4
This article explains how to use secrets in a workspace. To authenticate the
5
- workspace provisioner, see <a href =" /admin/auth " >this </a >.
5
+ workspace provisioner, see the article on <a href =" /admin/auth " >Authentication </a >.
6
6
</blockquote >
7
7
8
8
Coder is open-minded about how you get your secrets into your workspaces.
9
+ This means you can continue to use the same workflow and tools you already use to manage secrets locally in your Coder workspace.
9
10
10
- ## Wait a minute...
11
-
12
- Your first stab at secrets with Coder should be your local method. You can do
13
- everything you can locally and more with your Coder workspace, so whatever
14
- workflow and tools you already use to manage secrets may be brought over.
15
-
16
- Often, this workflow is simply:
11
+ Usually this workflow looks like,
17
12
18
13
1 . Give your users their secrets in advance
19
14
1 . Your users write them to a persistent file after they've built their
20
15
workspace
21
-
22
- [ Template parameters] ( ./templates/parameters.md ) are a dangerous way to accept
23
- secrets. We show parameters in cleartext around the product. Assume anyone with
16
+
17
+ <blockquote class =" warning " >
18
+ Its strongly recommended that you do not use <a href =" ./templates/parameters.md " >template parameters</a > to accept
19
+ secrets. Parameters are shown in cleartext in Coder. Assume anyone with
24
20
view access to a workspace can also see its parameters.
21
+ </blockquote >
25
22
26
23
## SSH Keys
27
24
@@ -30,13 +27,13 @@ authentication mechanism for git providers or other tools. Within workspaces,
30
27
git will attempt to use this key within workspaces via the ` $GIT_SSH_COMMAND `
31
28
environment variable.
32
29
30
+ SSH keys are never stored in Coder workspaces, and are fetched only when
31
+ SSH is invoked. The keys are held in-memory and never written to disk.
32
+
33
33
Users can view their public key in their account settings:
34
34
35
35
![ SSH keys in account settings] ( ./images/ssh-keys.png )
36
36
37
- > Note: SSH keys are never stored in Coder workspaces, and are fetched only when
38
- > SSH is invoked. The keys are held in-memory and never written to disk.
39
-
40
37
## Dynamic Secrets
41
38
42
39
Dynamic secrets are attached to the workspace lifecycle and automatically
@@ -47,7 +44,7 @@ This method is limited to
47
44
[ services with Terraform providers] ( https://registry.terraform.io/browse/providers ) ,
48
45
which excludes obscure API providers.
49
46
50
- Dynamic secrets can be implemented in your template code like so :
47
+ Add dynamic secrets into your template code using the following :
51
48
52
49
``` hcl
53
50
resource "twilio_iam_api_key" "api_key" {
@@ -65,8 +62,8 @@ resource "coder_agent" "main" {
65
62
```
66
63
67
64
A catch-all variation of this approach is dynamically provisioning a cloud
68
- service account (e.g
69
- [ GCP] ( https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_service_account_key#private_key ) )
65
+ service account, for example
66
+ [ GCP] ( https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_service_account_key#private_key ) ,
70
67
for each workspace and then making the relevant secrets available via the
71
68
cloud's secret management system.
72
69
0 commit comments