-
Notifications
You must be signed in to change notification settings - Fork 8
Description
@mikewest thanks for taking this on, SRI really should have included signing at inception.
We currently use our own scheme for this internally, which involves publishing a pubkey via standardized DNSSEC records.
The file contents are then hashed and signed with that key, and the JS contains a header similar to:
/* { "version": "1", "id": "<key ID>", "hash": "<hash of file contents below header>" } */
Rotation and revocation is easy to manage through standardized DNS records.
DNS is a good channel from a security hygiene perspective when compared to HTTP headers: allows sites to reduce bandwidth, define their own policies around key lifetime and revocation speed, and let browsers cache these results efficiently.
One other point to consider: pinning to a single certificate or pre-set list of certificates is quite brittle and will require downstream updates to handle revocations.
Verifiers should be able to opt in to behaviors like "key X or any later version attested via DNSSEC secured record on package.my.com if X is revoked" at minimum.
Ideally you'd have a standardized intermediate / root certificate concept, so that trust is pinned to the root and intermediate certs can be used for signing and revoked without disruption.