caucase


Namecaucase JSON
Version 0.9.15 PyPI version JSON
download
home_pagehttps://lab.nexedi.com/nexedi/caucase
SummaryCertificate Authority.
upload_time2023-05-19 02:03:08
maintainer
docs_urlNone
authorVincent Pelletier
requires_python
licenseGPLv3+ with wide exception for FOSS
keywords certificate authority
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ..  Note to the editor: beware of implicit inline
    targets aliasing, keep global title different from all commands

=============================================================================
caucase - Certificate Authority for Users, Certificate Authority for SErvices
=============================================================================

Overview
========

The goal of caucase is to automate certificate issuance and renewal without
constraining how the certificate will be used.

For example, there is no assumption that the certificate will be used to
secure HTTP, nor to serve anything at all: you may need certificates to
authenticate users, or sign your mails, or secure an SQL server socket.

As an unfortunate consequence, it is not possible for caucase to automatically
validate a signing request content against a service (ex: as one could check
the certificate for an HTTPS service was requested by someone with the ability
to make it serve a special file).

This also means that, while caucase imposes RFC-recommended constraints on many
certificate fields and extensions to be worthy of trust, it imposes no
constraint at all on subject and alternate subject certificate fields.

To still allow certificates to be used, caucase uses itself to authenticate
users (humans or otherwise) who implement the validation procedure: they tell
caucase what certificates to emit. Once done, any certificate can be
prolonged at a simple request of the key holder while the to-renew
certificate is still valid (not expired, not revoked).

Bootstrapping the system (creating the first service certificate for
`caucased`_ to operate on HTTPS, and creating the first user certificate to
control further certificate issuance) works by caucase automatically signing a
set number of certificates upon submission.

Vocabulary
==========

Caucase manipulates the following asymmetric cryptography concepts.

- Key pair: A private key and corresponding public key. The public key can be
  derived from the private key, but not the other way around. As a consequence,
  the private key is itself considered to be a key pair.

- Certificate: A certificate is the assurante, by a certificate authority,
  that a given public key and set of attributes belong to an authorised entity.
  Abbreviated cert or crt. A certificate is by definition signed by a CA.

- Certificate Authority: An entry, arbitrarily trusted (but worthy of trust by
  its actions and decision) which can issue certificates. Abbreviated CA.

- Certificate signing request: A document produced by an entity desiring to get
  certified, which they send to a certificate authority. The certificate signing
  request contains the public key and desired set of attributes that the CA
  should pronounce itself on. The CA has all liberty to issue a different set
  of attributes, or to not issue a certificate.

- Certificate revocation list: Lists the certificates which were issued by a CA
  but which should not be trusted anymore. This can happen for a variety of
  reasons: the private key was compromised, or its owning entity should not be
  trusted anymore (ex: entity's permission to access to protected service was
  revoked).

- PEM: A serialisation mechanism commonly used for various cryptographic data
  pieces. It relies on base64 so it is 7-bits-safe (unlike DER), and is very
  commonly supported. Caucase exclusively uses PEM format.

Validity period
===============

Cryptographic keys wear out as are used and as they age.

Of course, they do not bit-rot nor become thinner with use. But each time one
uses a key and each minute an attacker had access to a public key, fractions
of the private key bits are inevitably leaked, weakening it overall.

So keys must be renewed periodically to preserve intended security level. So
there is a limited life span to each certificate, including the ones emitted by
caucase.

The unit duration for caucase-emitted certificates is the "normal" certificate
life span. It default to 93 days from the moment the certificate was signed,
or about 3 months.

Then the CA certificate has a default life span of 4 "normal" certificate
validity periods. As CA renewal happens in caucase without x509-level cross
signing (by decision, to avoid relying on intermediate CA support on
certificate presenter side and instead rely on more widespread
multi-CA-certificate support on verifier side), there is a hard lower bound of
3 validity periods, under which the CA certificate cannot be reliably renewed
without risking certificate validation issues for emitted "normal"
certificates. CA certificate renewal is composed of 2 phases:

- Passive distribution phase: current CA certificate has a remaining life span
  of less than 2 "normal" certificate life spans: a new CA certificate is
  generated and distributed on-demand (on "normal" certificate renewal and
  issuance, on CRL retrieval with caucase tools...), but not used to sign
  anything.
- Active use phase: new CA certificate is valid for more than one "normal"
  certificate life span. This means that all existing certificates which are
  still in active use had to be renewed at least once since the new CA
  certificate exists. This means all the certificate holders had the
  opportunity to learn about the new CA certificate. So the new CA certificate
  starts being used to sign new certificates, and the old CA certificate falls
  out of use as its signed "normal" certificates expire.

By default, all caucase tools will generate a new private key unrelated to the
previous one on each certificate renewal.

Lastly, there is another limited validity period, although not for the same
reasons: the list of revoked certificates also has a maximum life span. In
caucase, the CRL is re-generated whenever it is requested and:

- there is no previous CRL
- previous CRL expired
- any revocation happened since previous CRL was created

