GithubHelp home page GithubHelp logo

fhofherr / acmeproxy Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 352 KB

acmeproxy as a proxy for ACME compliant certificate authorities

License: MIT License

Makefile 3.03% Go 95.68% Dockerfile 0.28% Shell 1.01%
acme acme-challenge golang letsencrypt

acmeproxy's People

Contributors

fhofherr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

acmeproxy's Issues

Perform HTTP-01 challenge

In order to retrieve certificates from Let's Encrypt acme-proxy needs to be able to perform an HTTP-01 challenge.

Resolve TODOs

During development some todos were added. Those need to be resolved before version 0.1.0 can be released. Todos can be resolved by either fixing them or by creating issues for them.

Make Acmeproxy ACME Account configurable

Currently acmeproxy uses arbitrary data to create an ACME account for itself:

* A random UUID is used as the account ID
* The domain is hard-coded to `www.example.com`
* The empty string is used as email for the ACME account

In order to be useful, the behavior has to be changed to the following:

  • Domain and Email have to be configurable. Either by using a configuration file / environment variables or by an admin interface.
  • If acmeproxy did not create an ACME account yet, it may continue to use a random UUID to create a new account. As soon as it created the account it must reuse it and thus check if there is already an UUID.

Note: the UUID is used to identify the account within acmeproxy only. It is of no use for the ACME CA.

Allow remote clients to use acmeproxy

After acmeproxy is able to perform an HTTP-01 challenge (#2) it has to be possible to configure which clients are allowed to use acmeproxy.

acmeproxy will obtain the certificates for its clients and store them locally. Additionally it provides a way for the clients to download their certificates once acmeproxy has obtained them.

Create package for certificate handling

Code to manage certificates starts to creep all over acmeproxy's packages. Quite a few packages need to create private keys for testing purposes. Others will need to parse and inspect or validate certificates.

Create a package cryptoutil (or a better name) which consolidates all that code. Additionally it should contain test helpers which are able to create private keys and are able to write them to test data files as well as read them from such files.

Select a default set of linters

GolangCI Lint constantly adds new linters. Neither are all necessary, nor do I agree with all of them. Enabling all linters is nice if one wants to see what is available, but gets tiring pretty soon. It is thus better to select a default set of linters and disable the others.

Obtain certificate for acmeproxy using the acme-client mode

Naturally acmeproxy has to encrypt its own communication. Therefore we have to obtain a certificate for the public instance of acmeproxy using the acme-client operation mode.

Implementation note:

Upon startup acmeproxy checks if it already has a certificate for itself. If not it uses the self-test endpoint (#7) to check if the DNS server already has been configured correctly. Then it tries to obtain a certificate for itself. If the self-test fails acmeproxy waits for an configurable amount of time and retries to obtain a certificate.

Store certificates issued to acmeproxy

After the ACME certificate authority issued a certificate we need to store it on disk. While we are just thinking about the acme-client operation mode it is enough to store it unencrypted.

We do not want to rely on an external database or similar to store certificates. Therefore there are two possibilities:

  1. Store certificates on disk
  2. Use an embedded key-value store like bbolt.

Document deployment of acmeproxy

Once acmeproxy is able to act as an acme-client users need to be able to use it as such. Therefore it is necessary to document how to deploy acmeproxy in such a way.

Backup acmeproxy data

acmeproxy stores certificates along with client accounts and settings. This data needs to be backed up.

Refresh stored certificates

Certificates retrieved by performing an HTTP-01 challenge and stored locally (#2) have to be refreshed periodically.

Start acmeproxy in server mode

acmeproxy server should start the server. Listenaddress an Port(s) have to be configurable by command line argument and environment variable.

Remove pkg/errors

Since we implemented our own errors package containing an custom error type using pkg/errors seems redundant.

Update ACME accounts

Clients of acmeproxy may want to change the email address they used to register. This is also the email address used to register an ACME account on their behalf. If clients change their email address with acmeproxy we must make sure that this email address is also changed in the respective ACME account.

Search for certificates to refresh

After #4 is implemented and acmeproxy is capable of refreshing a certificate we need to search for certificates to refresh. The search for certificates to refresh should ideally be triggered by an external event.

Create self-test endpoint

The instance of acmeproxy tries to resolve its own hostname using DNS and checks if it can reach this endpoint. This is to ensure that we don't perform an ACME challenge before the user has actually configured the DNS server.

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.