SHA256
1
0
forked from pool/dehydrated
Go to file
Daniel Molkentin abdad1b762 Accepting request 882188 from home:darix:playground
- Enable instantiated services (boo#1184165)

- Prepare instantiated service/timer support but not enable it:
  This seems to fail due to missing systemd support right now.
  So the only option at the moment is to copy the timer and unit
  file for a 2nd instance. Mark all files as part of dehydrated.target

- Rework support for /etc/dehydrated/postrun-hooks.d/:
  dehydrated.service nolonger starts them directly, the support was
  moved to a separate unit file. Please run:
  systemctl enable dehydrated-postrun-hooks.service
  to restore this functionality
- Run dehydrated as dehydrated user again

OBS-URL: https://build.opensuse.org/request/show/882188
OBS-URL: https://build.opensuse.org/package/show/security:dehydrated/dehydrated?expand=0&rev=74
2021-03-30 14:53:39 +00:00
.gitattributes Accepting request 441496 from security 2017-01-27 10:00:22 +00:00
.gitignore Accepting request 441496 from security 2017-01-27 10:00:22 +00:00
acme-challenge.conf.apache.in - dehydrated-apache2: Check for mod_compat (bsc#1178927) 2020-11-19 11:29:46 +00:00
acme-challenge.conf.nginx.in Accepting request 459171 from home:danimo:branches:security:dehydrated 2017-02-21 12:11:20 +00:00
dehydrated-0.7.0.tar.gz - Update to dehydrated 0.7.0 2020-12-10 16:05:04 +00:00
dehydrated-0.7.0.tar.gz.asc - Update to dehydrated 0.7.0 2020-12-10 16:05:04 +00:00
dehydrated-postrun-hooks.service Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated-postrun-hooks@.service Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated-rpmlintrc - Removed lighttpd 1.x integration package. If you still would like 2020-05-06 15:00:46 +00:00
dehydrated.changes Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated.cron.in Accepting request 534175 from home:dmolkentin:branches:security:dehydrated 2017-10-17 02:03:39 +00:00
dehydrated.keyring Accepting request 564525 from home:dmolkentin:branches:security:dehydrated 2018-01-15 11:59:16 +00:00
dehydrated.service Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated.spec Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated.target Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated.timer Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated.tmpfiles.d Accepting request 455792 from security:dehydrated 2017-02-13 06:49:05 +00:00
dehydrated@.service Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
dehydrated@.timer Accepting request 882188 from home:darix:playground 2021-03-30 14:53:39 +00:00
more-examples.patch Accepting request 882014 from home:darix:playground 2021-03-29 16:26:11 +00:00
README.Fedora Accepting request 528993 from home:dmolkentin:branches:security:dehydrated 2017-09-27 16:31:31 +00:00
README.hooks Accepting request 531761 from home:dmolkentin:branches:security:dehydrated 2017-10-06 10:52:01 +00:00
README.maintainer Be more precise concerning EC compatiblity 2021-03-03 17:23:27 +00:00

==========================================
Acquiring TLS Certificates with Dehydrated
==========================================

The dehydrated package has been designed to make acquiring TLS
certificates (aka SSL Certificates) as simple as possible, while still being
useful in a broad amount of use cases. Please consult the dehydrated man page,
then continue reading here.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

IMPORTANT: On systemd-based systems, you need to enable the update
timer, which has obsoleted the cron job. This is independent on which method
you chose from below!

# systemctl enable dehydrated.timer

Also note that with the systemd timer, failures will not be mailed to the
system administrator, but are being logged to the systemd journal, as per
systemd's design philosophy.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Acquisition through HTTP (http-01)
===================================

This is the primary method of acquiring certifictes. The Certificate Authority
will provide a challenge that the requestor needs to provide via HTTP on port 80/TCP,
in /.well-known/acme-challenge/.

Setting up the acme-challenge auto-responder
--------------------------------------------

Apache (easiest)
~~~~~~~~~~~~~~~~

If you are using Apache, just install dehydrated-apache2 and reload Apache.
This will take care of setting up the acme-challenge auto-responder.

nginx
~~~~~

(not part of SLE, use openSUSE backports)

For nginx, you will need to install dehydrated-nginx. Unfortunately, nginx does
not support directory mappings across vhosts, so in addition you will need to
include "/etc/nginx/acmechallenge" in all vhost configurations like this:

server {
    listen       80;
    listen       [::]:80;
    server_name  <hostname>;
    include "acmechallenge";
    location / {
        return 301 https://$host$request_uri;
    }
}

lighttpd
~~~~~~~~

(not part of SLE, use openSUSE backports)

Lighttpd users can use the following snippet:

  server.modules += ("mod_alias")
  alias.url += (
     "/.well-known/acme-challenge/" => "/var/lib/acme-challenge/",
  )

NOTE: Never set up the SSL vhosts until you have initially acquired the first
host. Specifying an SSL vhost without certificates constitutes an error for web
servers.

NOTE: The dehydrated-lighttpd package has been removed. Please use the
snippet above.

Machines without a webserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On machines that are not running any web server, e.g. mail relays, you can run
apache2 with dehydrated-apache2. If you do not want to run any web server on a
system with systemd permnently, you can use dehydrated-acmeresponder. This is a
small socket activated server. Once installed, it will automatically listen on
port 80 whenever the dehydrated cron job seeks renewal, assuming no other
server is currently occupying the port. It will also shut down once the timer
has finished execution.

Acquisition of initial certificate
----------------------------------

How set up an account as described in the man page (as root):

# dehydrated --register --accept-terms

(the current version of the LetsEncrypt Terms & Conditions are referenced in
/etc/dehydrated/config)

Next, fill in domains.txt and acquire the initial certificates (again, as root):

# echo "myhost.example.com myalias.example.com" >> domains.txt
# dehydrated --cron

adds myhost.example.com to the list of host names we want to request a certificate for.
The certificate will hold a Subject Alternative Name of "myalias.example.com".
LetsEncrypt will check both host names.

NOTE: As of 2017, LetsEncrypt certificates are only valid for three months, and
the validity period may be further reduced in the future.  It is therefore
vital to ensure that the certificates are being automatically renewed. On
systems without systemd, a cron job is automatically set up to take care of
this. On systemd-enabled systems, a timer is provided which needs to be
activated manually:

# systemctl enable dehydrated.timer

Aqcuisition through DNS (dns-01)
================================

This is mostly useful under these conditions

1. Your hosts are not directly exposed to the internet
2. Your host names are part of a public DNS zone visible on the internet.
3. You are comfortable with the service adding and removing records in your domain.

Usually, the scenario you want this is a central host which picks up
certificates for all other hosts on a network, and then deploys them to the
actual target host, using plain scp or configuration management tools like
Ansible or Salt. For details, please refer to dns-verification.md. For
openSUSE, the python-dns-lexicon package provides hooks into many DNS providers
and DNS servers.

Proceeding after initial certificate aquisition
===============================================

Setting up the SSL host
-----------------------

As recommended parameters shift, please refer to Mozillas excellent SSL
Configuration Generator [1] for details on how to configure your web server.
Replace the example paths with the following:

Key: /etc/dehydrated/certs/<domainname>/privkey.pem
Certificate: /etc/dehydrated/certs/<domainname>/cert.pem
Intermediate Chain: /etc/dehydrated/certs/<domainname>/chain.pem
Certificate + Intermediate: /etc/dehydrated/certs/<domainname>/fullchain.pem

where <domainname> should be the name of the first column in domains.txt

Limitations & Ceveats
=====================

* No EV- or OV-validated certificates
* Certificates expire within weeks, not years. This is by design. Ensure that
  certificate renewal works and that daemons get reloaded frequently to pick
  up certificate updates. Apache will work due to log rotation SIGHUP'ing
  the process frequently. However, any other actions, such as service reloads
  need to be provided as a script in /etc/dehydrated/postrun-hooks.d, which
  will be executed by the cron script / systemd timer *after* an update run
  has been performed.

Upgrade Notes
=============

v0.7.0
------

Key Algorithm
~~~~~~~~~~~~~

If you are upgrading from dehydrated <= 0.6.5, the new default for
new installations changes from

    KEY_ALGO=rsa

to

    KEY_ALGO=secp384r1

This switches the algorithm for newly issued certificates from RSA
to the elliptic curve (EC) based secp384r1 algorithm. While both are
considered sufficiently compatible to current software in public
environments and SUSE supports EC even in SLES 12, some 3rd party software
and/or appliances may still not yet be compatible with EC algorithms.
In these environments, the KEY_ALGO setting needs to be set to "rsa"
manually. If you are receiving errors about an invalid key length,
comment out the KEYSIZE option.

Extended use of the CA variable / New ACME providers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Starting with 0.7.0, dehydrated supports additional, commercial certificate
providers that use the ACME protocol to automatically issue certificates.

The CA config variable, which so far expected a URL to a ACME API endpoint can
now contain the following shorthand service strings instead, which are
internally converted to the API URLs and hence are equivalent:

* LetsEncrypt: "letsencrypt" (staging environment: "letsencrypt-test")
* BuyPass: "buypass" (test environment: "buypass-test")
* ZeroSSL: "zerossl"

LetsEncrypt remains the default provider. If you prefer to use the URL instead,
you can continue to do so.

Note: ZeroSSL requires additional the options EAB_KID and EAB_HMAC_KEY to be
set. Please consult the ZeroSSL documentation fore more information.

ACME v1 deprecation
~~~~~~~~~~~~~~~~~~~

The upstream project has deprecated ACME v1 in favor of the IETF-
blessed [1] ACME v2 protocol. While dehydrated still supports v1-based
verification flows, future versions might no longer do. If you are using a
custom ACME endpoint URL, you can check compliance with the ACME v2 protocol by
consulting your ACME service provider's documentation. Verify by setting API=2
in the config file and then running "dehydrated --cron".

[1] https://tools.ietf.org/html/rfc8555

v0.3.1
------

If you are upgrading from letsencrypt.sh, note that you need to move
/etc/letsencrypt.sh to /etc/dehydrated and chown it to the "dehydrated"
user.

Links
=====

[1] https://mozilla.github.io/server-side-tls/ssl-config-generator/