No description
| backend | ||
| frontend | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| configure.sh | ||
| prepare.sql | ||
| README.md | ||
secrets-vault
Secrets vault is a project for self hosted vault access
Principle
Baiscally, the project will work like so :
- Connect to the website, using credentials
- Enter the vault phrase, which should be different from the password
- Get your secrets
Encryption
The idea for encryption is :
- Passwords are stored in hashed form
- The vault phrase is absolutely not stored anywhere
- The vault phrase is not transferred through http request, and lives only locally. It decrypts whatever the API sends. If the vault phrase does not match, it is still decrypted, but it will probably not be the expected result.
Usage
You will need few tools to build the project :
- Node.JS with yarn if you want to use the configure script
- Rustup (with cargo)
- MariaDB, or any database service. This project uses MySQL
- Git
It is recommended to have a daemon to automatically launch the server
Setup
- Create a database in your database service ; I will call it secrets_vault
- Create a local user with all permissions on this database, with a password ; Mine will be guardian
- Get the port where the database server lives, usually 3306
- Fill the
.envfile (at the root of the project), with this :
DATABASE_URL=mysql://user:password@host/databasename
So it gives something like this for me : mysql://guardian:123456@localhost/secrets_vault
- Create the tables for MySQL (the backend won't compile otherwise)
- Copy the content of prepare.sql
- mariadb -u username -p and then enter password
> use database_name;- Paste the content of the file
> exit;
- Configure the url ; go in
frontend/App.tsx, find the lineapi_base_url: "http://127.47.47.1:30003",, and replace the url by the actual url
Installation
You can either run the install script, or do it by hand
Automatic configuration
- Clone the repo :
git clone https://github.com/Greensky-gs/secrets-vault && cd secrets-vault - If you have yarn installed, you can use the
./configure.shscript :./configure.sh - Launch using
./target/release/backend
Manual installation
- Get the repo :
git clone https://github.com/Greensky-gs/secrets-vault && cd secrets-vault
Build the front end
- Go to frontend :
cd frontend - Install dependencies :
yarn install, or your favorite packages manager for nodejs - Build the static files :
yarn build(ornpm run build) - Optionnaly delete the node_modules
rm -rf node_modules
Leave the
buildfolder where it is
Setup the backend
- Create the binary with
cargo build --release