Giter Site home page Giter Site logo

lucos_creds's Introduction

lucos_creds

A credential manager for lucos systems

Dependencies

  • docker
  • docker-compose

Build-time Dependencies

Running

docker compose up --build

Testing

Run go test ./src

CircleCI

For code coverage, run tests with: go test ./src -coverprofile=coverage.out Then, to view coverage report in browser, run: go tool cover -html=coverage.out

Backing Up

Copy the directory from the docker host at /var/lib/docker/volumes/lucos_creds_store/_data/

Usage

Setting or updating a credential

ssh -p 2202 creds.l42.eu ${system}/${environment}/${key}=${value}

  • system is the slug of the github repository for system which uses this credential
  • environment is the name of which environment being used (eg 'production' or 'development')
  • key is the key of the credential. Must be unique for the given system/environment combination. Gets normalised to all uppercase
  • value is the value of the credential.

Note: only value gets encrypted at rest. DO NOT place any sensitive data in the other fields

Creating or updating a linked credentials between systems

ssh -p 2202 creds.l42.eu "${clientsystem}/${clientenvironment} => ${serversystem}/${serverenvironment}"

  • clientsystem is the slug of the github repository for the system which will make requests with this credential
  • clientenvironment is the name of the environment requests are being made from (eg 'production' or 'development')
  • serversystem is the slug of the github repository for the system which will verify requests made with this credential
  • serverenvironment is the name of the environment requests are being made to (eg 'production' or 'development')

Note: DO NOT place any sensitive data in these fields

The credential itself will be a randomly generated alphanumeric string. For a given pair of serversystem/serverenvironment, multiple clientsystem/clientenvironments can be created. For a given pair of clientsystem/clientenvironment, each serversystem can only have ONE serverenvironment

The clientsystem will have its .env file return the credential with the key "KEY_${serversystem}". The serversystem will have its .env file return the credential in the key "CLIENT_KEYS", alongside any other clientsystems/clientenvironments which have a credential for that serversystem/serverenvironment combination.

Populate an envfile for local development

scp -P 2202 "creds.l42.eu:${PWD##*/}/development/.env" .

(Worth aliasing in .bashrc for convenience)

Populate as part of a deployment script to production

scp -s -P 2202 -o BatchMode=yes [email protected]:$CIRCLE_PROJECT_REPONAME/production/.env .

  • DEPLOY_USERNAME Set in personal circleci context docker (SSH key must be set up matching this user)
  • CIRCLE_PROJECT_REPONAME Set by circleci - the name of the repositoriy being deployed

References

lucos_creds's People

Contributors

lucas42 avatar dependabot[bot] avatar

Watchers

 avatar  avatar

lucos_creds's Issues

Ability to delete credential

It'd be nice to be able to remove a credential which is no longer needed (or was accidentally removed).

At the moment, the easiest thing to do is set the credential to an empty string. But the variable name still remains, cluttering up the .env file.

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.