Pantavisor now trusts the six largest public CAs, not just Let's Encrypt

Pantavisor used to trust only one certificate authority: Let’s Encrypt. A device could reach Pantacor Hub, but not an HTTPS server whose certificate came from another CA. meta-pantavisor now ships the root certificates of the six largest public CAs, taken from the Mozilla bundle. Most builds need to do nothing: the new roots come with the next build of meta-pantavisor master.

The change is feat(libthttp): ship the root CAs of six large public CAs by asac · Pull Request #574 · pantavisor/meta-pantavisor · GitHub.

What is in the trust store?

Pantavisor checks the TLS certificate of every server it connects to against the roots in /etc/thttp/certs on the device. That directory now holds 25 roots:

CA Roots
Let’s Encrypt (ISRG) ISRG Root X1, X2
DigiCert Global Root G2, G3; TLS RSA4096 Root G5; TLS ECC P384 Root G5
Sectigo USERTrust RSA and ECC, COMODO RSA and ECC, Public Server Authentication Root R46 and E46
GlobalSign Root CA R3, R6; ECC Root CA R4, R5; Root R46, E46
Google Trust Services GTS Root R1, R3, R4
Amazon Amazon Root CA 1, 2, 3, 4

Every CA has RSA roots in the list, and the newest roots run until 2046.

Checking a device

ls /etc/thttp/certs
grep truststore /pv/logs/<revision>/pantavisor/pantavisor.log

The log line reads Found 25 http x509 certs in truststore.

Adding or removing a root

The list is the PV_TLS_CA_CERTS variable in recipes-pv/libthttp/libthttp_git.bb. Each entry is a file name from the Mozilla bundle in /usr/share/ca-certificates/mozilla/, without .crt. To add one, from a kas local_conf_header or a bbappend:

PV_TLS_CA_CERTS:append = " Microsoft_RSA_Root_Certificate_Authority_2017"

When Mozilla retires an old root, the build skips it with a warning, so updating ca-certificates never breaks the build.

How it was tested

Besides the usual CI and the full remote pvtest suite against Pantacor Hub, we pointed an appengine device at other servers instead of the Hub:

Server Root Result
www.google.com GTS Root R1 connects
s3.amazonaws.com Amazon Root CA 1 connects
github.com USERTrust RSA (Sectigo) connects
www.microsoft.com DigiCert Global Root G2 connects
www.identrust.com IdenTrust (not in the list) refused
www.actalis.it Actalis (not in the list) refused

Limits to know about

  • Key exchange. Pantavisor’s TLS library only uses plain RSA key exchange. Servers that require ECDHE (forward secrecy) refuse the connection, whatever their CA. Many large sites still accept RSA key exchange; some, like www.digicert.com, do not. Enabling ECDHE is the next step.
  • No clock checks. Devices often have no reliable clock, so Pantavisor does not check certificate dates. An expired root keeps working on the device, so roots only leave the list through a BSP update.

Older releases

The change is in the libthttp recipe only, so it can be picked onto older meta-pantavisor releases. They load the certificate directory the same way.

What’s next

A certificate denylist is in review. It will let a BSP update block a single server, intermediate or root by its public key, without needing a clock: feat(tls): block certificates listed in a denylist by asac · Pull Request #5 · pantavisor/libthttp · GitHub and feat(tls): add a certificate denylist for HTTPS connections by asac · Pull Request #864 · pantavisor/pantavisor · GitHub.

Trusting 25 roots across six CAs is a big step from one, and since the device checks neither dates nor revocation, a compromised or mis-issuing CA stays usable until the next BSP update. The denylist handles known-bad certificates but not a CA that starts misbehaving. A build-time switch to keep a narrow list, or to pin a specific CA per product, would let constrained deployments opt out of the wider default without forking the recipe.

Thanks, good point. That switch already exists, our post just only showed how to add a root. PV_TLS_CA_CERTS is a default (?=), so a product can replace the whole list rather than append to it. The build then installs only those roots in /etc/thttp/certs:

# kas local_conf_header or a libthttp bbappend: trust Let's Encrypt only
PV_TLS_CA_CERTS = "ISRG_Root_X1 ISRG_Root_X2"

Keep the ISRG roots if the device talks to Pantacor Hub. Beyond that you can narrow the list to the one CA your own servers use. To pin a private CA that isn’t in the Mozilla bundle, install its PEM file into /etc/thttp/certs from a do_install:append in a libthttp bbappend.

The wider list is only the default for builds that don’t choose. On a CA that starts misbehaving: without a reliable clock, pantavisor can’t check revocation, so for now the answer is a narrow list per product plus a BSP update. Once the denylist lands (still in review), that gets finer: it checks every certificate in the chain, so a BSP update can block a single intermediate by its public key and keep the rest of that CA.

Would that be enough for your use case? If you’d rather ship a certificate package you build yourself instead of using our list, we could add a VIRTUAL-RUNTIME name for it. You would then set VIRTUAL-RUNTIME_pv_tls_certs = "your-ca-certs" and our package would drop out of the image. Let us know if that would help.

Update: the certificate denylist has landed (feat(tls): block certificates listed in a denylist by asac · Pull Request #5 · pantavisor/libthttp · GitHub, feat(tls): add a certificate denylist for HTTPS connections by asac · Pull Request #864 · pantavisor/pantavisor · GitHub) and is in meta-pantavisor master.

Each line of the denylist file is the SHA-256 of a certificate’s public key:

openssl x509 -in cert.pem -pubkey -noout | openssl pkey -pubin -outform DER | sha256sum | cut -d' ' -f1

Pantavisor reads /etc/thttp/denylist by default. Ship it from a do_install:append in a libthttp bbappend, or point PV_LIBTHTTP_DENYLIST at another file from pantavisor.config, a policy, OEM config or an environment variable (not from pantahub.config). The file is read at start-up: a revision that changes OEM config reboots anyway, and after editing the file itself, reboot. A listed server, intermediate or root certificate makes the connection fail.

Check it with grep denylist /storage/logs/current/pantavisor/pantavisor.log, which shows loaded N certificate denylist entries from … or no certificate denylist at …. Details: pantavisor/docs/overview/certificate-denylist.md at master · pantavisor/pantavisor · GitHub

A correction to the post above: newer builds no longer log Found 25 http x509 certs in truststore. Use ls /etc/thttp/certs to check the roots.