|
| 1 | +# Transparency Exchange API - Trusting digital signatures in TEA |
| 2 | + |
| 3 | +Software transparency requires a trust platform so that users |
| 4 | +can validate the information and artefacts published. Given |
| 5 | +the situation today any information published is better than |
| 6 | +none, so the framework for digital signatures will not |
| 7 | +be mandatory for API compliance. Implementations may |
| 8 | +require all published information to be signed and |
| 9 | +validated. In some vertical markets branch standards may require |
| 10 | +digital signatures. |
| 11 | + |
| 12 | +Within the TEA API documents may be signed with an electronic |
| 13 | +signature. CycloneDX Documents support [signatures](https://cyclonedx.org/use-cases/#authenticity) within |
| 14 | +the JSON and XML files, but other artefacts may need external |
| 15 | +signature files, a detached signature. |
| 16 | + |
| 17 | +## Requirements |
| 18 | + |
| 19 | +Digital signatures provide integrity and identity to published data. |
| 20 | + |
| 21 | +- __Integrity__: Documents dowloaded must be the same |
| 22 | + as documents published |
| 23 | +- __Identity__: Customers need to be able to verify the |
| 24 | + publisher of the documents and verify that it is |
| 25 | + the expected publisher. |
| 26 | + A TEA server may want to verify that published |
| 27 | + documents are signed by the expected publisher |
| 28 | + and that signatures are valid. |
| 29 | + |
| 30 | +In order to sign an object, a pair of asymmetric keys will be |
| 31 | +needed. The public key is used to create a certificate, signed |
| 32 | +by a certificate authority (CA). The private key is used for |
| 33 | +signing and needs to be protected. |
| 34 | + |
| 35 | +A software publisher may buy CA services from a commercial vendor |
| 36 | +or set up an internal PKI solution. The issue with internal PKIs is that |
| 37 | +external parties do not automatically trust that internal PKI. |
| 38 | + |
| 39 | +This document outlines a proposal on how to build that trust and |
| 40 | +make it possible for publishers to use an internal PKI. It is |
| 41 | +of course important that this PKI is maintained according to |
| 42 | +best current practise. |
| 43 | + |
| 44 | +## API trust |
| 45 | + |
| 46 | +The TEA API is built on the HTTP protocol with TLS encryption |
| 47 | +and authentication, using the `https://` URL scheme. |
| 48 | + |
| 49 | +The TLS server certificate is normally issued by a public Certificate |
| 50 | +Authority that is part of the Web PKI. The client needs to validate |
| 51 | +the TLS server certificate to make sure |
| 52 | + |
| 53 | +- that the certificate name (CN or Subject Alt Name) matches the |
| 54 | + host part of the URI. |
| 55 | +- that the certificate is valid, i.e. the not-before date and the |
| 56 | + not-after date is not out of range |
| 57 | +- that the certificate is signed by a trusted CA |
| 58 | + |
| 59 | +If the certificate validates properly, the API can be trusted. |
| 60 | +Validation proves that the server is the right server for the |
| 61 | +given host name in the URL. |
| 62 | + |
| 63 | +This trust can be used to implement trust in a private PKI |
| 64 | +used to sign documents delivered over the API. |
| 65 | + |
| 66 | +In addition, trust anchors can be |
| 67 | +published in DNSsec as an extra level of validation. |
| 68 | + |
| 69 | +## Getting trust anchors |
| 70 | + |
| 71 | +Much like the EST protocol, the TEA protocol can be used |
| 72 | +to download trust anchors for a private PKI. These are |
| 73 | +PEM-encoded certificates in one single text file. |
| 74 | + |
| 75 | +The TEA API has a `/trust-anchors/` API that will download |
| 76 | +the current trust anchor APIs. This file is not signed, |
| 77 | +that would cause a chicken-and-egg problem. The certificates |
| 78 | +in the file are all signed. |
| 79 | + |
| 80 | +An implementation should download these and apply them only |
| 81 | +for this service, not in global scope. A PKI valid for example.com |
| 82 | +is not valid for example.net. |
| 83 | + |
| 84 | +Note that the TEA api can host many years of documents for |
| 85 | +published versions. Old and expired trust anchors may be needed |
| 86 | +to validate digital signatures on old documents. |
| 87 | + |
| 88 | +## Validating the trust anchors using DNSsec (DANE) |
| 89 | + |
| 90 | +## Digital signatures |
| 91 | + |
| 92 | +### Digital signatures as specified for CycloneDX |
| 93 | + |
| 94 | +> "Digital signatures may be applied to a BOM or to an assembly within a BOM. |
| 95 | +> CycloneDX supports XML Signature, JSON Web Signature (JWS), and JSON Signature Format (JSF). |
| 96 | +> Signed BOMs benefit by providing advanced integrity and non-repudiation capabilities." |
| 97 | +<https://cyclonedx.org/use-cases/#authenticity> |
| 98 | +
|
| 99 | +### External (detached) digital signatures for other documents |
| 100 | + |
| 101 | +- indication of hash algorithm |
| 102 | +- indicator of cert used |
| 103 | +- intermediate cert and sign cert |
| 104 | + |
| 105 | +### Validating the digital signature |
| 106 | + |
| 107 | +## Using Sigstore for signing |
| 108 | + |
| 109 | +Sigstore is an excellent free service for both signing of GIT commits as well |
| 110 | +as artefacts by using ephemeral certificates (very shortlived) and a |
| 111 | +certificate transparency log for validation and verification. |
| 112 | +Sigstore signatures contain timestamps from a timestamping service. |
| 113 | + |
| 114 | +Sigstore lends itself very well to Open Source projects but not really |
| 115 | +commercial projects. The Sigstore platform can be deployed internally |
| 116 | +for enterprise use, but in that case will have the same problem as any |
| 117 | +internal PKI with establishing trust. |
| 118 | + |
| 119 | +## Suggested PKI setup |
| 120 | + |
| 121 | +### Root cert |
| 122 | + |
| 123 | +#### Root cert validity and renewal |
| 124 | + |
| 125 | +### Intermediate cert |
| 126 | + |
| 127 | +#### Intermediate cert validity and renewal |
| 128 | + |
| 129 | +### Signature |
| 130 | + |
| 131 | +#### Time stamp services |
| 132 | + |
| 133 | +### DNS entry |
| 134 | + |
| 135 | +## References |
| 136 | + |
| 137 | +- IETF RFC DANE |
| 138 | +- IETF DANCE architecture (IETF draft) |
| 139 | +- IETF Digital signature |
| 140 | +- JSON web signatures (JWS) - <https://datatracker.ietf.org/doc/html/rfc7515> |
| 141 | +- JSON signature format (JSF) - <https://cyberphone.github.io/doc/security/jsf.html> |
| 142 | +- [IETF Enrollment over Secure Transport (EST) RFC 7030](https://www.rfc-editor.org/rfc/rfc7030) |
0 commit comments