Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security certificates module #327498

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

MadnessASAP
Copy link
Contributor

Description of changes

Provide a framework for runtime generation of TLS certificates using 1 or more interchangeable certificate authorities/services. It allows for services that require certificates to provide a specification and for the user to customize that specification as well as assign a default and per-certificate authority.

All options exist under security.certificates and are mostly (well?) documented and relatively straightforward.

Currently there is a local authority that will generate a root certificate and then issue requested certificates from it, and a vault authority that will request certificates from a Hashicorp Vault server. Both are WIP with some important features missing. However both are also passing all the tests that I have written (that being the ones I know they pass).

Currently a draft as I am at a point where external eyeballs and comments would be greatly appreciated as I start to polish this into something useful.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This module provides a framework for generating certificates from
provided "specifications" using one or more "authorities". The
specifications are defined in `security.certificates.specifications`
while authorities are defined in `security.certificates.authorities`.

Specifications, in addition to mostly self explanatory options, have a
`authority` option to allow overriding the default authority. It is
defined as a `attrTag` where the tag/name indicates the authority to be
used and the value is a option defined by the selected authority (the
option may itself be a submodule of other options).

Authorities are able to define whatever global options they may require
within `security.certificates.authorities.<authority>`. They MUST also
provide a `settings` option, it's type is irreleveant so long as it does
exist. The `settings` option will become the certificate specific
options under `security.certificates.specifications.<cert-spec>. \
authority.<authority>`.

A default authority and settings are defined under
`security.certificates.defaultAuthority` following the same principles
as `specifications.authority.<...>.settings`.

Signed-off-by: Michael 'ASAP' Weinrich <michael@a5ap.net>
moved certificate specification to seperate file
These scripts will generate the key, csr, and install the final certificate
according to the specification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants