Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rosehgal/jackson
Pythonic way of keeping secrets secure in JSON
https://github.com/rosehgal/jackson
json-parser python secret-in-json secret-management
Last synced: 11 days ago
JSON representation
Pythonic way of keeping secrets secure in JSON
- Host: GitHub
- URL: https://github.com/rosehgal/jackson
- Owner: rosehgal
- License: apache-2.0
- Created: 2018-06-28T04:55:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T15:25:19.000Z (almost 4 years ago)
- Last Synced: 2024-03-01T07:24:01.168Z (8 months ago)
- Topics: json-parser, python, secret-in-json, secret-management
- Language: Python
- Size: 118 KB
- Stars: 18
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-json - J<sub>ack</sub>SON: JSON secret keeper - JSONic way of storing secrets in config file. (Format Extensions)
README
# JackSON
Have you ever used JSON as your config? Have you keep secrets in config as plain text, that you dont want to? Then this is the right tool for you.
**JackSON** is the simple and flexible file extension of JSON file types written in `python` (in less than 50 lines of code), this extension allows the users to keep their secrets in environment variables and pass the reference to those environment variables into the JSON file(jackson). The secrets in the environment variables will be read securely in to the in memory dict.The problem that it solves:
* Retrieve secrets from env variables.
* Retrieve secrets from remote/servers(HSMs).### How to JackSON
JackSON is exported as python package. You can install it via `pip`.
`pip install --user jackson`
```bash
export foo=10
export bar=100
```
Example JackSON config file.
```json
{
"_comment1": "Value from foo env variable",
"key1": "env.foo",
"_comment2": "Value from bar env variable",
"key2": "env.bar",
"_comment3": "Value from python module",
"key3": "!a.b",
"_comment4": "key/value pair similar to json",
"key4": "value4"
}
```
Inside the code.
```python3
import jackson
import json # For converting JackSON --> JSON
d = json.load(jackson.File.open("./config.jackson"))
print(d)
```
And this is how it looks.
```json
{
"key4": "value4",
"key3": "reached",
"key2": "100",
"key1": "10",
"_comment4": "key/value pair similar to json",
"_comment3": "Value from python module",
"_comment2": "Value from bar env variable",
"_comment1": "Value from foo env variable"
}
```
***
### Key Features:
* Reference to environment variables.
* Reference to the code, which will resolve to secret variable.
***
Pull requests are more than appreciated.