Coder Social home page Coder Social logo

glvnst / minica Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jsha/minica

0.0 0.0 0.0 47 KB

minica is a small, simple CA intended for use in situations where the CA operator also operates each host where a certificate will be used.

License: MIT License

Go 97.85% Dockerfile 2.15%

minica's Introduction

minica (kinda)

IMPORTANT NOTE ABOUT THIS FORK

Please see the official minica repo - jsha/minica rather than relying on this fork!

This fork mostly consists of me merging PRs that were submitted to jsha/minica but have not yet been accepted (nor rejected) there. This fork is for experimentation and personal use and probably most of these changes won't make it into upstream because they add complexity and use cases which may not be part of the original design goals. In these cases, minica's creator frequently directs people to the mkcert project.

About minica

Minica is a simple CA intended for use in situations where the CA operator also operates each host where a certificate will be used. It automatically generates both a key and a certificate when asked to produce a certificate. It does not offer OCSP or CRL services. Minica is appropriate, for instance, for generating certificates for RPC systems or microservices.

On first run, minica will generate a keypair and a root certificate in the current directory, and will reuse that same keypair and root certificate unless they are deleted.

On each run, minica will generate a new keypair and sign an end-entity (leaf) certificate for that keypair. The certificate will contain a list of DNS names and/or IP addresses from the command line flags. The key and certificate are placed in a new directory whose name is chosen as the first domain name from the certificate, or the first IP address if no domain names are present. It will not overwrite existing keys or certificates.

The certificate will have a validity of 2 years and 30 days.

Installation

First, install the Go tools and set up your $GOPATH. Then, run:

go get github.com/jsha/minica

When using Go 1.11 or newer you don't need a $GOPATH and can instead do the following:

cd /ANY/PATH
git clone https://github.com/jsha/minica.git
cd minica
go build
## or
# go install

Example usage

# Generate a root key and cert in minica-key.pem, and minica.pem, then
# generate and sign an end-entity key and cert, storing them in ./foo.com/
$ minica --domains foo.com

minica's People

Contributors

actualben avatar dtrodrigues avatar electricwarr avatar fopina avatar glvnst avatar itsazzad avatar jsha avatar mbardelmeijer avatar nicolas-duboc-ibm avatar omarkohl avatar tawera avatar troynt avatar

minica's Issues

try implementing the CA x509.Certificate constraints

Upstream issue 26 has an interesting suggestion which could limit the blast radius of a file disclosure of the CA key. I suspect that generally file disclosure is a bit easier for an attacker to accomplish than full local compromise but I don't have anything to back that up.

I'd consider trying implementations of PermittedDNSDomains and PermittedIPRanges and just hooking PermittedDNSDomainsCritical to the presence of values in either.

x509.Certificate has these related fields:

    // Name constraints
    PermittedDNSDomainsCritical bool // if true then the name constraints are marked critical.
    PermittedDNSDomains         []string
    ExcludedDNSDomains          []string
    PermittedIPRanges           []*net.IPNet
    ExcludedIPRanges            []*net.IPNet
    PermittedEmailAddresses     []string
    ExcludedEmailAddresses      []string
    PermittedURIDomains         []string
    ExcludedURIDomains          []string

consider adopting a Context var

passing parameters through getIssuer and sign could get awkward. I wonder if it would be better to disentangle generation from loading or if it makes sense to pass a Context to these functions -- which can carry parameters to the functions that need them?

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.