dotsec 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,63 @@
1
1
  # dotsec
2
2
 
3
- Secure dot env. Check back soon.
3
+ Secure dot env. Encrypts your .env so you can safely store it in your project.
4
+
5
+ ## Usage
6
+
7
+
8
+ Create a user managed AWS KMS key, add an alias. Refer to the AWS documentation for [creating keys](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) and [managing aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-manage.html#alias-create)
9
+
10
+ > the default key alias is set to `alias/top-secret`
11
+
12
+
13
+
14
+ ### Encrypting a `.env` file into a `.sec` file
15
+
16
+ ```sh
17
+ npx dotsec encrypt-env
18
+ ```
19
+
20
+ ### Decrypting a `.sec` file into a `.env` file
21
+
22
+ ```sh
23
+ npx dotsec decrypt-env
24
+ ```
25
+
26
+ ### Using a `.sec` file as environment variables
27
+
28
+ ```sh
29
+ npx dotsec node index.js
30
+ ```
31
+
32
+ ## Using json secrets
33
+
34
+ ### Encrypting a `secrets.json` file into a `secrets.encrypted.json` file
35
+
36
+
37
+ ```sh
38
+ npx dotsec encrypt-secrets-json
39
+ ```
40
+
41
+ ### Decrypting a `secrets.encrypted.json` file into a `secrets.json` file
42
+
43
+ ```sh
44
+ npx dotsec decrypt-secrets-json
45
+ ```
46
+
47
+ ### Offload a `secrets.encrypted.json` file to SSM
48
+
49
+ ```sh
50
+ npx dotsec offload-secrets-json-to-ssm
51
+ ```
52
+
53
+
54
+ ### FAQ
55
+
56
+ #### Is it safe to commit a `.sec` file alongside your code?
57
+
58
+ Yes it is. The encryption key is managed by AWS, as long as you audit which principals can encrypt and decrypt you're good.
59
+
60
+ #### Should I use this in production?
61
+
62
+ We do, however, since this package is relatively new, I don't think you should.
63
+