certifix/README

33 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-09-25 09:20:14 +00:00
A small HTTPS API that accepts X509 CSRs and signs them if they
contain the magic number.
Modelled on the Puppet CA "Policy-based autosigning" functionality,
but without the rest of Puppet
[ This README is speculative ]
2024-09-25 11:01:21 +00:00
## Try it out
2024-09-25 09:20:14 +00:00
2024-09-25 11:01:21 +00:00
```
# create CA key and cert
openssl genrsa -out ca.key 4096
CN=CA openssl req -config openssl.cnf -x509 -new -nodes -key ca.key -sha256 -days 3650 -out ca.crt
2024-09-25 09:20:14 +00:00
2024-09-25 11:01:21 +00:00
# create client CSR
CN=rotuer openssl req -config openssl.cnf -newkey rsa:2048 -nodes -keyout client.key -out client.csr
2024-09-25 09:20:14 +00:00
2024-09-25 11:01:21 +00:00
# start the server
bin/certifix
2024-09-25 09:20:14 +00:00
2024-09-25 11:01:21 +00:00
# send it
2024-09-25 09:20:14 +00:00
2024-09-25 11:01:21 +00:00
curl -v -H 'content-type: application/x-pem-file' --data-binary @client.csr http://localhost:8201/sign
```
2024-09-25 09:20:14 +00:00
https://www.puppet.com/docs/puppet/7/ssl_attributes_extensions#csr_custom_attributes-recommended-oids-custom-attributes
Custom attributes can use any public or site-specific OID, with the exception of the OIDs used for core X.509 functionality. This means you cant re-use existing OIDs for things like subject alternative names.
One useful OID is the challengePassword attribute — 1.2.840.113549.1.9.7. This is a rarely-used corner of X.509 that can easily be repurposed to hold a pre-shared key.