- Notifications
You must be signed in to change notification settings - Fork31
Share sensitive info without leaving a trace in your chat logs or email accounts.
License
smallwat3r/shhh
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Keep secrets out of emails and chat logs.
Shhh is a tiny Flask app to create encrypted secrets and sharethem securely with people. The goal of this application is to get ridof plain text sensitive information into emails or chat logs.
Shhh is deployedhere (temporary unavailableuntil new deployment solution), butit's better for organisations and peopleto deploy it on their own personal / private server for even better security.You can find in this repo everything you need to host the app yourself.
Or you canone-click deploy to Heroku using the below button.It will generate a fully configured private instance of Shhhimmediately (using your own server running Flask behind Gunicorn and Nginx,and your own PostgreSQL database). You can see the Heroku configuration fileshere.
(seehere toinitiate the db tables after deploying on Heroku)
Also, checkoutshhh-cli,a Go client to interact with the Shhh API from the command line.
The sender has to set an expiration date along with a passphrase toprotect the information he wants to share.
A unique link is generated by Shhh that the sender can share with thereceiver in an email, alongside the temporary passphrase he createdin order to reveal the secret.
The secret will bepermanently removed from the database as soonas one of these events happens:
- the expiration date has passed.
- the receiver has decrypted the message.
- the amount of tries to open the secret has exceeded.
The secrets are encrypted in order to make the data anonymous,especially in the database, and the passphrases are not storedanywhere.
Encryption method used: Fernet with password, random salt value andstrong iteration count (100 000).
Tip: for better security, avoid writing any info on how/where to use the secret you're sharing (like urls, websites or emails). Instead, explain this in your email or chat, with the link and passphrase generated from Shhh. So even if someone got access to your secret, there is no way for the attacker to know how and where to use it.
Yes, you can find some dochere.
These instructions are for development purpose only. For productionuse you might want to use a more secure configuration.
The application will use the development env variables from/environments/dev-docker-postgres.env.
From the root of the repository, run
make dc-start# to start the appmake dc-start-adminer# to start the app with adminer (SQL editor)make dc-stop# to stop the app
Once the container image has finished building and has started, youcan access:
- Shhh athttp://localhost:8081
- Adminer athttp://localhost:8082 (if launched with
dc-start-adminer
)
You can find the development database credentials from the env file at/environments/dev-docker-postgres.env.
You have also the option to useMySQL
instead ofPostgreSQL
, using these commands:
make dc-start-mysql# to start the appmake dc-start-adminer-mysql# to start the app with adminer (SQL editor)make dc-stop-mysql# to stop the app
Run the migrations using:
make db c='upgrade'
If deployed on Heroku, you can run the migrations using:
heroku run --app=<heroku-app-name> python3 -m flask db upgrade
This will ensure the necessary tables are created and up-to-date in the database,and make sure your deployed Shhh application works as expected.
You can write a revision using:
make db c='revision "my revision"'
You can run tests and linting / security reports using the Makefile.
Make sure you havemake
,docker
,yarn
, and a version of Python 3.12 installed on your machine.
Tests, linting, security tools do not run from the Docker container, so you need to have a Pythonvirtual environment configured locally.
You can do so with the following command:
make venv deps
The following command will display all the commands available from the Makefile:
makehelp
Enter a Flask shell (from the running shhh container)
make shell
Run sanity checks
make tests# run testsmake ruff# run Ruff reportmake bandit# run Bandit reportmake mypy# run Mypy report
Run code formatter
make yapf# format code using Yapf
Generate frontend lockfile
make yarn# install the frontend deps using Yarn
Bellow is the list of environment variables used by Shhh.
FLASK_ENV
: the environment config to load (testing
,dev-local
,dev-docker
,heroku
,production
).DB_HOST
: Database hostnameDB_USER
: Database usernameDB_PASSWORD
: Database passwordDB_NAME
: Database nameDB_ENGINE
: Database engine to use (ex:postgresql+psycopg2
,mysql+pymysql
)
Depending if you can use PostgreSQL or MySQL you might also need to set (these need to match the valuesyou've specified asDB_NAME
,DB_PASSWORD
andDB_NAME
above):
POSTGRES_USER
: Postgresql usernamePOSTGRES_PASSWORD
: Postgresql passwordPOSTGRES_DB
: Postgresql database name
or
MYSQL_USER
: MySQL usernameMYSQL_PASSWORD
: MySQL passwordMYSQL_DATABASE
: MySQL database name
SHHH_HOST
: This variable can be used to specify a custom hostname to use as thedomain URL when Shhh creates a secret (ex:https://<domain-name.com>
). If not set, the hostnamedefaults to request.url_root, which should be fine in most cases.SHHH_SECRET_MAX_LENGTH
: This variable manages how long the secrets your share with Shhh canbe. It defaults to 250 characters.SHHH_DB_LIVENESS_RETRY_COUNT
: This variable manages the number of tries to reach the databasebefore performing a read or write operation. It could happens that the database is not reachable or isasleep (for instance this happens often on Heroku free plans). The default retry number is 5.SHHH_DB_LIVENESS_SLEEP_INTERVAL
: This variable manages the interval in seconds between the databaseliveness retries. The default value is 1 second.
SeeLICENSE file.
Please report issues or questionshere.
About
Share sensitive info without leaving a trace in your chat logs or email accounts.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.