Code Monkey home page Code Monkey logo

lemur-docker's Introduction

halianelf/lemur

Feel free to submit Pull Requests and report any Issues that you may have found.

Lemur + CFSSL

Lemur manages TLS certificate creation. While not able to issue certificates itself, Lemur acts as a broker between CAs and environments providing a central portal for developers to issue TLS certificates with 'sane' defaults.

CFSSL is CloudFlare's PKI/TLS swiss army knife. It is both a command line tool and an HTTP API server for signing, verifying, and bundling TLS certificates.

Usage

docker create \
  --name=lemur \
  -v <path to config>:/config \
  -v <path to data>:/data \
  -e PGID=<gid> -e PUID=<uid>  \
  -p 80:80 \
  halianelf/lemur

Parameters

The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container. So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 and http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.

  • -p 80 - The port(s)
  • -v /config - Mapping the config files for Lemur and CFSSL
  • -v /data - Mapping for the Postgres DB data
  • -e PGID Used for GroupID - see below for explanation
  • -e PUID Used for UserID - see below for explanation

User / Group Identifiers

Sometimes when using data volumes (-v flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user PUID and group PGID. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" โ„ข.

In this instance PUID=1001 and PGID=1001. To find yours use id user as below:

  $ id <dockeruser>
    uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)

Setting up the application

After the initial start up, there will be some template files in /config/cfssl. If you edit these and remove the .tmpl and then restart the container, it will generate the certificates with the information you put in. If you want to change the length of the intermediate certificate, change it in the root_to_intermediate_ca.json file.

CFSSL can't actually use any of the parameters for the certificate signing that you can set in Lemur (at least currently) so whatever is set as the default in cfssl_config.json is what it will use. The config that comes with this is a server certificate with a 3 year expiration. Feel free to edit this to fit your needs.

For Lemur, the config is in /config/lemur/lemur.conf.py. This file is mostly the default with some Digicert stuff added and the CFSSL config stuff added. Generating the certs with the template files like explained in the first paragraph will add them to the file as well. This file also can and should be editted to fit your needs. Read over the Lemur Docs for more information on settings and what you can do with this.

The Lemur web interface is accessible on whatever port you mapped for the container. The default credentials are lemur and password. This can be changed in the web interface after logging in. You will need to add CFSSL as an authority after you have your certs created. For more information on this take a look at the "Create certificates using CFSSL" section on here.

Building the Container

If you wish to build this yourself, you will need to pull CFSSL for the intermediate container.

Info

  • Shell access whilst the container is running: docker exec -it lemur /bin/bash
  • To monitor the logs of the container in realtime: docker logs -f lemur

lemur-docker's People

Contributors

halianelf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lemur-docker's Issues

ERROR: column "issued_at" of relation "certificates" does not exist at character 121

Hi,

I followed your instructions but when I try to create a certificate I get the above error.
Maybe you can help and point me in the right direction.

Regards,

Ronald

2021/01/17 23:13:42 [INFO] signature request received
2021/01/17 23:13:42 [INFO] signed certificate with serial number 245109129169722608011595148089762604743485473113
2021-01-17 23:13:42.353 UTC [367] ERROR: column "issued_at" of relation "certificates" does not exist at character 121
2021-01-17 23:13:42.353 UTC [367] STATEMENT:
INSERT INTO certificates (serial_number, authority_key_identifier, ca_label, status, reason, expiry, revoked_at, pem,
issued_at, not_before, metadata, sans, common_name)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8,
$9, $10, $11, $12, $13);
2021/01/17 23:13:42 [WARNING] failed to sign request: {"code":11000,"message":"pq: column "issued_at" of relation "certificates" does not exist"}
2021/01/17 23:13:42 [INFO] [::1]:54164 - "POST /api/v1/cfssl/sign" 11000
[2021-01-17 23:13:42,356] ERROR in service: {'message': 'Exception minting certificate', 'issuer': 'DCSL-ROOT-CA', 'cn': 'pacific-vcsa.dcsl.local'}
Traceback (most recent call last):

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.