Skip to content
brandonweeksPublic

About

No description, website, or topics provided.

Resources

Stars

38 stars

Watchers

1 watching

Forks

Latest commit

 

History

56 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanoca

A lightweight enterprise ACME Certificate Authority service with device attestation support. It provides just the HTTP handlers needed to implement ACME, it is intended to be integrated into nanomdm or another service of your choosing. Storage, signing, authorization, and logging are implemented as pluggable interfaces to integrate into a wide variety of environments.

Usage

import (
	"log/slog"
	"net/http"

	"github.com/brandonweeks/nanoca"
	nullauthorizer "github.com/brandonweeks/nanoca/authorizers/null"
	"github.com/brandonweeks/nanoca/issuers/inprocess"
	"github.com/brandonweeks/nanoca/signers/file"
	"github.com/brandonweeks/nanoca/storage/badger"
	"github.com/brandonweeks/nanoca/verifiers/apple"
)

logger := slog.New(nanoca.NewContextHandler(slog.Default().Handler()))

caCert, _ := /* load your *x509.Certificate */
signer, _ := file.LoadSigner("rootCA.key")
storage, _ := badger.New(badger.Options{InMemory: true})

issuer, _ := inprocess.New(signer, caCert)
ca, _ := nanoca.New(
	logger,
	issuer,
	nullauthorizer.New(),
	storage,
	"https://localhost:8443",
	nanoca.WithPrefix("/acme"),
	nanoca.WithVerifier(apple.New(logger)),
)
defer ca.Close()

mux := http.NewServeMux()
mux.Handle("/", ca.Handler())

Deployment

  • Terminate TLS on the listener or in a proxy in front of the handler. The JWS url check compares against the configured base URL, so the base URL must be the https:// URL clients use.
  • Rate limit the ACME endpoints at the proxy. Account creation and /new-nonce are unauthenticated, and every request stores a nonce for an hour, so request volume is storage volume.
  • Orders, authorizations, and challenges are kept until the operator prunes them. The storage backend does not expire them.

About

No description, website, or topics provided.

Resources

Stars

38 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages