← history for Readme.md
35bda350Readme.md89 lines⬡ raw↓ download
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Config Vault (cfgvault)

Config Vault exposes a Rest interface to retrieve secrets from a KeePass keystore. 

## A Configuration Vault Service

[cfgvault](https://code.kevwe.com/cfgvault.git) is a minimalistic configuration vault for your application secrets.

## Quick Start

### Minimal Configuration File

Create the following example configuration file:

```
$ cat $HOME/.config/cfgvault/config.json
{
  "endpoint":"127.0.0.1:8080",
  "keystore":"/path/to/keystore.kdbx",
  "secretkey":"/path/to/secretkey.keyx"
}
```

this is the minimal configuration file needed to test cfgvault locally over http or behind a reverse proxy. 
The keystore and secretkey files must be created beforehand with KeePass or some compatible tool.

A proper configuration file for a production deployment should include TLS certificates and keys.

```
$ cat $HOME/.config/cfgvault/config.json
{
  "endpoint":"127.0.0.1:8433",
  "keystore":"/path/to/keystore.kdbx",
  "secretkey":"/path/to/secretkey.keyx",
  "server_tls_certificate":"/path/to/server.crt",
  "server_tls_key":"/path/to/server.key"
}
```

You can enable mutual TLS by providing a CA certificate to validate client certificates against, and switching mutual authentication on:

```
$ cat $HOME/.config/cfgvault/config.json
{
  "endpoint":"127.0.0.1:8433",
  "keystore":"/path/to/keystore.kdbx",
  "secretkey":"/path/to/secretkey.keyx",
  "server_tls_certificate":"/path/to/server.crt",
  "server_tls_key":"/path/to/server.key",
  "server_ca":"/path/to/ca.crt",
  "validate_client_cert":true
}
```


The application allows you also to specify an array of IP subnets that are allowed to connect to the service:
```
$ cat $HOME/.config/cfgvault/config.json
{
  "endpoint":"127.0.0.1:8080",
  "keystore":"/path/to/keystore.kdbx",
  "secretkey":"/path/to/secretkey.keyx",
  "server_tls_certificate":"/path/to/server.crt",
  "server_tls_key":"/path/to/server.key",
  "allowlist":["127.0.0.1/8","10.2.3.4/24"],
  "server_ca":"/path/to/ca.crt",
  "validate_client_cert":true
}
```
All IP addresses not in the allowlist will be rejected with a 403 Forbidden response.

### Building cfgvault

```bash
cd cfgvault
cargo build --release
```

### Running cfgvault

You can just run the executable:

```bash
$ ./target/release/cfgvault
```

## License

cfgvault is authored by [Paolo Lulli](https://lulli.net/about) 2026 and is publicly available under the Affero GPL license.