github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/Doc/AuthenticationImplementation.txt (about) 1 In other documents, the details of how Tao can support the creation of 2 authenticated channels is left unspecified. Here are some ideas. 3 4 1. TLS PSK (Pre-Shared Keys) and OpenSSL 5 ---------------------------------------- 6 7 There are TLS suites defined that use symmetric keys for authentication, where 8 both endpoints have some shared key in common. 9 10 For example, openssl already supports: 11 TLS_PSK_WITH_AES_128_CBC_SHA 12 Ideally, to get perfect forward secrecy and GCM we could use one of: 13 TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = {0x00,0xAA}; 14 TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = {0x00,0xAB}; 15 Sadly, these aren't supported in openssl yet. 16 17 I'm going to assume that support could be easily added for these, that we could 18 find a different tls package with support for these, or that the existing PSK 19 support in openssl is good enough. 20 21 2. OpenSSL invokes Tao? 22 ----------------------- 23 24 In the symmetric key outline elsewhere, two hosted programs don't necessarily 25 share any keys in common. Instead, there is some common ancestor Tao that is 26 trusted by both endpoints and which was ultimately responsible for generating 27 the symmetric keys for each endpoint. That common ancestor Tao can do some of 28 the symmetric key operations (signing and/or verification) on behalf of one (or 29 both) endpoint programs in a way that allows the two programs to verify each 30 other's symmetric-key signatures without directly sharing a key in common. That 31 is to say, TLS-PSK isn't quite applicable. 32 33 One approach is to hack openssl (or somehow install hooks, support for which I 34 don't believe currently exist in openssl) so it talks to Tao. The idea would be 35 that that one or both endpoint programs invokes the underlying Tao during TLS 36 key exchange to do the necessary symmetric key operations. To make this actually 37 secure, however, the Tao probably needs to be involved in generating material 38 for the TLS pre-master secrets, generating and/or verifying the conversation 39 hashes, etc. The Tao API would be complex, very TLS-specific, and the security 40 properties of the resulting protocol would not be obvious. 41 42 3. Design a TLS-PSK-like protocol? 43 ---------------------------------- 44 45 Borrowing heavily from TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, we could implement a 46 protocol that uses Tao symmetric keys rather than pre-shared keys, does ECDHE 47 exchange, etc. My guess is that this would lead to a slightly less ugly Tao API 48 than simply hacking TLS, but the API would still be complex and not obviously 49 correct or credible. 50 51 4. Pass file descriptors (and TLS state) over pipes? 52 ---------------------------------------------------- 53 54 The current linux_tao_service uses pipes to connect hosted programs and the Tao. 55 It is possible to pass an open file descriptor over a pipe. Suppose two hosted 56 programs, A/path1 and A/path2, both deriving from some common Tao ancestor A, are 57 attempting to establish a TLS connection. After opening the network connection, 58 both programs could pass their open file descriptors to Tao A. Tao A could then 59 just call the regular openssl TLS-PSK initialization routines with its own 60 symmetric key, followed by a short exchange of path1 and path2 to provide each 61 endpoint with the full name of its peer. Tao A would then send the open file 62 descriptors back to the hosted programs. Unfortunately, Tao A would also need to 63 somehow transfer the TLS state to each hosted program as well. I do not know if 64 that is feasible or simple in OpenSSL. Moreover, it is a little silly to even be 65 doing TLS (ECDHE, PSK signatures, etc.) here, since the same program (Tao A) 66 fully controls both endpoints of the connection -- Tao A could just skip the 67 entire handshake, pick a premaster secret and be done with it. 68 69 5. Don't use TLS, rely on OS-secured channels. 70 ---------------------------------------------- 71 72 Within a single machine, TLS isn't actually necessary if we have some other 73 means of establishing secure channels. Linux pipes are one possibility. I think 74 this is a non-starter: it complicates support for Tao-based virtual machines, 75 for example. 76 77 6. Have Tao common ancestors perform shared key distribution? 78 ------------------------------------------------------------- 79 80 (I like this idea best.) 81 82 Tao can serve as the trusted third party in a session key distribution protocol, 83 ala kerberos, 3PKD (http://seclab.cs.ucdavis.edu/papers/Rogaway/3pkd.pdf), etc. 84 85 As a simplified example, suppose hosted programs A/path1 and A/path2 would would 86 like to communicate, and both share a common ancestor Tao A. Then Tao A can 87 generate a shared symmetric key for the two programs roughly as follows. 88 Programs A/path1 and A/path2 connect and exchange their full names. 89 Each program now has both key names, A/path1 and A/path2. 90 Each program invokes some common ancestor A, giving it the two paths. 91 Tao A verifies that the invoking program is one of the two paths. 92 Tao A computes the longest common prefix of the two paths. 93 Tao A generates the key corresponding to A/prefix 94 Tao A generates the key corresponding to A/prefix/merge 95 where merge is computed based on the two suffixes of path1 and path2, 96 e.g. Hash(join(sort([path1suffix, path2suffix]))). 97 Tao A returns the computed key to both A/path1 and A/path2. 98 The two hosted programs can then use TLS-PSK with that common key. 99 After the TLS handshake, both programs know they must be talking to the 100 opposite program, since Tao A gave the key only to A/path1 and A/path2. 101 102 Another way to think of this is that Tao is providing "group" shared symmetric 103 keys, similar to how Tao can provide per-program shared symmetric keys. In this 104 view, a hosted program can invoke the Tao with a list of group members; if the 105 calling program is among the group members, then the Tao will return a symmetric 106 key that corresponds to that group. A caveat is that the Tao so invoked must be 107 a common ancestor (hence trusted) by all members of the group. In the TLS 108 example above, the group is always 2 members: the invoking program plus the peer 109 to which it is trying to establish a secure channel. 110 111 112 7. Long-Lived vs. Short-Lived Keys 113 ---------------------------------- 114 115 We don't currently specify how keys can be revoked, rotated, etc. And although 116 we are careful to use DHE-based TLS because it has perfect forward secrecy, we 117 don't have any provisions for dealing with a compromised policy key, tao key, 118 program key, etc. Session key distribution protocols do a much better job of 119 this, distinguishing short-lived session keys, long-lived user keys (password), 120 and expiration/rotation of both kinds of keys. 121 122 Ideal: 123 * The (public) names used in policies, audit logs, etc. are long lived, 124 even if corresponding keys aren't. 125 * Most/all keys can be expired, revoked, and/or rotated. 126 * Exposure of a single key should have limited impact. Larger impact should 127 correspond to better protected. 128 129 130 Current: 131 * Policy key pair (long lived) 132 * AIK for each machine (long lived) 133 * keys for each linux tao service (long lived) 134 * Policy mentions AIK_pub, Tao_pub directly 135 * Sealed data contains program hash (long lived) 136 * Keys for each hosted program ID, sealed by Tao (long lived) 137 138 Problem: 139 - If we have a whole structure of sym keys, if we change the root one, we lose 140 the ability to generate or verify any signatures. So put the version numbers in 141 the names, introduce the new key version, start using the new keys and new 142 names, and slowly expire the old key. 143 144 Proposal: 145 * Most everything is done online, with the exception of a single long-lived 146 policy root key pair: 147 PolicyRoot 148 And a globally-unique name for this key, 149 PolicyRootName = f(PolicyRoot_pub) // maybe just base64-encode, maybe hash for compactness, etc. 150 * PolicyRoot signs a series of policy keys and (possibly overlapping) validity 151 periods: 152 Policy_1, Policy_2, ... 153 Policy_Epoch_1, Policy_Epoch_2, ... 154 Policy_Cert_i = Sign(PolicyRoot_priv, i | Policy_i | Policy_Epoch_i | ...) 155 We might use as a name for each key: 156 PolicyRootName_i = f(Policy_i_pub) 157 But then we can't predict the names without the keys already generated, and we 158 can't quantify over the names since they aren't related and have no structure. 159 An alternative public long-lived name for each policy key is: 160 PolicyRootName_i = (PolicyRootName, i) 161 Here we can quantify over i to get all the future and past names. 162 * Each machine generates a new M_AIK_j periodically, gets it certified 163 M_AIKCert_j by the current Policy_i key with a validity period M_AIK_Epoch_j 164 that is a subset of Policy_Epoch_i, generates a corresponding sym key M_Sym_j 165 to use as a sym key generator, seals that under the same PCRs. As a name for 166 this machine, we can use 167 MName_j = f(M_AIK_j_pub) 168 or better: 169 MName_j = (PolicyRootName, i) | (m, j) 170 where m is a per-machine name added to M_AIK_Cert_j. 171 * To implement TPM::GetSymKey(ver=v), use M_Sym_j to generate a key, and name it 172 LinuxName = (PolicyRootName, i) | (m, j) | (OS, v) 173 * Each linux_tao_service periodically asks TPM for a new SymKey, then uses it 174 to generate signing, sealing, and derivative keys. 175 * Each program does LinuxTao::GetKey(ver=k) and has the name: 176 ProgName = (PolicyRootName, i) | (m, j) | (linux, v) | (prog, k) 177 178 Policies can be written with quantifications for the version numbers if desired. 179 Maybe even have creation times, epoch numbers, etc., encoded into version 180 numbers, so we can quantify over epoch so compromised older keys can't issue 181 currently-useful certificates. Also, expiration encoded into names of sym keys 182 lets us do intersection of expirations at all levels. 183 184 Q: Can tpm implement GetKey()? Use AIK to quote some string, e.g. "get my key", 185 hash the resulting signature and use the result as AES key material. (Or use a 186 TPM-based encryption key to encrypt the same string.) Nobody without AIK w/ 187 proper pcrs can know sig unless we tell them (otherwise they could forge AIK 188 signature). Nobody can guess hash without sig. Unfortunately TPM signatures are 189 not deterministic, nor are encryptions. When we generate an AIK, we could also 190 generate an AES key in software, seal it under the same PCRs as the AIK, then 191 use it for future key generation. 192 193 Q: If we are goint to use sym keys for sealing long-term data, that data needs 194 to be migrated upwards when we re-key. How? 195 - for online services with short term or active data, just use sym key and 196 re-encrypt as needed during rekey operations 197 - for long term, idle data maybe use a service that seals to a policy? This is 198 what seal should be about --> seal is resistant to rekeying. 199 But how can evey tao provide this service... either need a long-term 200 encryption key (maybe a separate one just for sealing? but why have 2 keys...) 201 ... or reseal during key regen (requires resource accounting at tao)... or 202 better use per-seal-op keys, escrowed somehow with long-term keys? 203 this sounds like a network svc, not a primitive offered by each Tao 204 cTPM suggests using a "cloud srk" 205 206 Global Audit Log (see http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.123.2142&rep=rep1&type=pdf) 207 * Goal is to simply provide a one-way audit log. 208 * Rekey on each log update (or on interval) 209 * Forward secrecy is actually backwards, in a sense, from what I am worried 210 about with rekeying and expiration. If current key is exposed, attacker is 211 prevented from messing with historical stuff. I'm more worried about if old 212 keys are compromised, attacker can mess with current stuff. 213 214 215 8. Hierarchy: Tao vs CloudProxy 216 ------------------------------- 217 218 Q: Is the root Tao on a machine part of only a single policy domain? 219 A: Likely not, esp. with evmm. Instead, evmm has policies for launching guest 220 OS+tao, which may each be part of a different cloud-policy domain. 221 222 Q: May a Tao have more than one host Tao? 223 Disucssion: Maybe these two should be the same: 224 M1/EVMM(pcrs)/Guest(linux_i) 225 CloudPolicy/Platform_j 226 i.e. the guest has two hosts, one local and one remote. 227 And maybe the set of policies this guest can enforce is a function of the hosts 228 it has. So M1 and M1/EVMM(pcrs) can't do cloud policies, but guest can b/c it is 229 part of cloud. 230 Conclusion: Tao and CloudProxy (CloudTao?) are different. Tao layers form a 231 subprin relationship based on hardware roots of trust, with full and unavoidable 232 trust between layers. CloudTao on the other hand have a trust relationship (esp. 233 when it comes to authentication), but it isn't full trust, and you can imagine 234 guest maintaining secrets that are safe even from the cloud policy. CloudTao 235 layers are not subprins, and they aren't necessarily even layered. Communication 236 certainly doesn't primarily happen up/down in cloud layers, it might happen 237 mostly sideways. 238 239 Conclusion: Tao api should be concerned with things that relate to subprin 240 relationship, things only the parent can do. Attestation of child properties, 241 for example. Maybe secrets (sealing/unsealing) bound to specific 242 children/descendents. Maybe communication between children/descendents. But 243 cloud-related stuff should be done by CloudTao, which provides other services 244 and a different trust relationship. Cross-machine authentication is a CloudTao 245 service, not a Tao service. 246 247 Observation: StartHostedProgram (and kill) is not Tao generic. Every Tao has 248 children, but they are spawned in completely different ways. We have 3 Tao 249 layers (TPM, EVMM/KVM, Linux) and can imagine more (Chrome, Java, Python, etc.). 250 None of them have much similarity in the spawning or initialization of hosted 251 programs. 252 253 9. Next Steps 254 ------------- 255 256 Start defining useful cloud services, see what we need from each layer? 257 - useful seal/unseal 258 - append-only log 259 - key rotation service 260 - authentication/kdf/pkd service 261 262 Logger 263 - connect via network (i.e. TLS) 264 - connect via local pipe? 265 - client authentication (as src of log messages) 266 - optional server authentication (confidentiality of log messages) 267 268 AuditLog 269 - same as logger, but specialized for authorization decisions 270 - configurable in what info it keeps about each decision, e.g. statistics only, 271 or full evidence, etc. 272 273 Rendezvous 274 - Given a fully qualified service name, get a network location 275 - register services 276 - policy for who can claim to be what 277 278 Key epoch manager or time service or something? 279 - coordinates/facilitates key rotation, expiration, etc. 280 281 CloudStorage 282 - seal/unseal abstraction 283 - flexible, cross-machine policies 284 - maybe versioning, timestamping, etc. 285 - maybe monotonic counters 286 287 CloudCounter 288 - monotonic counters 289 - for cert serial number generation, boot counters, etc. 290 - integer based, hash based, etc. 291 - automatic logging? 292 293 HttpsCertificateManager 294 - hands out x509 certificates 295 - uses 296 - policy to decide pcr/hash -> name:port mappings 297 - https public interface with audit log of all certs it has ever given out 298 299 App ideas: FileProxy? Nah. 300 301 App ideas: TimeCapsule service 302 - think: password protected zip, but with policy instead of password 303 - web facing 304 - client wants to encrypt data indefinitely (e.g. escrow) 305 - client specifies data 306 - client specifies policy, e.g.: 307 - after date x, reveal key to anyone that asks 308 - with consent of threshold parties 309 - policies that depend on date, etc. 310 - multiple passwords 311 - audit log of open attemps and successes 312 - try not to link data and key so svc is trusted a little bit less (e.g. it 313 never sees the data) 314 - Q: Can we effectively *freeze* the policy? Somehow guarantee disclosure? 315 316 App ideas: Witness/NotaryPublic 317 - web-facing 318 - timestamps and signs anything you submit 319 - public audit log? 320 - linked for sequencing? 321 322 App ideas: WebWitness 323 - think: proof that web page existed 324 - like witness, but given a URL, fetches page, renders, takes 325 screenshot, signs screenshot and full html 326 327 App idea: xkcd password generator 328 329 App ideas: Key Distribution Server (see tom) 330 App ideas: Key-value store 331 332 Q: How to do x509 for https? 333 TPM is expert on pcrs, pcrs are expert on proghash, etc. 334 Each layer attests the next. 335 So we get full tao (non-x509) chain of sigs: 336 tpmkey -> pcrs -> proghash -> ... 337 To get x509, we have to use: 338 httpsroot -> ... -> witness.com 339 But then we lose the tpmkey, pcrs, proghash, etc. 340 So who holds httpsroot priv key? CA-prog, for which there is a tao chain. 341 342 So run CA-prog, which gets a tao chain for tao key, generates httpsroot, seals 343 priv, attests to httpsroot using its own tao key, and we now have full tao chain 344 tpmkey -> pcrs -> proghash -> taokey -> httpsroot 345 publish that tao chain. Anyone who cares can look at that tao 346 chain to be convinced that httpsroot is held by a legit CA-prog (configured with 347 reasonable name policy). 348 349 CA-prog + naming policy then generates x509 cert for witnesskey @ witness.com:80 350 after having been convinced by witness-prog tao chain: 351 tpmkey -> pcrs -> proghash -> taokey -> witnesskey 352 353 So user sees x509 chain: 354 httpsroot -> witness.com 355 And if they care, they can click on link to get tao chains 356 tpmkey -> pcrs -> proghash -> taokey -> httpsroot 357 tpmkey -> pcrs -> proghash -> taokey -> witnesskey 358 359 360 (1) Witness 361 Goal: client connects to witness.com 362 with https secure pubkey witness_pub 363 certified for witness.com:80, 364 details friendly name is http-witness 365 details full name prog_hash+os_hash+pcrs+tpm_key 366 (this program is trustworthy for being a witness) 367 expiration ... 368 by Google(Witness)TaoHttpsCertManager 369 certfied for CA 370 details friendly name is tao-https-certifier 371 details full name prog_hash+os_hash+pcrs+tpm_key 372 (this program is trustworthy on pcr<-->dns bindings) 373 (and also trustworthy on friendly name) 374 (and also trustworthy on hash/os/pcr/tpmkey) 375 expiration ... 376 by Google(Witness)PolicyMgr 377 (and also trustworthy on friendly name) 378 (and also trustworthy on hash/os/pcr/tpmkey) 379 by Google(Witness)Tao 380 (and also trustworthy on hash/os/pcr/tpmkey) 381 - above is trouble... 382 - GoogleTao HTTPS ca key, offline? 383 - Generate Witness HTTPS ca cert, self signed? 384 - Generate domain policy key 385 - offline sign policy that says 386 [machine and OS setup] 387 - any of the following machines (tpm aik) is okay 388 - any of the following os (evmm and/or linux hash) is okay 389 - only the following progs can run 390 [some named groups] 391 - any of the following prog speak for <policy.httpcert> 392 [https cert policy] 393 - policy.httpcert can mint x509 certs under 394 - Generate HttpsCertificateManager key, certify it offline with policy key, 395 seal private under a policy that says: 396 - depends on HttpsCertificateManager service 397 398