Go SCEP server
scep is a Simple Certificate Enrollment Protocol server and client
[!NOTE] The included SCEP server and CA are very basic and lack critical security-related features. You are encouraged to explore a more robust solution such as github.com/smallstep/certificates. As alluded to in our blog post this project's SCEP server will not likely be supported in the future.
Binary releases are available on the releases page.
To compile the SCEP client and server you will need a Go compiler as well as standard tools like git, make, etc.
git clone https://github.com/micromdm/scep.git && cd scepmake (for Windows: make win)The binaries will be compiled in the current directory and named after the architecture. I.e. scepclient-linux-amd64 and scepserver-linux-amd64.
See Docker documentation below.
Minimal example for both server and client.
…The default flags configure and run the scep server.
-depot must be the path to a folder with ca.pem and ca.key files. If you don't already have a CA to use, you can create one using the ca subcommand.
The scepserver provides one HTTP endpoint, /scep, that facilitates the normal PKIOperation/Message parameters.
Server usage:
…Use the ca -init subcommand to create a new CA and private key.
CA sub-command usage:
…The -csrverifierexec switch to the SCEP server allows for executing a command before a certificate is issued to verify the submitted CSR. Scripts exiting without errors (zero exit status) will proceed to certificate issuance, otherwise a SCEP error is generated to the client. For example if you wanted to just save the CSR this is a valid CSR verifier shell script:
#!/bin/sh
cat - > /tmp/scep.csr…Note: Make sure to specify the desired endpoint in your -server-url value (e.g. 'http://scep.groob.io:2016/scep')
To obtain a certificate through Network Device Enrollment Service (NDES), set -server-url to a server that provides NDES.
This most likely uses the /certsrv/mscep path. You will need to add the -ca-fingerprint client argument during this request to specify which CA to use.
If you're not sure which SHA-256 hash (for a specific CA) to use, you can use the -debug flag to print them out for the CAs returned from the SCEP server.
# first compile the Docker binaries
CGO_ENABLED=0 make docker
# build the image
docker build -t micromdm/scep:latest .
# create CA
docker run -it --rm -v /path/to/ca/folder:/depot micromdm/scep:latest ca -init
# run
docker run -it --rm -v /path/to/ca/folder:/depot -p 8080:8080 micromdm/scep:latestYou can import the scep endpoint into another Go project. For an example take a look at scepserver.go.
The SCEP server includes a built-in CA/certificate store. This is facilitated by the Depot and CSRSigner Go interfaces. This certificate storage to happen however you want. It also allows for swapping out the entire CA signer altogether or even using SCEP as a proxy for certificates.
No open issues yet, or sync has not completed.