Here is an illustration of the certificate and CA certificate renewal process::

  Time from first caucased start:
    +--------+--------+--------+--------+--------+--------+--------+-->
  Certificate 1 validity:      |                 |                 |
    |[cert 1v1]  [cert 1v3]  [cert 1v5]  [cert 1v7]  [cert 1v9]  [ce...
    |      [cert 1v2]  [cert 1v4]  [cert 1v6]  [cert 1v8]  [cert 1vA]
  Certificate 2 validity:      |                 |                 |
    |    [cert 2v1]  [cert 2v3]| [cert 2v5]  [cert 2v7]  [cert 2v9]|
    |          [cert 2v2]  [cert 2v4]  [cert 2v6]| [cert 2v8]  [cert...
  CA certificates validity:    |                 |                 |
    [ca v1                     |        ]        |                 |
    |                 [ca v2   |                 |        ]        |
    |                          |        [ca v3   |                 |...
    |                          |                 |        [ca v4   |...
  CRL validity for CA1:        |                 |                 |
    [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][  ]        |                 |
  CRL validity for CA2:        |                 |                 |
    |                 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][  ]        |
  CRL validity for CA3:        |                 |                 |
    |                          |        [ ][ ][ ][ ][ ][ ][ ][ ][ ][...
  CA renewal phase:            |                 |                 |
    |none             |passive |active  |passive |active  |passive |...
  Active CA:                   |                 |                 |
    [ca v1                    ][ca v2           ][ca v3            |...
  Trust anchor:                |                 |                 |
    [ca v1                     |       ][ca v2   |       ][ca v3   |...

Legend::

  +--------+ : One certificate validity period (default: 93 days)

Points of interest:

- this illustration assumes no revocation happen
- there usually are 2 simultaneously-valid CA certificates
- there usually are 2 simultaneously-valid CRLs overall, one per CA certificate
- the first ``cert 1`` signed by CA v2 is ``cert 1v6``
- the first ``cert 2`` signed by CA v2 is ``cert 1v5``

Commands
========

Caucase provides several commands to work with certificates.

caucase
+++++++

Reference caucase "one-shot" client.

This command is intended to be used for isolated actions:

- listing and signing pending certificate signature requests

- revoking certificates

It is also able to submit certificate signing requests, retrieve signed
certificates, requesting certificate renewals and updating both
CA certificates and revocation lists, but you may be interested in using
`caucase-updater`_ for this instead.

caucase-updater
+++++++++++++++

Reference caucase certificate renewal daemon.

Monitors a key pair, corresponding CA certificate and CRL, and renew them
before expiration.

When the key-pair lacks a signed certificate, issues a pre-existing CSR to
caucase server and waits for the certificate to be issued.

caucase-probe
+++++++++++++

Caucase server availability tester.

Performs minimal checks to verify a caucase server is available at given URL.

caucase-rerequest
+++++++++++++++++

Utility allowing to re-issue a CSR using a locally-generated private key.

Intended to be used in conjunction with `caucase-updater`_ when user cannot
generate the CSR on the system where the certificate is desired (ex: automated
HTTPS server deployment), where user is not the intended audience for
caucase-produced certificate:

- User generates a CSR on their own system, and signs it with any key (it will
  not be needed later
- User sends the CSR to the system where the certificate is desired
- User gets caucase-rerequest to run on this CSR, producing a new private key
  and a CSR similar to issued one, but signed with this new private key
- From then on, caucase-updater can take over

This way, no private key left their original system, and user could still
freely customise certificate extensions.

caucase-key-id
++++++++++++++

Utility displaying the identifier of given key, or the identifier of keys
involved in given backup file.

Allows identifying users which hold a private key candidate for restoring a
caucased backup (see `Restoration procedure`_).

caucased
++++++++

Reference caucase server daemon.

This daemon provides access to both CAU and CAS services over both HTTP and
HTTPS.

It handles its own certificate issuance and renewal, so there is no need to use
`caucase-updater`_ for this service.

CORS
----

caucased implements CORS protection: when receiving a cross-origin request,
it will respond with 401 Unauthorized, with the WWW-Authenticate header set to
a custom scheme ("cors") with an "url" parameter containing an URI template
with one variable field: "return" (more on it later).

Upon receiving this response, the application is expected to render the URL
template and redirect the user to resulting URL. There, the user will be
informed of the cross-origin access attempt, and offered the choice to grant or
deny access to given origin.

Once their decision is made, their browser will receive a cookie remembering
this decision, and they will be redirected to the URL received in the "return"
field received upon above-described redirection.

Then, the application should retry the original request, which will be
accompanied by that cookie.

Backups
-------

Loosing the CA private key prevents issuing any new certificate trusted by
services which trusted the CA. Also, it prevents issuing any new CRL.
Recovering from such total loss requires starting a new CA and rolling it out
to all services which used the previous one. This is very time-costly.

So backups are required.

On the other hand, if someone gets their hand on the CA private key, they can
issue certificates for themselves, allowing them to authenticate with services
trusting the CA managed by caucase - including caucased itself if they issue a
user certificate: they can then revoke existing certificates and cause a lot of
damage.

So backups cannot happen in clear text, they must be encrypted.

But the danger of encrypted backups is that by definition they become worthless
if they cannot be decrypted. So as many (trusted) entities as possible should
be granted the ability to decrypt the backups.

The solution proposed by caucased is to encrypt produced backups in a way which
allows any of the caucase users to decrypt the archive.

As these users are already entrusted with issuing certificates, this puts
only a little more power in their hands than they already have. The little
extra power they get is that by having unrestricted access to the CA private
key they can issue certificates bypassing all caucase restrictions. The
proposed parade is to only make the backups available to a limited subset of
caucase users when there is an actual disaster, and otherwise keep it out of
their reach. This mechanism is not handled by caucase.

As there are few trusted users, caucase can keep their still-valid certificates
in its database for the duration of their validity with minimal size cost.

Backup procedure
----------------

Backups happen periodically as long as caucased is running. See
`--backup-period` and `--backup-directory`.

As discussed above, produced files should be kept out of reach of caucase
users until a disaster happens.

Restoration procedure
---------------------

See `caucased-manage --restore-backup`.

To restore, one of the trusted users must voluntarily compromise their own
private key, providing it to the administrator in charge of the restoration
procedure. Restoration procedure will hence immediately revoke their
certificate. They must also provide a CSR generated with a different private
key, so that caucase can provide them with a new certificate, so they keep
their access only via different credentials.

- admin identifies the list of keys which can decipher a backup, and broadcasts
  that list to key holders

- key holders manifest themselves

- admin picks a key holder, requests them to provide their existing private key
  and to generate a new key and accompanying CSR

- key holder provide requested items

- admin initiates restoration with `--restore-backup` and provides key holder
  with replacement certificate

- admin starts caucased, service is back online.

Backup file format
------------------

- 64bits: 'caucase\0' magic string

- 32bits LE: header length

- header: json-encoded header (see below)

- encrypted byte stream (aka payload)

Header schema (inspired from s/mime, but s/mime tools available do not
support at least iterative production or iterative generation)::

  {
    "description": "Caucase backup header",
    "required": ["algorithm", "key_list"],
    "properties": {
      "cipher": {
        "description": "Symetric ciher used for payload",
        "required": ["name"],
        "properties": {
          "name":
            "enum": ["aes256_cbc_pkcs7_hmac_10M_sha256"],
            "type": "string"
          },
          "parameter": {
            "description": "Name-dependend clear cipher parameter (ex: IV)",
            "type": "string"
          }
        }
        "type": "object"
      },
      "key_list": {
        "description": "Content key, encrypted with public keys",
        "minItems": 1,
        "items": {
          "required": ["id", "cipher", "key"],
          "properties": {
            "id": {
              "description": "Hex-encoded sha1 hash of the public key",
              "type": "string"
            },
            "cipher": {
              "description": "Asymetric cipher used for symetric key",
              "required": ["name"],
              "properties": {
                "name": {
                  "enum": ["rsa_oaep_sha1_mgf1_sha1"],
                  "type": "string"
                }
              },
              "type": "object"
            }
            "key": {
              "description": "Hex-encoded encrypted concatenation of signing and symetric encryption keys",
              "type": "string"
            }
          },
          "type": "object"
        },
        "type": "array"
      }
    },
    "type": "object"
  }

0.9.15 (2023-05-19)
===================
* Fix support for recent (at least >= 40.0.2) cryptography versions

0.9.14 (2022-11-07)
===================
* Janitorial: make updated code checkers happier.
* Explicitly depend on ipaddress module on python 2.7 .
* Be less sensitive to small client/server time disagreements.
* Fix crashes when encountering broken symlinks in directories of PEM files.

0.9.13 (2021-12-22)
===================
* Improve behaviour on computers which are frequently suspended. This should avoid missing certificate renewal deadlines.
* Fix test support for recent pyca.cryptography, which dropped support for >28bits OIDs. This means there is now no upgrade path for CAs which used the 128bits UUID arc.
* Improve tests stability.

0.9.12 (2021-10-20)
===================
* Fix caucase-updater crashes after a local trust anchor CA expires.

0.9.11 (2021-10-07)
===================
* Drop reliance on install-time 2to3 for py3 compatibility. Now the source is directly compatible with 2.7 and 3.x .

0.9.10 (2021-04-07)
===================
* Properly handle present but expired CA certificates.
* Properly handle CRLs whose CA certificate is missing.
* Add caucase.client.CaucaseClient.close method.

0.9.9 (2021-03-02)
==================
* Add AuthorityKeyIdentifier extension in CRLs.
* Accept user certificates signed by non-current CA.
* Name CA certificates after their AuthorityKeyIdentifier keyid extension instead of their serial.
* Produce one CRL per CA certificate, as some ssl-using services fail when there is no CRL signed by the same CA as the certificate being validated.
* Fix trust anchor distribution during CA renewal period: the correct trust anchor is the oldest still-valid CA.

0.9.8 (2020-06-29)
==================
* Add support for python3.
* Add support for one-CA-cert-per-file layout. For services which do not support loading multiple CA certificates from a single file.
* Fix caucase.sh authenticated usage (was broken by 0.9.4 "Make caucased https CA certificate safer").
* Avoid busy-loop in caucase-updater when it thinks a renewal is due but caucased does not offer a newer version.
* Fix tests timeouts on slower machined. Anything faster than a Raspberry Pi 1 should now pass.

0.9.7 (2020-06-04)
==================
* Fix CRL renewal:
  * teach caucased to renew CRLs ahead of their expirations.
  * make caucase-updater check CRL expiration date.
* Grant extra permissions in license.

0.9.6 (2019-05-27)
==================
* Do not use a 128bits OID arc for caucase internal use, as it is not widely supported.
* Assorted CLI usability improvements.

0.9.5 (2019-01-24)
==================
* Add --version support.
* Logging is reworked to reduce verbosity (especially in tests).
* Fix caucased sometimes crashing when renewing its https certificate.
* Make caucased logs more apache-like.
* Make caucased responses more standard-compliant ("Allow" header in 405 response and "Date" header in all responses).
* Fix unintended dependency on system timezone.

0.9.4 (2018-11-14)
==================
* Improved documentation.
* Tentative web-friendliness (not used in real life yet, so practicality is still uncertain):
  * Make caucased https CA certificate safer for adding in a trust store (ex: browser) by constraining the certificates it can sign.
  * cookie-based CORS access control with crude UI.
  * API is self-documenting using application/hal+json format.
* Tentative python3 friendliness, there may still be file IO encoding issues.

0.9.3 (2018-09-21)
==================
* Add support for listening to multiple specific addresses in caucased.
* shell implementation does not rely on an external file anymore.
* Do not start listening on https port before wrapping sockets with an ssl context
* Make caucase-updater usable by anonymous services (ex: they only need to connect to a caucase-certified service, without authenticating themselves using caucase)
* Use stricter file permissions for caucased sqlite database.
* Include caucase version in user agent header.
* Make caucased logging format more similar to apache's default.
* Fix caucased https certificate renewal. Fixes a crash which happens every 2 months.
* Make caucase-updater retry on network errors. Fixes crashes on transient network error.

0.9.2 (2017-11-03)
==================
* Add support for migrating an existing CA to caucase: import CA cert and CRLs.
* Require CRL signature checks (bumps cryptography module version requirements).
* Provide CRL distribution point extension in CA certificates.
* Play nicer with http:
  * Catch more errors to provide nice status codes
  * Add support for "Transfer-Encoding: chunked"
  * Add support for "Expect: 100-continue"
* Produce TLS-compliant certificates (domain name must be in an alternative name extension, subject is not enough).
* Reduce speed requirements in tests.
* Add shell implementation of "caucase" command.
* Certificate renewal bypasses pending CSR limits.
* caucase-manage: new command for offline database maintenance.

0.9.1 (2017-09-21)
==================
* Documentation improvements
* Packaging improvements

0.9.0 (2017-08-02)
==================
* implement the "cau" half of "caucase"
* massive rework: removal of flask dependency, removal of HTML UI, rework of
  the REST API, rework of the CLI tools, rework of the WGSI application,
  incomatible redesign of the database.

0.1.4 (2017-07-21)
==================
* caucase web parameter 'auto-sign-csr-amount' can be used to set how many csr must be signed automatically.

0.1.3 (2017-06-30)
==================

* add support for backup caucase database to cli
* serial is a random unique formatted hexadecimal number get from the csr_id
* allow to set custom subject (X509Name) when signing a certificate
* add new cliweb command which when required will download/update crl file from caucase web

0.1.2 (2017-05-12)
==================
* cliweb: renew now takes threshold option to check if renew is required and optional on-renew script to run after certificate renewal

0.1.1 (2017-04-27)
==================

 * initial implementation of certificate authority


            

Raw data

            {
    "_id": null,
    "home_page": "https://lab.nexedi.com/nexedi/caucase",
    "name": "caucase",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "certificate authority",
    "author": "Vincent Pelletier",
    "author_email": "vincent@nexedi.com",
    "download_url": "https://files.pythonhosted.org/packages/3f/ea/e8f7be2622b0a93f9292d7e245631da5e235e75b2012151fcfc7e97107a7/caucase-0.9.15.tar.gz",
    "platform": null,
    "description": "..  Note to the editor: beware of implicit inline\n    targets aliasing, keep global title different from all commands\n\n=============================================================================\ncaucase - Certificate Authority for Users, Certificate Authority for SErvices\n=============================================================================\n\nOverview\n========\n\nThe goal of caucase is to automate certificate issuance and renewal without\nconstraining how the certificate will be used.\n\nFor example, there is no assumption that the certificate will be used to\nsecure HTTP, nor to serve anything at all: you may need certificates to\nauthenticate users, or sign your mails, or secure an SQL server socket.\n\nAs an unfortunate consequence, it is not possible for caucase to automatically\nvalidate a signing request content against a service (ex: as one could check\nthe certificate for an HTTPS service was requested by someone with the ability\nto make it serve a special file).\n\nThis also means that, while caucase imposes RFC-recommended constraints on many\ncertificate fields and extensions to be worthy of trust, it imposes no\nconstraint at all on subject and alternate subject certificate fields.\n\nTo still allow certificates to be used, caucase uses itself to authenticate\nusers (humans or otherwise) who implement the validation procedure: they tell\ncaucase what certificates to emit. Once done, any certificate can be\nprolonged at a simple request of the key holder while the to-renew\ncertificate is still valid (not expired, not revoked).\n\nBootstrapping the system (creating the first service certificate for\n`caucased`_ to operate on HTTPS, and creating the first user certificate to\ncontrol further certificate issuance) works by caucase automatically signing a\nset number of certificates upon submission.\n\nVocabulary\n==========\n\nCaucase manipulates the following asymmetric cryptography concepts.\n\n- Key pair: A private key and corresponding public key. The public key can be\n  derived from the private key, but not the other way around. As a consequence,\n  the private key is itself considered to be a key pair.\n\n- Certificate: A certificate is the assurante, by a certificate authority,\n  that a given public key and set of attributes belong to an authorised entity.\n  Abbreviated cert or crt. A certificate is by definition signed by a CA.\n\n- Certificate Authority: An entry, arbitrarily trusted (but worthy of trust by\n  its actions and decision) which can issue certificates. Abbreviated CA.\n\n- Certificate signing request: A document produced by an entity desiring to get\n  certified, which they send to a certificate authority. The certificate signing\n  request contains the public key and desired set of attributes that the CA\n  should pronounce itself on. The CA has all liberty to issue a different set\n  of attributes, or to not issue a certificate.\n\n- Certificate revocation list: Lists the certificates which were issued by a CA\n  but which should not be trusted anymore. This can happen for a variety of\n  reasons: the private key was compromised, or its owning entity should not be\n  trusted anymore (ex: entity's permission to access to protected service was\n  revoked).\n\n- PEM: A serialisation mechanism commonly used for various cryptographic data\n  pieces. It relies on base64 so it is 7-bits-safe (unlike DER), and is very\n  commonly supported. Caucase exclusively uses PEM format.\n\nValidity period\n===============\n\nCryptographic keys wear out as are used and as they age.\n\nOf course, they do not bit-rot nor become thinner with use. But each time one\nuses a key and each minute an attacker had access to a public key, fractions\nof the private key bits are inevitably leaked, weakening it overall.\n\nSo keys must be renewed periodically to preserve intended security level. So\nthere is a limited life span to each certificate, including the ones emitted by\ncaucase.\n\nThe unit duration for caucase-emitted certificates is the \"normal\" certificate\nlife span. It default to 93 days from the moment the certificate was signed,\nor about 3 months.\n\nThen the CA certificate has a default life span of 4 \"normal\" certificate\nvalidity periods. As CA renewal happens in caucase without x509-level cross\nsigning (by decision, to avoid relying on intermediate CA support on\ncertificate presenter side and instead rely on more widespread\nmulti-CA-certificate support on verifier side), there is a hard lower bound of\n3 validity periods, under which the CA certificate cannot be reliably renewed\nwithout risking certificate validation issues for emitted \"normal\"\ncertificates. CA certificate renewal is composed of 2 phases:\n\n- Passive distribution phase: current CA certificate has a remaining life span\n  of less than 2 \"normal\" certificate life spans: a new CA certificate is\n  generated and distributed on-demand (on \"normal\" certificate renewal and\n  issuance, on CRL retrieval with caucase tools...), but not used to sign\n  anything.\n- Active use phase: new CA certificate is valid for more than one \"normal\"\n  certificate life span. This means that all existing certificates which are\n  still in active use had to be renewed at least once since the new CA\n  certificate exists. This means all the certificate holders had the\n  opportunity to learn about the new CA certificate. So the new CA certificate\n  starts being used to sign new certificates, and the old CA certificate falls\n  out of use as its signed \"normal\" certificates expire.\n\nBy default, all caucase tools will generate a new private key unrelated to the\nprevious one on each certificate renewal.\n\nLastly, there is another limited validity period, although not for the same\nreasons: the list of revoked certificates also has a maximum life span. In\ncaucase, the CRL is re-generated whenever it is requested and:\n\n- there is no previous CRL\n- previous CRL expired\n- any revocation happened since previous CRL was created\n\nHere is an illustration of the certificate and CA certificate renewal process::\n\n  Time from first caucased start:\n    +--------+--------+--------+--------+--------+--------+--------+-->\n  Certificate 1 validity:      |                 |                 |\n    |[cert 1v1]  [cert 1v3]  [cert 1v5]  [cert 1v7]  [cert 1v9]  [ce...\n    |      [cert 1v2]  [cert 1v4]  [cert 1v6]  [cert 1v8]  [cert 1vA]\n  Certificate 2 validity:      |                 |                 |\n    |    [cert 2v1]  [cert 2v3]| [cert 2v5]  [cert 2v7]  [cert 2v9]|\n    |          [cert 2v2]  [cert 2v4]  [cert 2v6]| [cert 2v8]  [cert...\n  CA certificates validity:    |                 |                 |\n    [ca v1                     |        ]        |                 |\n    |                 [ca v2   |                 |        ]        |\n    |                          |        [ca v3   |                 |...\n    |                          |                 |        [ca v4   |...\n  CRL validity for CA1:        |                 |                 |\n    [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][  ]        |                 |\n  CRL validity for CA2:        |                 |                 |\n    |                 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][  ]        |\n  CRL validity for CA3:        |                 |                 |\n    |                          |        [ ][ ][ ][ ][ ][ ][ ][ ][ ][...\n  CA renewal phase:            |                 |                 |\n    |none             |passive |active  |passive |active  |passive |...\n  Active CA:                   |                 |                 |\n    [ca v1                    ][ca v2           ][ca v3            |...\n  Trust anchor:                |                 |                 |\n    [ca v1                     |       ][ca v2   |       ][ca v3   |...\n\nLegend::\n\n  +--------+ : One certificate validity period (default: 93 days)\n\nPoints of interest:\n\n- this illustration assumes no revocation happen\n- there usually are 2 simultaneously-valid CA certificates\n- there usually are 2 simultaneously-valid CRLs overall, one per CA certificate\n- the first ``cert 1`` signed by CA v2 is ``cert 1v6``\n- the first ``cert 2`` signed by CA v2 is ``cert 1v5``\n\nCommands\n========\n\nCaucase provides several commands to work with certificates.\n\ncaucase\n+++++++\n\nReference caucase \"one-shot\" client.\n\nThis command is intended to be used for isolated actions:\n\n- listing and signing pending certificate signature requests\n\n- revoking certificates\n\nIt is also able to submit certificate signing requests, retrieve signed\ncertificates, requesting certificate renewals and updating both\nCA certificates and revocation lists, but you may be interested in using\n`caucase-updater`_ for this instead.\n\ncaucase-updater\n+++++++++++++++\n\nReference caucase certificate renewal daemon.\n\nMonitors a key pair, corresponding CA certificate and CRL, and renew them\nbefore expiration.\n\nWhen the key-pair lacks a signed certificate, issues a pre-existing CSR to\ncaucase server and waits for the certificate to be issued.\n\ncaucase-probe\n+++++++++++++\n\nCaucase server availability tester.\n\nPerforms minimal checks to verify a caucase server is available at given URL.\n\ncaucase-rerequest\n+++++++++++++++++\n\nUtility allowing to re-issue a CSR using a locally-generated private key.\n\nIntended to be used in conjunction with `caucase-updater`_ when user cannot\ngenerate the CSR on the system where the certificate is desired (ex: automated\nHTTPS server deployment), where user is not the intended audience for\ncaucase-produced certificate:\n\n- User generates a CSR on their own system, and signs it with any key (it will\n  not be needed later\n- User sends the CSR to the system where the certificate is desired\n- User gets caucase-rerequest to run on this CSR, producing a new private key\n  and a CSR similar to issued one, but signed with this new private key\n- From then on, caucase-updater can take over\n\nThis way, no private key left their original system, and user could still\nfreely customise certificate extensions.\n\ncaucase-key-id\n++++++++++++++\n\nUtility displaying the identifier of given key, or the identifier of keys\ninvolved in given backup file.\n\nAllows identifying users which hold a private key candidate for restoring a\ncaucased backup (see `Restoration procedure`_).\n\ncaucased\n++++++++\n\nReference caucase server daemon.\n\nThis daemon provides access to both CAU and CAS services over both HTTP and\nHTTPS.\n\nIt handles its own certificate issuance and renewal, so there is no need to use\n`caucase-updater`_ for this service.\n\nCORS\n----\n\ncaucased implements CORS protection: when receiving a cross-origin request,\nit will respond with 401 Unauthorized, with the WWW-Authenticate header set to\na custom scheme (\"cors\") with an \"url\" parameter containing an URI template\nwith one variable field: \"return\" (more on it later).\n\nUpon receiving this response, the application is expected to render the URL\ntemplate and redirect the user to resulting URL. There, the user will be\ninformed of the cross-origin access attempt, and offered the choice to grant or\ndeny access to given origin.\n\nOnce their decision is made, their browser will receive a cookie remembering\nthis decision, and they will be redirected to the URL received in the \"return\"\nfield received upon above-described redirection.\n\nThen, the application should retry the original request, which will be\naccompanied by that cookie.\n\nBackups\n-------\n\nLoosing the CA private key prevents issuing any new certificate trusted by\nservices which trusted the CA. Also, it prevents issuing any new CRL.\nRecovering from such total loss requires starting a new CA and rolling it out\nto all services which used the previous one. This is very time-costly.\n\nSo backups are required.\n\nOn the other hand, if someone gets their hand on the CA private key, they can\nissue certificates for themselves, allowing them to authenticate with services\ntrusting the CA managed by caucase - including caucased itself if they issue a\nuser certificate: they can then revoke existing certificates and cause a lot of\ndamage.\n\nSo backups cannot happen in clear text, they must be encrypted.\n\nBut the danger of encrypted backups is that by definition they become worthless\nif they cannot be decrypted. So as many (trusted) entities as possible should\nbe granted the ability to decrypt the backups.\n\nThe solution proposed by caucased is to encrypt produced backups in a way which\nallows any of the caucase users to decrypt the archive.\n\nAs these users are already entrusted with issuing certificates, this puts\nonly a little more power in their hands than they already have. The little\nextra power they get is that by having unrestricted access to the CA private\nkey they can issue certificates bypassing all caucase restrictions. The\nproposed parade is to only make the backups available to a limited subset of\ncaucase users when there is an actual disaster, and otherwise keep it out of\ntheir reach. This mechanism is not handled by caucase.\n\nAs there are few trusted users, caucase can keep their still-valid certificates\nin its database for the duration of their validity with minimal size cost.\n\nBackup procedure\n----------------\n\nBackups happen periodically as long as caucased is running. See\n`--backup-period` and `--backup-directory`.\n\nAs discussed above, produced files should be kept out of reach of caucase\nusers until a disaster happens.\n\nRestoration procedure\n---------------------\n\nSee `caucased-manage --restore-backup`.\n\nTo restore, one of the trusted users must voluntarily compromise their own\nprivate key, providing it to the administrator in charge of the restoration\nprocedure. Restoration procedure will hence immediately revoke their\ncertificate. They must also provide a CSR generated with a different private\nkey, so that caucase can provide them with a new certificate, so they keep\ntheir access only via different credentials.\n\n- admin identifies the list of keys which can decipher a backup, and broadcasts\n  that list to key holders\n\n- key holders manifest themselves\n\n- admin picks a key holder, requests them to provide their existing private key\n  and to generate a new key and accompanying CSR\n\n- key holder provide requested items\n\n- admin initiates restoration with `--restore-backup` and provides key holder\n  with replacement certificate\n\n- admin starts caucased, service is back online.\n\nBackup file format\n------------------\n\n- 64bits: 'caucase\\0' magic string\n\n- 32bits LE: header length\n\n- header: json-encoded header (see below)\n\n- encrypted byte stream (aka payload)\n\nHeader schema (inspired from s/mime, but s/mime tools available do not\nsupport at least iterative production or iterative generation)::\n\n  {\n    \"description\": \"Caucase backup header\",\n    \"required\": [\"algorithm\", \"key_list\"],\n    \"properties\": {\n      \"cipher\": {\n        \"description\": \"Symetric ciher used for payload\",\n        \"required\": [\"name\"],\n        \"properties\": {\n          \"name\":\n            \"enum\": [\"aes256_cbc_pkcs7_hmac_10M_sha256\"],\n            \"type\": \"string\"\n          },\n          \"parameter\": {\n            \"description\": \"Name-dependend clear cipher parameter (ex: IV)\",\n            \"type\": \"string\"\n          }\n        }\n        \"type\": \"object\"\n      },\n      \"key_list\": {\n        \"description\": \"Content key, encrypted with public keys\",\n        \"minItems\": 1,\n        \"items\": {\n          \"required\": [\"id\", \"cipher\", \"key\"],\n          \"properties\": {\n            \"id\": {\n              \"description\": \"Hex-encoded sha1 hash of the public key\",\n              \"type\": \"string\"\n            },\n            \"cipher\": {\n              \"description\": \"Asymetric cipher used for symetric key\",\n              \"required\": [\"name\"],\n              \"properties\": {\n                \"name\": {\n                  \"enum\": [\"rsa_oaep_sha1_mgf1_sha1\"],\n                  \"type\": \"string\"\n                }\n              },\n              \"type\": \"object\"\n            }\n            \"key\": {\n              \"description\": \"Hex-encoded encrypted concatenation of signing and symetric encryption keys\",\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"type\": \"array\"\n      }\n    },\n    \"type\": \"object\"\n  }\n\n0.9.15 (2023-05-19)\n===================\n* Fix support for recent (at least >= 40.0.2) cryptography versions\n\n0.9.14 (2022-11-07)\n===================\n* Janitorial: make updated code checkers happier.\n* Explicitly depend on ipaddress module on python 2.7 .\n* Be less sensitive to small client/server time disagreements.\n* Fix crashes when encountering broken symlinks in directories of PEM files.\n\n0.9.13 (2021-12-22)\n===================\n* Improve behaviour on computers which are frequently suspended. This should avoid missing certificate renewal deadlines.\n* Fix test support for recent pyca.cryptography, which dropped support for >28bits OIDs. This means there is now no upgrade path for CAs which used the 128bits UUID arc.\n* Improve tests stability.\n\n0.9.12 (2021-10-20)\n===================\n* Fix caucase-updater crashes after a local trust anchor CA expires.\n\n0.9.11 (2021-10-07)\n===================\n* Drop reliance on install-time 2to3 for py3 compatibility. Now the source is directly compatible with 2.7 and 3.x .\n\n0.9.10 (2021-04-07)\n===================\n* Properly handle present but expired CA certificates.\n* Properly handle CRLs whose CA certificate is missing.\n* Add caucase.client.CaucaseClient.close method.\n\n0.9.9 (2021-03-02)\n==================\n* Add AuthorityKeyIdentifier extension in CRLs.\n* Accept user certificates signed by non-current CA.\n* Name CA certificates after their AuthorityKeyIdentifier keyid extension instead of their serial.\n* Produce one CRL per CA certificate, as some ssl-using services fail when there is no CRL signed by the same CA as the certificate being validated.\n* Fix trust anchor distribution during CA renewal period: the correct trust anchor is the oldest still-valid CA.\n\n0.9.8 (2020-06-29)\n==================\n* Add support for python3.\n* Add support for one-CA-cert-per-file layout. For services which do not support loading multiple CA certificates from a single file.\n* Fix caucase.sh authenticated usage (was broken by 0.9.4 \"Make caucased https CA certificate safer\").\n* Avoid busy-loop in caucase-updater when it thinks a renewal is due but caucased does not offer a newer version.\n* Fix tests timeouts on slower machined. Anything faster than a Raspberry Pi 1 should now pass.\n\n0.9.7 (2020-06-04)\n==================\n* Fix CRL renewal:\n  * teach caucased to renew CRLs ahead of their expirations.\n  * make caucase-updater check CRL expiration date.\n* Grant extra permissions in license.\n\n0.9.6 (2019-05-27)\n==================\n* Do not use a 128bits OID arc for caucase internal use, as it is not widely supported.\n* Assorted CLI usability improvements.\n\n0.9.5 (2019-01-24)\n==================\n* Add --version support.\n* Logging is reworked to reduce verbosity (especially in tests).\n* Fix caucased sometimes crashing when renewing its https certificate.\n* Make caucased logs more apache-like.\n* Make caucased responses more standard-compliant (\"Allow\" header in 405 response and \"Date\" header in all responses).\n* Fix unintended dependency on system timezone.\n\n0.9.4 (2018-11-14)\n==================\n* Improved documentation.\n* Tentative web-friendliness (not used in real life yet, so practicality is still uncertain):\n  * Make caucased https CA certificate safer for adding in a trust store (ex: browser) by constraining the certificates it can sign.\n  * cookie-based CORS access control with crude UI.\n  * API is self-documenting using application/hal+json format.\n* Tentative python3 friendliness, there may still be file IO encoding issues.\n\n0.9.3 (2018-09-21)\n==================\n* Add support for listening to multiple specific addresses in caucased.\n* shell implementation does not rely on an external file anymore.\n* Do not start listening on https port before wrapping sockets with an ssl context\n* Make caucase-updater usable by anonymous services (ex: they only need to connect to a caucase-certified service, without authenticating themselves using caucase)\n* Use stricter file permissions for caucased sqlite database.\n* Include caucase version in user agent header.\n* Make caucased logging format more similar to apache's default.\n* Fix caucased https certificate renewal. Fixes a crash which happens every 2 months.\n* Make caucase-updater retry on network errors. Fixes crashes on transient network error.\n\n0.9.2 (2017-11-03)\n==================\n* Add support for migrating an existing CA to caucase: import CA cert and CRLs.\n* Require CRL signature checks (bumps cryptography module version requirements).\n* Provide CRL distribution point extension in CA certificates.\n* Play nicer with http:\n  * Catch more errors to provide nice status codes\n  * Add support for \"Transfer-Encoding: chunked\"\n  * Add support for \"Expect: 100-continue\"\n* Produce TLS-compliant certificates (domain name must be in an alternative name extension, subject is not enough).\n* Reduce speed requirements in tests.\n* Add shell implementation of \"caucase\" command.\n* Certificate renewal bypasses pending CSR limits.\n* caucase-manage: new command for offline database maintenance.\n\n0.9.1 (2017-09-21)\n==================\n* Documentation improvements\n* Packaging improvements\n\n0.9.0 (2017-08-02)\n==================\n* implement the \"cau\" half of \"caucase\"\n* massive rework: removal of flask dependency, removal of HTML UI, rework of\n  the REST API, rework of the CLI tools, rework of the WGSI application,\n  incomatible redesign of the database.\n\n0.1.4 (2017-07-21)\n==================\n* caucase web parameter 'auto-sign-csr-amount' can be used to set how many csr must be signed automatically.\n\n0.1.3 (2017-06-30)\n==================\n\n* add support for backup caucase database to cli\n* serial is a random unique formatted hexadecimal number get from the csr_id\n* allow to set custom subject (X509Name) when signing a certificate\n* add new cliweb command which when required will download/update crl file from caucase web\n\n0.1.2 (2017-05-12)\n==================\n* cliweb: renew now takes threshold option to check if renew is required and optional on-renew script to run after certificate renewal\n\n0.1.1 (2017-04-27)\n==================\n\n * initial implementation of certificate authority\n\n",
    "bugtrack_url": null,
    "license": "GPLv3+ with wide exception for FOSS",
    "summary": "Certificate Authority.",
    "version": "0.9.15",
    "project_urls": {
        "Homepage": "https://lab.nexedi.com/nexedi/caucase"
    },
    "split_keywords": [
        "certificate",
        "authority"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3feae8f7be2622b0a93f9292d7e245631da5e235e75b2012151fcfc7e97107a7",
                "md5": "06fef566736733e4d12083698e8dab68",
                "sha256": "f6f71fae03387d1e9bbc501caa9705b894ca8cf41ed8fb99a1dddecdb9ea5a90"
            },
            "downloads": -1,
            "filename": "caucase-0.9.15.tar.gz",
            "has_sig": false,
            "md5_digest": "06fef566736733e4d12083698e8dab68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 132236,
            "upload_time": "2023-05-19T02:03:08",
            "upload_time_iso_8601": "2023-05-19T02:03:08.731356Z",
            "url": "https://files.pythonhosted.org/packages/3f/ea/e8f7be2622b0a93f9292d7e245631da5e235e75b2012151fcfc7e97107a7/caucase-0.9.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-19 02:03:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "caucase"
}
        
Elapsed time: 1.17133s