https://github.com/smallstep/certificates

Mariano Cano 2611fc04d4 Add initial tests for CreateCertificateAuthority. 6 ani în urmă
.github be030309a4 Update issue templates 6 ani în urmă
acme 4c48048615 Use sync.Mutex as value 6 ani în urmă
api c94a1c51be Merge branch 'master' into ssh-cert-templates 6 ani în urmă
authority 3e6137110b Add support for using ssh-agent as a KMS 6 ani în urmă
autocert 8fafd987ca Use REAMDE.md suggested in code review. 7 ani în urmă
ca 40d0596b71 Use smallstep/cli-utils instead of smallstep/cli 6 ani în urmă
cas 2611fc04d4 Add initial tests for CreateCertificateAuthority. 6 ani în urmă
cmd 3e6137110b Add support for using ssh-agent as a KMS 6 ani în urmă
commands 5deca85b14 Add initial support for `step ca init` with cloud cas. 6 ani în urmă
db 8381e9bd17 Fix typos. 6 ani în urmă
debian 03c1eaa8a5 update year on debian copyright 6 ani în urmă
docker 3b31c6d2f5 Change `HEALTHCHECK` to use `step ca health`. Change shell `CMD exec` to skip redundant `/bin/sh -c` 6 ani în urmă
docs 3e6137110b Add support for using ssh-agent as a KMS 6 ani în urmă
errs 4ad6be2680 Fix error message of bad request 6 ani în urmă
examples 50d09c183b Fix example and use ClientCAs. 6 ani în urmă
kms 3e6137110b Add support for using ssh-agent as a KMS 6 ani în urmă
logging d368791606 Add x5c provisioner capabilities 7 ani în urmă
make c2fd6a8421 Add step-awskms-init to the binary releases. 6 ani în urmă
monitoring c74fcd57a7 ca-component -> certificates 8 ani în urmă
pki 9607eddd6a Remove unused code. 6 ani în urmă
server d0c7ccd0db ServetTLS => ServeTLS in function docs 8 ani în urmă
templates 40d0596b71 Use smallstep/cli-utils instead of smallstep/cli 6 ani în urmă
.VERSION c23eb88a4f Added version operability for `git archive` tarball (non git repo) 7 ani în urmă
.dockerignore 6ffc438ed1 Update Dockerfile.step-ca to match best practices 6 ani în urmă
.gitattributes c23eb88a4f Added version operability for `git archive` tarball (non git repo) 7 ani în urmă
.gitignore 4b473732d9 Add support for TLS-ALPN-01 challenge. 6 ani în urmă
.golangci.yml cb594ed2e0 go mod tidy and golang 1.15.0 cleanup ... 6 ani în urmă
.travis.yml 925edaede2 revert to skip_cleanup in travis 6 ani în urmă
.version.sh c23eb88a4f Added version operability for `git archive` tarball (non git repo) 7 ani în urmă
CHANGELOG.md e8baba3e30 first pass at README 8 ani în urmă
LICENSE df3e9c0cd6 Add full version of the license. 6 ani în urmă
Makefile ffedccf439 Add step-awskms-init into the builds. 6 ani în urmă
README.md 80beff6ce3 Update READMEs with links to new docs 6 ani în urmă
distribution.md 7861069018 Fix command in distribution.md. 6 ani în urmă
go.mod 2611fc04d4 Add initial tests for CreateCertificateAuthority. 6 ani în urmă
go.sum 2611fc04d4 Add initial tests for CreateCertificateAuthority. 6 ani în urmă
icon.png a064540681 Commit icons. 7 ani în urmă
icon.svg a064540681 Commit icons. 7 ani în urmă

README.md

Step Certificates

step-ca is an online certificate authority for secure, automated certificate management. It's the server counterpart to the step CLI tool.

You can use it to:

  • Issue X.509 certificates for your internal infrastructure:
    • HTTPS certificates that work in browsers (RFC5280 and CA/Browser Forum compliance)
    • TLS certificates for VMs, containers, APIs, mobile clients, database connections, printers, wifi networks, toaster ovens...
    • Client certificates to enable mutual TLS (mTLS) in your infra. mTLS is an optional feature in TLS where both client and server authenticate each other. Why add the complexity of a VPN when you can safely use mTLS over the public internet?
  • Issue SSH certificates:
    • For people, in exchange for single sign-on ID tokens
    • For hosts, in exchange for cloud instance identity documents
  • Easily automate certificate management:

