Giter VIP home page Giter VIP logo

secrets's Introduction

Safe Secrets - safe(r) and easy way to transfer passwords

Build Status Go Report Card Coverage Status Docker Automated build

The primary use-case is sharing sensitive data by making the information self-destructed, accessible only once and protected by easy-to-share PIN code. I just needed a simple and better alternative to the most popular way of passing passwords, which is why this project was created. Doing this by email always made me concerned about the usual "security" of sending user and password info in two different emails - which is just a joke.

Usage

It runs on safesecret.info for real. Feel free to use it if you are crazy enough to trust me, or just run your own from prepared docker image. And of course, you can build from sources as well.

Create a safesecret link to your message by entering 3 things:

  • Content of your secret message
  • Expiration time of your secret message
  • Secret PIN

This will give you a link which you can send by email, chat or share by using any other means. As soon as your recipient opens the link they will be asked for the secret PIN and see your secret message. The PIN is (typically) numeric and easy to pass by a voice call or text message. Each link can be opened only once and the number of attempts to enter a wrong PIN is limited to 3 times by default.

ScreenShot

How safe is this thing

  • It doesn't keep your original message or PIN anywhere, but encrypts your message with PIN (hashed as well)
  • It doesn't keep any sensitive info in any logs
  • It doesn't keep anything on a disk in any form (in case of default engine)
  • As soon as a message is read or expired it will be deleted and destroyed permanently
  • In order to steal your message, bad guys would need access to your link as well as PIN code

Feel free to suggest any other ways to make the process safer.

Installation

  1. Download docker-compose.yml and secrets-nginx.conf
  2. Adjust your local docker-compose.yml with:
    • TZ - your local time zone
    • SIGN_KEY - something long and random
    • MAX_EXPIRE - maximum lifetime period, default 24h
    • PIN_SIZE - size (in characters) of the pin, default 5
    • PIN_ATTEMPTS - maximum number of failed attempts to enter pin, default 3
  3. Setup SSL:
    • The system can make valid certificates for you automatically with integrated nginx-le. Just set:
    • In case you have your own certificates, copy them to etc/ssl and set:
      • SSL_CERT - SSL certificate (file name, not path)
      • SSL_KEY - SSL key (file name, not path)
  4. Run the system with docker-compose up -d. This will download a prepared image from docker hub and start all components.
  5. if you want to build it from sources - docker-compose build will do it, and then docker-compose up -d.

See docker-compose.yml for more details

Technical details

Safesecret usually deployed via docker-compose and has two containers in:

  • application secrets container providing both backend (API) and frontend (UI)
  • nginx-le container with nginx proxy and let's encrypt SSL support

Application container is fully functional without nginx proxy and can be used in stand-alone mode. You may want such setup in case you run safesecret behind different proxy, i.e. haproxy, AWS ELB/ALB and so on.

Integrations

  • Raycast Extension - quickly share any text with Safesecret from Raycast
  • Shortcut - a shortcut for Shortcuts app on Apple platforms. Adds integration with Safesecret to Share menu on iOS and to Share menu and Services menu on macOS

API

Safesecret provides trivial REST to save and load messages.

Save message

POST /api/v1/message, body - {"message":"some top secret info", "exp": 120, "pin": "12345"}

  • exp expire in N seconds
  • pin fixed-size pin code
        $ http POST https://safesecret.info/api/v1/message pin=12345 message=testtest-12345678 exp:=1000
    
        HTTP/1.1 201 Created
    
        {
            "exp": "2016-06-25T13:33:45.11847278-05:00",
            "key": "f1acfe04-277f-4016-518d-16c312ab84b5"
        }
    

Load message

GET /api/v1/message/:key/:pin

```
    $ http GET https://safesecret.info/api/v1/message/6ceab760-3059-4a52-5670-649509b128fc/12345

    HTTP/1.1 200 OK

    {
        "key": "6ceab760-3059-4a52-5670-649509b128fc",
        "message": "testtest-12345678"
    }
```

ping

GET /api/v1/ping

```
$ http https://safesecret.info/api/v1/ping

HTTP/1.1 200 OK

pong
```

Get params

GET /api/v1/params

```
$ http https://safesecret.info/api/v1/params

HTTP/1.1 200 OK

{
    "max_exp_sec": 86400,
    "max_pin_attempts": 3,
    "pin_size": 5
}
```

secrets's People

Contributors

dependabot[bot] avatar melonamin avatar oneils avatar paaashka avatar paskal avatar rapkin avatar umputun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

secrets's Issues

Replace separate UI with the embedded HTMX based

The current state of ui is not ideal:

  • The original author is not supporting it anymore, and not much help from the community with this part
  • No good reason for such complexity, and all we need are a few slightly dynamic pages
  • The "wizard" style UI is not needed; we just want a simple screen allowing to set pin, expiration, and text on the same page

The bottom line: htmx and serving UI directly from the service will simplify things greatly

modernize backend and frontend

I'd like to update backend's dependencies, switch to go.mod and simplify the build process with github actions. At the same time, it would be nice to update the frontend the same way.

@igoradamenko I have created a branch modern to work on this. If you have a moment could you pls take a look? For some reason one of the frontend dependencies not available of failed. Not sure what exactly the issue but docker build . fails with

npm ERR! code 128
npm ERR! Command failed: /usr/bin/git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed
npm ERR! fatal: reference is not a tree: 6d71a658c61edb3090221579d8f97dbe086ba2ed
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-02-19T06_07_17_133Z-debug.log

Npm issue with the current alpine

Looks like npm moved away from nodejs-lts to some other package. Lack of npm breaking your part of the build. Could you pls take a look.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.