Simple TUI for Defining and Constraining Environment Variables
Project description
Securenv
Overview
Seucrenv is a TUI-based application for securely setting environment variables in a constrained fashion. Instead of setting default passwords in env files or hoping that users set good passwords, Securenv allows you to define complexity requirements for ENV variables before your application is even started!
Installation
You can install Securenv via pip:
pip install securenv
After installation, you should now have a command securenv
.
Metadata File
To run securenv
, you'll need to define a metadata file that defines the ENV variables to set, and their respective attributes such as sensitivity and complexity.
Below is an example metadata file:
- var_group:
title: OpenSearch Application Variables
vars:
- var:
name: OPENSEARCH_USERNAME
placeholder: "admin"
sensitive: false
complexity:
max_length: 15
- var:
name: OPENSEARCH_PASSWORD
sensitive: true
placeholder: "password"
complexity:
max_length: 20
min_length: 10
numbers: 3
symbols: 1
uppercase: 1
- var_group:
title: Redis Variables
vars:
- var:
name: REDIS_USERNAME
placeholder: "admin"
sensitive: false
complexity:
max_length: 15
- var:
name: REDIS_PASSWORD
sensitive: true
placeholder: "password"
complexity:
max_length: 20
min_length: 10
- var_group:
title: MLFlow Variables
vars:
- var:
name: MLFLOW_USERNAME
placeholder: "admin"
sensitive: false
complexity:
max_length: 15
- var:
name: MLFLOW_PASSWORD
sensitive: true
placeholder: "password"
complexity:
max_length: 20
min_length: 10
The required metadata file needs to be a valid YAML list of var_group
's. A var_group
in Securenv is simply a grouping of related enviornment variables, typically a username and password for a single application. Each of these groups must have a title
key and at least one var
key. The title
representing the name of the var group, i.e., MLFLow Variables
.
Each var
needs to conform to the following schema:
Key | Description | Type | Required |
---|---|---|---|
name | Variable Name | str | True |
sensitive | Whether the variable should be obfuscated during runtime | bool | True |
placeholder | Placeholder in Input Widget for variable | str | True |
complexity | Complexity requirements for variable | dict | False |
max_length | Maximum length for variable | int | False |
min_length | Minimum length for variable | int | False |
numbers | Minimum required digits for variable | int | False |
symbols | Minimum required symbols for variable | int | False |
uppercase | Minimum required uppercase letters for variable | int | False |
This metadata schema will be checked at runtime for errors.
Running
With a metadata file defined, simply run Securenv like so:
securenv metadata.yaml .env
After filling out all the variables according to the defined requirements, the env file that is specified will either be updated or created with the defined environment variables!
Contributing
This is a small project created by one developer. Please feel free to submit feature request or report issues, and I'll do my best to implement them. Open to open-source contributions as well!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file securenv-0.0.5.tar.gz
.
File metadata
- Download URL: securenv-0.0.5.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7031c801a0eec941996e1a6f9606dd56acaf673e5cef71b55cb3eab3dd22ae55 |
|
MD5 | c805423832317e83b937082eafdaaa1b |
|
BLAKE2b-256 | cb5a24faa3f45c822072fe1bb57a3f4f85c4e59e513a0ef8e4d23a5a471f8a47 |
File details
Details for the file securenv-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: securenv-0.0.5-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d40f93c6f9284b9514792681306b085f392a5678a402e340a9807503ecd3a9 |
|
MD5 | 86bd23bc061d028000cd88c8c18a6b12 |
|
BLAKE2b-256 | 586e34e414335b9487b5e18d9906915e04361e4a5dac6818a373d9704ff23085 |