Skip to content

Commit f0d3241

Browse files
Update README.md
1 parent fce2374 commit f0d3241

File tree

1 file changed

+54
-8
lines changed

1 file changed

+54
-8
lines changed

README.md

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,84 @@ Vault-cli is a project to have a light-weight, secure and multi-tenant solution
1919
# Environments
2020
Security is key in the project. You can create separate environments for your projects or customers. All environments use unique encryption keys, which are never stored in the database and are only available to the customer.
2121

22-
The MasterAdmin token can create an Environment. As a response to this call an EnvironmentAdmin token is returned once. This type of token can be used to create ReadWrite or ReadOnly tokens. Read the section [Tokens](#Tokens) for more detailed view of the different token types.
23-
2422
# Tokens
25-
There are 4 types of tokens, each having its own purpose.
23+
There are 3 types of tokens, each having its own purpose. The token received from the
2624

2725
| | EnvironmentAdmin | ReadWrite | ReadOnly |
2826
|----------------------------------|---------------------|--------------|--------------|
29-
| Create ReadWrite/ReadOnly token || | |
27+
| Manage tokens || | |
3028
| Manage secrets | || |
3129
| Get decrypted secret | |||
3230

3331

32+
The initial token received when a Secure Vault via the Previder Portal is created is of the type EnvironmentAdmin. This type of token can be used to manage ReadWrite or ReadOnly tokens, but not secrets.
33+
An additional token of the type EnvironmentAdmin can also be created. Use the following command to create a token of type EnvironmentAdmin.
34+
35+
```shell
36+
./vault-cli -t <insert-token> token create --description "EnvironmentAdmin token" --type EnvironmentAdmin
37+
```
38+
3439
# Getting started
3540
Vault-cli is a stand-alone binary to use with the Vault API.
3641

3742
To see all usages, run
3843
```shell
3944
./vault-cli --help
4045
```
46+
To use the more securely, set the token as an environment variable.
47+
```shell
48+
export VAULT_TOKEN="insert-token"
49+
./vault-cli secret decode <yoursecret>
50+
```
51+
52+
To create a ReadWrite token using the EnvironmentAdmin token, run the following command:
53+
```shell
54+
./vault-cli token create --description "ReadWrite token" --type ReadWrite
55+
```
56+
57+
A ReadWrite type token can create, list, get, delete and decrypt secrets.
58+
59+
To create a ReadOnly token for use in a cluster, run the following command:
60+
```shell
61+
./vault-cli token create --description "ReadOnly token" --type ReadOnly
62+
```
4163

42-
## Token
43-
Use the token directly from the command-line or define the VAULT_TOKEN environment variable.
64+
A ReadOnly type token can only decrypt secrets of which an id or name are known. This type cannot manage secrets.
4465

4566
## Usage example
4667
```shell
47-
./vault-cli -t <insert-token> secret list
68+
./vault-cli secret list
4869
```
4970
Will print all secrets in the Vault environment
5071

72+
### List all tokens (only available to EnvironmentAdmin type tokens)
73+
```shell
74+
./vault-cli token list
75+
```
76+
77+
### List all secrets (only available to ReadWrite type tokens)
78+
```shell
79+
./vault-cli secret list
80+
```
81+
82+
### Create a secret (only available to ReadWrite type tokens)
83+
```shell
84+
./vault-cli secret create --description "Example secret" --secret "SuperSecurePassword"
85+
```
86+
87+
### Delete a secret (only available to ReadWrite type tokens)
88+
```shell
89+
./vault-cli secret delete <id or description of the secret>
90+
```
91+
92+
### Decrypt a secret (only available to ReadWrite and ReadOnly type tokens)
93+
```shell
94+
./vault-cli secret decrypt <id or description of the secret>
95+
```
96+
5197
```shell
5298
export VAULT_TOKEN="insert-token"
53-
./vault-cli secret decode <yoursecret>
99+
./vault-cli secret decrypt <yoursecret>
54100
```
55101
To get the decrypted secret back to use in an application.
56102

0 commit comments

Comments
 (0)