Whatever your use case, step-ca is easy to use and hard to misuse, thanks to safe, sane defaults.

Questions? Find us in Discussions.

Website | Documentation | Installation Guide | Quickstart | Getting Started | Contributor's Guide

GitHub release CA Image Go Report Card Build Status License CLA assistant

GitHub stars Twitter followers

Features

🦾 A fast, stable, flexible private CA

Setting up a public key infrastructure (PKI) is out of reach for many small teams. step-ca makes it easier.

⚙️ Many ways to automate

There are several ways to authorize a request with the CA and establish a chain of trust that suits your flow.

You can issue certificates in exchange for:

🏔 Your own private ACME server

ACME is the protocol used by Let's Encrypt to automate the issuance of HTTPS certificates. It's super easy to issue certificates to any ACMEv2 (RFC8555) client.

👩🏽‍💻 An online SSH Certificate Authority

  • Delegate SSH authentication to step-ca by using SSH certificates instead of public keys and authorized_keys files
  • For user certificates, connect SSH to your single sign-on provider, to improve security with short-lived certificates and MFA (or other security policies) via any OAuth OIDC provider.
  • For host certificates, improve security, eliminate TOFU warnings, and set up automated host certificate renewal.

🤓 A general purpose PKI tool, via step CLI integration

Installation Guide

These instructions will install an OS specific version of the step-ca binary on your local machine.

Mac OS

Install step and step-ca together, via Homebrew:

$ brew install step

Linux

Note: The step CLI tool is the easiest way to initialize, configure, and control step-ca. While step is not technically required to run step-ca, it is very much recommended.

Debian

  1. Install step.

    Download the Debian package from the latest step release:

    $ wget https://github.com/smallstep/cli/releases/download/vX.Y.Z/step-cli_X.Y.Z_amd64.deb
    

    Install the Debian package:

    $ sudo dpkg -i step-cli_X.Y.Z_amd64.deb
    
  2. Install step-ca.

    Download the Debian package from the latest step-ca release:

    $ wget https://github.com/smallstep/certificates/releases/download/vX.Y.Z/step-certificates_X.Y.Z_amd64.deb
    

    Install the Debian package:

    $ sudo dpkg -i step-certificates_X.Y.Z_amd64.deb
    

Arch Linux

We are using the Arch User Repository to distribute step binaries for Arch Linux.

  • The step binary tarball can be found here.
  • The step-ca binary tarball can be found here.

You can use pacman to install the packages.

RHEL/CentOS

  1. Install step.

    Download the Linux tarball from the latest step release:

    $ wget -O step-cli.tar.gz https://github.com/smallstep/cli/releases/download/vX.Y.Z/step_linux_X.Y.Z_amd64.tar.gz
    

    Install step by unzipping and copying the executable over to /usr/bin:

    $ tar -xf step-cli.tar.gz
    $ sudo cp step_X.Y.Z/bin/step /usr/bin
    
  2. Install step-ca.

    Download the Linux package from the latest step-ca release:

    $ wget -O step-ca.tar.gz https://github.com/smallstep/certificates/releases/download/vX.Y.Z/step-certificates_linux_X.Y.Z_amd64.tar.gz
    

    Install step-ca by unzipping and copying the executable over to /usr/bin:

    $ tar -xf step-ca.tar.gz
    $ sudo cp step-certificates_X.Y.Z/bin/step-ca /usr/bin
    

See the systemctl setup section for a guide on configuring step-ca as a daemon.

Kubernetes

We publish helm charts for easy installation on kubernetes:

helm install step-certificates

If you're using Kubernetes, make sure you check out autocert: a kubernetes add-on that builds on step certificates to automatically inject TLS/HTTPS certificates into your containers.

Docker

See our Docker getting started guide

Test

$ step version
Smallstep CLI/0.10.0 (darwin/amd64)
Release Date: 2019-04-30 19:01 UTC

$ step-ca version
Smallstep CA/0.10.0 (darwin/amd64)
Release Date: 2019-04-30 19:02 UTC

Quickstart

In the following guide we'll run a simple hello server that requires clients to connect over an authorized and encrypted channel using HTTPS. step-ca will issue certificates to our server, allowing it to authenticate and encrypt communication.

Animated terminal showing step certificates in practice

Let's get started!

Prerequisites

Let's get started!

1. Run step ca init to create your CA's keys & certificates and configure step-ca:

