SCEP¶
SeaCat PKI supports SCEP aka Simple Certificate Enrolment Protocol.
Configuration¶
Establish the SCEP-capable X.509 Certificate Authority.
- 
Introduce a new tenant
in
etc/seacatpki.conf:[tenants] ids=TENANT_ROOT_CANote: The tenant name (e.g. "TENANT_ROOT_CA") is arbitrary.
 - 
Specify a SeaCat PKI API base URL
export ROOT_CA_URL=http://localhost:8080/TENANT_ROOT_CA - 
Generate CA private key, RSA 4098 (or more).
openssl genrsa -out ca-private-key.pem 4096 - 
Configure tenant and a CA private key in the PKI
in
seacatpki.conf:[tenants] ids=TENANT_ROOT_CA [seacatpki:x509:ca:scep-tenant] # A standard X.509 Certificate Authority configuration ca_key=scep-ca-key [seacatpki:private_key:scep-ca-key] keyfile=${THIS_DIR}/ca-private-key.pem tenants=TENANT_ROOT_CA - 
Restart a SeaCat PKI
 - 
Generate a Root CA self-signed certificate
Use template rootca.json and adjust mainly the subject name.
curl -X PUT "${ROOT_CA_URL}/x509/self-signed" \ --header 'Content-Type: application/json' \ -d @rootca.jsonNote the
pbidof the CA Certificate for a later use. - 
Finalize the the SeaCat PKI configuration
in
seacatpki.conf:[tenants] ids=scep-tenant [seacatpki:x509:ca:scep-tenant] # A standard X.509 Certificate Authority configuration ca_key=scep-ca-key ca_cert=scep-tenant:4fec087429f00360e314894c79f4d6d59405b131624ce70fccb44154641084a743b855d8c5f230ec69f74e04475e5056 # This enables use of SCEP scep=yes [seacatpki:private_key:scep-ca-key] keyfile=${THIS_DIR}/ca-private-key.pem tenants=scep-tenant - 
Restart the SeaCat PKI
 - 
SCEP enabled X.509 CA is ready for use.
 
Resources¶
- Simple Certificate Enrolment Protocol (SCEP) Specifications, draft-gutmann-scep-16
 - RFC 2315 PKCS #7: Cryptographic Message Syntax
 - RFC 5652 Cryptographic Message Syntax (CMS)
 
Certificate Enrolment/Renewal¶
Certificate Enrolment procedure¶
Client C (aka sscep)
Certification Authority CA (aka SeaCat PKI)  
Cgenerates private/public key pairCgenerates CSR (aka Certificate Signing Request, PKCS#10)- Add attributes
 - Add a public key
 - Sign CSR by private key (Proof-of-Possession or PoP)
 Csubmits CSR toCAover SCEP (request is in the PKCS#7 aka CMS format)CAaccepts CSR (over SCEP interface, including PKCS# verifications)CAverifies CSRCAstores CSR into a storage- At this moment 
CAcan decide that the approval will be delayed and returnsPENDINGto theC. The process can be resumed here.Chas to periodically check the status of the enrollment withCA. CAapproves CSR and this step implicitly creates a client certificate- Add selected attributes from CSR
 - Add a public key from CSR
 - Sign a new certificate by its CA private key
 CAstores a new client certificate in a storageCretrieves this client certificate fromCA(over SCEP)Cstores the client certificate on the local drive
Note: Renewal process is similar to the enrolment.
Tool sscep¶
SSCEP is a command line client for the SCEP protocol.
It can be used as a client to SeaCat PKI.
- 
Configure SeaCat PKI SCEP entry point.
% export SCEP_URL="http://example.com/scep-tenant/scep" - 
Get CA Certificate
% sscep getca -c ca.cert -u ${SCEP_URL}Stores the CA certiticate into
ca.certfile. - 
Prepare CSR
% openssl req -newkey rsa:2048 -sha256 -nodes -out local.csr -keyout local.key -subj "/C=GB/L=London/O=TeskaLabs/OU=SeaCat/CN=example.com"This creates
local.keyandlocal.csr. - 
Certificate Enrolment
% sscep enroll -v -k local.key -r local.csr -c ca.cert -l local.cert -t 2 -u ${SCEP_URL} - 
Certificate Renewal
% sscep enroll -v -k local.key -r local.csr -c ca.cert -O local.cert -K local.key -l local.cert -u ${SCEP_URL} 
Apple SCEP support¶
Apple allows to specify a profile for macOS and iOS that contains SCEP specifications allowing automated device enrollment.
Documentation:
- Configuration Profile Reference (Apple, PDF)
 - Configuration Profiles (Online, Substitution Variables for profiles)
 
SCEP profile¶
./scep-apple-profile.mobileconfig
The profile is XML file. Apple provides "Apple Configurator 2" tool for managing profiles. The profile can be distributed as a file or downloaded over HTTP(S) with MIME type 'application/x-apple-aspen-config'.