A Private pkg Repo Behind Mutual TLS
11 points by 0mp
11 points by 0mp
mTLS is pretty great! It does seem criminally underutilized... I feel like we've all been told to believe certificates are radioactive and should never be touched.
+1.
I like how some of the DNS RFCs define using mTLS where you verify just the public key's hash, rather than the usual cert verification (chain, SAN, expiry, etc.), e.g. RFC7858.
I do this for DNS UPDATEs to my authoritative nameserver: mTLS, verifying only the public keys, and it's supported out-the-box with the client and server tools provided by Knot DNS.
$ knsupdate -p 853 --tls --pin FHkyLhvI0n70E47cJlRTamTrnYVcsYdjUGbr79CfAVI= --certfile ecdsa_cert.pem --keyfile ecdsa_key.pem
That pin flag is the client verifying the server's X509 cert's pubkey's hash (the "pin"). Knot DNS self-signed the cert and just provide you with the pin. (You can of course provide it a cert/key that is signed by a CA, if you prefer).
On the server side, Knot DNS's ACL has a cert-key field for allowlisting particular client public keys.
This gives the ease of SSH/Wireguard-style key distribution, without caring about the other fields in the cert.
Most computing professionals can't handle basic cryptography administration. The only reason HTTPS generally works is the OS/browser manage the trust store.
Similar convenience is coming to mTLS too: https://spiffe.io/
The idea is that your environment (your service orchestrator, your CI, your OS, ...) issues your jobs with X.509 (or JWT) credentials to authenticate against external services.
The typical implementation of "CI job with privileges" is:
This works, but has limitations:
With SPIFFE, my CI server will issue my CI job with credentials, e.g. a cert signed by codeberg.org with identity "tuxes/my-cool-project"
The steps becomes:
tuxes/my-cool-project).Success!
At first glance it looks odd to have my server trust certs signed by codeberg.org, but the trust story is no different: my CI already knows the secrets in either case. De facto, I trust the CI server.
Of course, you can always use the existing method, or even use the SPIFFE creds to exchange for your preferred creds (and the trust story is no different).