$ step ca init
✔ What would you like to name your new PKI? (e.g. Smallstep): Example Inc.
✔ What DNS names or IP addresses would you like to add to your new CA? (e.g. ca.smallstep.com[,1.1.1.1,etc.]): localhost
✔ What address will your new CA listen at? (e.g. :443): 127.0.0.1:8080
✔ What would you like to name the first provisioner for your new CA? (e.g. you@smallstep.com): bob@example.com
✔ What do you want your password to be? [leave empty and we'll generate one]: abc123

Generating root certificate...
all done!

Generating intermediate certificate...
all done!

✔ Root certificate: /Users/bob/src/github.com/smallstep/step/.step/certs/root_ca.crt
✔ Root private key: /Users/bob/src/github.com/smallstep/step/.step/secrets/root_ca_key
✔ Root fingerprint: 702a094e239c9eec6f0dcd0a5f65e595bf7ed6614012825c5fe3d1ae1b2fd6ee
✔ Intermediate certificate: /Users/bob/src/github.com/smallstep/step/.step/certs/intermediate_ca.crt
✔ Intermediate private key: /Users/bob/src/github.com/smallstep/step/.step/secrets/intermediate_ca_key
✔ Default configuration: /Users/bob/src/github.com/smallstep/step/.step/config/defaults.json
✔ Certificate Authority configuration: /Users/bob/src/github.com/smallstep/step/.step/config/ca.json

Your PKI is ready to go. To generate certificates for individual services see 'step help ca'.

This command will:

You can find these artifacts in $STEPPATH (or ~/.step by default).

2. Start step-ca:

You'll be prompted for your password from the previous step, to decrypt the CA's private signing key:

$ step-ca $(step path)/config/ca.json
Please enter the password to decrypt /Users/bob/src/github.com/smallstep/step/.step/secrets/intermediate_ca_key: abc123
2019/02/18 13:28:58 Serving HTTPS on 127.0.0.1:8080 ...

3. Copy our hello world golang server.

$ cat > srv.go <<EOF
package main

import (
    "net/http"
    "log"
)

func HiHandler(w http.ResponseWriter, req *http.Request) {
    w.Header().Set("Content-Type", "text/plain")
    w.Write([]byte("Hello, world!\n"))
}

func main() {
    http.HandleFunc("/hi", HiHandler)
    err := http.ListenAndServeTLS(":8443", "srv.crt", "srv.key", nil)
    if err != nil {
        log.Fatal(err)
    }
}
EOF

4. Get an identity for your server from the Step CA.

$ step ca certificate localhost srv.crt srv.key
✔ Key ID: rQxROEr7Kx9TNjSQBTETtsu3GKmuW9zm02dMXZ8GUEk (bob@example.com)
✔ Please enter the password to decrypt the provisioner key: abc123
✔ CA: https://localhost:8080/1.0/sign
✔ Certificate: srv.crt
✔ Private Key: srv.key

$ step certificate inspect --bundle srv.crt
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 140439335711218707689123407681832384336 (0x69a7a1d7f6f22f68059d2d9088307750)
    Signature Algorithm: ECDSA-SHA256
        Issuer: CN=Example Inc. Intermediate CA
        Validity
            Not Before: Feb 18 21:32:35 2019 UTC
            Not After : Feb 19 21:32:35 2019 UTC
        Subject: CN=localhost
...
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 207035091234452090159026162349261226844 (0x9bc18217bd560cf07db23178ed90835c)
    Signature Algorithm: ECDSA-SHA256
        Issuer: CN=Example Inc. Root CA
        Validity
            Not Before: Feb 18 21:27:21 2019 UTC
            Not After : Feb 15 21:27:21 2029 UTC
        Subject: CN=Example Inc. Intermediate CA
...

Note that step and step-ca handle details like certificate bundling for you.

5. Run the simple server.

$ go run srv.go &

6. Get the root certificate from the Step CA.

In a new Terminal window:

$ step ca root root.crt
The root certificate has been saved in root.crt.

7. Make an authenticated, encrypted curl request to your server using HTTP over TLS.

$ curl --cacert root.crt https://localhost:8443/hi
Hello, world!

All Done!

Check out the Getting Started guide for more examples and best practices on running Step CA in production.

Documentation

Documentation can be found in a handful of different places:

  1. On the web at https://smallstep.com/docs/step-ca.

  2. On the command line with step help ca xxx where xxx is the subcommand you are interested in. Ex: step help ca provisioner list.

  3. In your browser, by running step help --http=:8080 ca from the command line and visiting http://localhost:8080.

  4. The docs folder is being deprecated, but it still has some documentation and tutorials.

Feedback?