caddy-security icon indicating copy to clipboard operation
caddy-security copied to clipboard

consul backend as user data store

Open resmo opened this issue 3 years ago • 1 comments

A clear and concise description of what you want the system to do.

An idea has come to me.

The local user.json is nice and simple for smaller projects but doesn't quite meet the requirements

I've been thinking about a Hashiport Consul backend or even a Hashicorp Vault backend (which itself can use Consul as a backend) to store user data.

This would allow to benefit from Consul's HA and would make it easier to deploy Caddy Auth servers when we don't have to deal with volumes for local storage.

I wondered, how you think about it. As an inspiration, there is already a storage plugin for consul https://github.com/pteich/caddy-tlsconsul

What are the Caddyfile directives that need to be added.

Add Caddyfile directive:

{
  security {
    authentication portal myportal {
      registration {
         consul {
           address  "127.0.0.1:8500"
           token  "consul-access-token"
           timeout  10
           prefix  "myportal"
           value_prefix "portal_users"
           aes_key "consultls-1234567890-caddytls-32"
           tls_enabled  "false"
           tls_insecure "true"
        }
        title "User Registration"
        code "NY2020"
        require accept terms
        require domain mx
        admin email [email protected] [email protected]
      }
    }
  }
}

resmo avatar Feb 16 '22 22:02 resmo

An idea has come to me.

@resmo , it is a good idea 👍 In fact, I have been working on a prototype for the "universal" backend. Currently, I am focused on getting management UI (Angular) up and running. As part of that work, I will think through the APIs. That would make Consul integration possible.

greenpau avatar Feb 16 '22 23:02 greenpau