20:00:14 #startmeeting barbican 20:00:14 Meeting started Mon Nov 24 20:00:14 2014 UTC and is due to finish in 60 minutes. The chair is redrobot. Information about MeetBot at http://wiki.debian.org/MeetBot. 20:00:15 Useful Commands: #action #agreed #help #info #idea #link #topic #startvote. 20:00:18 The meeting name has been set to 'barbican' 20:00:36 #topic Roll Call 20:00:43 o/ 20:00:47 o/ 20:00:48 o/ 20:00:51 o/ 20:00:53 o/ 20:00:53 o/ 20:00:54 o/ 20:00:59 ¯\_(ツ)_/¯ 20:01:03 hi 20:01:03 hi, visiting from sahara land, hoping to soak up some knowledge =) 20:01:13 o/ 20:01:18 o/ 20:01:21 elmiko welcome! 20:01:24 o/ 20:01:25 bknudson: yo 20:01:30 o/ 20:01:32 woohoo! lots of barbicaneers here today 20:01:39 how many of us are actually supposed to be on vacation? 20:01:49 1,2,3 not it 20:01:57 USE YOUR ETO FOR ETO (╯°□°)╯︵ ┻━┻ 20:02:07 whats "vacation" ? 20:02:08 rm_work lol 20:02:17 as usual the agenda can be found here: 20:02:19 #link https://wiki.openstack.org/wiki/Meetings/Barbican 20:02:21 ┬─┬ノ( º _ ºノ) chill out dude 20:02:30 lol, dafuq 20:02:33 :P 20:03:02 Weve got a couple of things on the agenda for today 20:03:02 Sorry, I thought this was the 7030 meeting... 20:03:14 #topic Validation for Typed Container data (Certificates, etc) 20:03:22 rm_work you wanted to talk about this? 20:03:33 So, do we think this is a feasible thing to move onto the Barbican side? 20:03:38 hyakuhei we talked about it last week 20:03:47 There is some work associated with this (ie, processing time on the API nodes) 20:04:19 But I think that on a user creation of a CertificateContainer and the like, we should have validators to make sure the data is actually... correct for that container type 20:04:27 What do other people think? 20:04:44 Checking there's a key and a cert and possibly a passphrase? that sort of thing? 20:04:48 yeah 20:04:59 and checking that theyre functionally correct? 20:05:02 yes 20:05:05 and match each other 20:05:06 ie right key for cert? 20:05:08 ok cool 20:05:08 yep 20:05:16 sounds reasonable to me 20:05:17 and the cert isn't actually a recipe for a quiche 20:05:24 a SECRET recipe 20:05:27 lol 20:05:38 Hmm, that gets harder 20:05:44 I mean, validating ASN.1 20:05:53 and checking some fields are present maybe? 20:06:03 but you can abuse X509 in so many ways :D 20:06:04 not sure how deep we want to get 20:06:18 When you certificates do we just mean x.509 or other types of certs too? 20:06:32 what we're doing for Octavia is just attempting to load up the cert as an x509 object with pyOpenSSL and using the passphrase passed to us 20:06:49 and if it loads, success! then we make sure the PK is for the cert 20:07:03 rm_work, while creating container we just provide reference to the cet, passwd etc... 20:07:05 I agree with hyakuhei with ASN.1 validation 20:07:07 cert 20:07:08 but initially, I don't think we could do anything more than very basic checks like that 20:07:08 Seems like a reasonable firt step 20:07:19 atiwari: yeah, so that's one of the complications 20:07:21 Get the plumbing right and we can work on clever checks later ? 20:07:25 rm_work this sounds similar to the content type work that I have been working on 20:07:27 we'd have to actually retrieve the secret data 20:07:43 since as atiwari points out, we don't have it directly 20:07:49 rm_work, then what to validate. Actual reference? 20:07:50 are there security concerns there? 20:08:30 would it be possible to do it by doing some pre-parsing on secret data and filling in some meta fields, so we could do some validation without actually examining the secret payload? 20:08:39 I don't actually know, I am speculating 20:08:47 rm_work, so I understand - when would these validations be triggered? when the secret is added to a certificate container? 20:08:54 pre-parsing ie on the client end? 20:08:57 alee_: yeah, for Container creation 20:09:10 hyakuhei: might have to be server, to be consistent 20:09:16 since not everyone will use the python client 20:09:24 which is a performance concern 20:09:41 Sure, I was just looking for clarification 20:09:43 I wanted this topic brought up so we could figure out what problems this would have and if it's even feasible :) 20:10:11 rm_work, are you thinking of pulling the secret and check is that is x509 cert or not? something like that? 20:10:13 hyakuhei: but yes, essentially just the basic plumbing would be a great start 20:10:25 atiwari: that is the most obvious way, yeah 20:10:27 rm_work, so you add a certificate container, then you add a private key ref, then you add a public key ref? and when you add the public key, the checks get triggered? 20:10:32 not sure if that is a performance/security concern 20:10:52 alee_: err, the CertContainer creation is one operation 20:11:00 hmmm...given that secrets are created first, maybe we'd want the metadata to be specific/validated at that level, and then when put into container just check the secret metadata is as expected? 20:11:02 I'm talking about server-side here 20:11:02 I'm not sure we want to be in the business of decrypting secrets during container creation. 20:11:12 redrobot: right, that is concerning 20:11:17 woodster_ +1 20:11:18 woodster_: metadata of that type leaks information about the secret 20:11:23 woodster_: yes, that was what I was proposing above 20:11:27 alee_, I think process is other way. first you add cert, keys and then create container 20:11:33 but reaperhulk is also correct :P 20:12:12 yeah, CertContainer creation is: 1) All secrets created and stored. 2) Container created with refs to all required secrets. 20:12:27 reaperhulk, are you arguing for no enforced/validated metadata on the secret as now? Then when put into a typed container, isn't that info still being leaked? 20:12:50 rm_work, is there any BP or use case defined anywhere? just to understand the details. 20:12:54 are we talking about Typed Secrets now? 20:12:58 CertSecret? 20:13:05 or are we just talking about reference validation here...that the secrets reside within the same barbican endpoint? 20:13:18 woodster_: well, I am talking about functional validation 20:13:49 atiwari: so for Octavia / LBaaS, we need to know that when a user gives us a ref to a Barbican CertificateContainer, that we will have a valid set of data 20:14:05 so we don't accept it and then pull the cert and end up trying to start up HAProxy with a quiche recipe 20:14:21 rm_work, OK so you are taking about an existing container? 20:14:22 well, if that functional validation isn't keyed to some metadata about the secret, then your only choice is container validation...i.e. you said this secret was a public key, let's verify that before adding to this container 20:14:29 or present a cert that isn't the correct cert for the PK we're using 20:15:00 rm_work so what would be the benefit of having Barbican do this server side, vs Octavia validating the bytes it retrieves from Barbican? 20:15:07 woodster_: right, which would require decryption of secrets at container creation time, which as redrobot said could be a security and performance issue 20:15:39 redrobot: so, we CAN do it on our side. I wanted to gauge the feasibility of doing it Barbican side 20:15:54 as I see this kind of check being duplicated in almost every use case 20:16:11 if we don't think it can be done... then that sucks, but it's not the end of the world 20:16:15 rm_work, I can see trying to do some kind of validation when the cert container is created - because you have the relevant references ... but if you're going to do something like check if something encrypted by hte private key can be decrypted by the public, 20:16:34 then you're talking about decrypting the secrets within the barbican server 20:16:46 alee_: yeah, that is the kind of check we're doing on our side... and yes, I can see the dilemma 20:17:01 woodster_, how about adding an extension on container "/container//validate" and we will do the run time validation ? 20:17:23 rm_work, I'd rather decrypt on the client. The client after all has access to the secret 20:17:24 Lbaas can call this before using the contianer 20:17:37 rm_work: really wouldn't dig decrypting the secrets within the server :/ 20:17:42 I'd worry about DDoS but that could be throttled I think 20:17:46 jaosorior: yeah I know 20:18:06 why didn't you wanna do it in the client side again? 20:18:08 alee_: ok, so just build that validation into the python client? 20:18:21 atiwari, or maybe have a validate order so we can do this stuff asynchronously.... 20:18:22 rm_work thats what I was about to suggest 20:18:23 jaosorior: well, it depends on what you mean by client side 20:18:42 well, it would make more sense in python-barbicanclient 20:18:44 rm_work, I think it needs to happen either in the client --- or in the backends where the secret is stored 20:18:46 maybe having validation methods in the client would work? Secret().is_certificate 20:18:47 actually, that would work to prevent code duplication 20:18:56 yeah 20:19:00 I think that's feasible 20:19:01 if someone is not using the client, then I guess they'll have to validate themselves in their codebase 20:19:04 yep 20:19:16 I think that's the best option 20:19:20 woodster_, but I think Lbaas need it synchronously I think. 20:19:42 yeah, I think doing it in python-barbicanclient is probably the best option 20:19:44 rm_work, if the backend plugin has the capability to encrypt something and decrypt something , then you could do it there. 20:19:49 Okay, so my understanding of why it was interesting to potentially have this done on the server side was that as currently designed octavia has to pull down the cert + key and do the check itself, then the data is fetched again by another system later. With a server side check it would be possible to make it so octavia itself never sees the decrypted secret. 20:19:56 rm_work, is that accurate? 20:19:57 on the read-side rather that as a pre-req for writing 20:20:07 then client side is best...it also has access to the private key used to gen a cert CSR too 20:20:19 reaperhulk: yes 20:20:24 that is the deeper problem description 20:20:42 but I don't think we're going to solve that 20:20:58 it's useful for people here to know the context of why you ideally want it :) 20:21:26 so what reaperhulk mentioned was another motivation for this -- if our API can *trust* that the contents of a CertContainer is valid, we don't even need to look at it -- and we can wrap it end-to-end and never see it 20:21:38 as is, we have to fetch the secret data just to validate it and throw it away 20:21:56 ...which is what a client side check would do 20:22:02 right :/ 20:22:19 rm_work, is the cert/key generated on the client - or the server? 20:22:36 alee_: cert/key is input by the user 20:22:40 alee_, I think client 20:22:44 outside of our workflow 20:22:46 if everyone uses barbican to gen their certs, no worries! :) 20:22:51 woodster_: right 20:22:52 :P 20:22:57 user is providing everything 20:23:01 and then -- the client generates the container , right? 20:23:05 yes 20:23:10 the End User 20:23:13 generates the container 20:23:22 (client is a generic term) 20:23:22 rm_work, so I see no reason that the client does not validate the key pair right then and there. 20:23:33 we can't trust the End User 20:23:57 then again, if they put in bad data, it's their own fault if their LB goes into Error 20:23:57 you're trusting them to provide a key/cert .. 20:24:19 the hope is that we can warn them specifically though and prevent stupidity from causing an issue 20:24:27 why not validate even before contacting barbican to create the container? 20:24:40 alee_: we don't have control over that 20:24:47 if the check fails, then tell them "you're an idiot" 20:24:57 (^only if this is the real message plz) 20:25:08 The CertificateContainer will exist before our system even enters the picture 20:25:22 the End User will have created it on their own 20:25:32 via... Maybe the python client? maybe Horizon? 20:25:39 We don't know 20:25:43 rm_work: I think alee_'s question is why do you need to validate it before it gets to the end. Is that an optimization that really matters? Why not let it try to load in haproxy and handle the error in that (presumably highly rare) edge case? 20:25:52 rm_work, ok - then validate before sending the key/cert to be stored. 20:26:05 alee_: ... we don't send it to be stored 20:26:08 the End User does 20:26:16 or do you mean stored on HAProxy? 20:26:42 reaperhulk: we could just say "fuck it", yeah 20:26:54 I'm not entirely opposed to that option 20:26:58 Is that really fuck it? Either way you get an error and have to handle it 20:27:03 You just have to pick where you want to handle it 20:27:09 we could probably wrap this up -- it looks like the answer is that this can't be done server-side 20:27:18 alee_, container is created by lb end use with cert and keys. I think LB need capability to validate is the content is valid or not. 20:27:20 probably not for now, but I'm still glad you added it to the agenda :) 20:27:20 rm_work +1 20:27:26 but that adding methods to the python client would provide some good code if people want to use it 20:27:39 1) user creates cert container 2) user tells LBaaS to create a LB with said container 3) LBaaS validates container via barbican client and tells user if it stinks 4) LBaaS saves container ID if valid 20:27:54 correct ^^ woodster_ 20:28:08 #agreed We won't do validation at Container creation for now 20:28:12 ok, moving on 20:28:18 my next topic! :P 20:28:29 #topic Castellan scope: include CertMgr / ContainerMgr support? 20:28:46 I posted a comment on the CR to this end 20:28:59 I would like to see this added to the project scope sooner than later 20:29:02 Which CR? 20:29:10 https://review.openstack.org/#/c/136140/ 20:29:16 the one you commented on :P 20:29:29 rm_work thanks, I was digging for that link 20:29:30 haha Got it! 20:29:53 So, I have already modified the Cinder KeyMgr interface for use on Octavia 20:29:57 and Neutron-LBaaS 20:30:13 which is a perfect example of why it needs to be done somewhere central (I've already had to copy/paste it once) 20:30:25 +1 20:30:47 What changes did you need to make? 20:30:53 and since that interface CAME FROM KeyMgr, it should be easy enough to integrate 20:31:09 it's very similar -- Cert instead of Key, CertManager instead of KeyManager 20:31:13 different methods... 20:31:16 but otherwise 20:31:23 it operates very similarly 20:31:34 actual code work is incredibly minimal 20:31:50 I would suggest modifying it to make a Certificate a type of key or change the keymanager to a SecretManager 20:31:56 and I'm more than happy to contribute if it's included in the project scope 20:32:07 does anyone object to adding a CertManager interface here? 20:32:08 Where keys/secrets are symmetric, asymmetric, certificates 20:32:10 rellerreller: well, the issue is that it's not a Secret Manager 20:32:13 it's a Container Manager 20:32:26 which is the main way in which it differs 20:32:36 KeyMgr only deals with individual secrets 20:32:41 not Containers of any kind 20:32:52 there was discussion of making it more generic than Certs somehow 20:32:59 since there are also RSAContainers 20:33:01 rm_work, we chatted about this a bit - and I think get_cert, store_cert, delete_cert should be replaced by container management api calls. 20:33:19 alee_: that is an option 20:33:53 though if we remove too much of the Cert specific code 20:34:02 it becomes significantly less useful 20:34:21 My concern would be having two different interfaces. Are you proposing having a KeyManager and a ContainerManager? 20:34:29 rm_work, do we really need store cert through CertManager? 20:34:29 well 20:35:02 I think for Lbaas get_cert is enough? 20:35:10 well, sure 20:35:15 but it should be complete 20:35:16 My concern with two different interfaces is that ContainerManager is likely highly tied to KeyManager. 20:35:33 rellerreller: so, it comes down to "what is the backend doing" 20:35:36 since this is an interface 20:35:48 It seems like if we want a container concept then add it to KeyManager interface 20:35:55 rellerreller: that would work too 20:36:12 I only forked this completely because it was out-of-project from KeyMgr 20:36:33 I think that would be safer. Otherwise someone will deploy a KeyManager and ContainerManager that have no idea about each other. 20:36:34 rellerreller, +1 20:36:48 rm_work, I agree that this is a topic that needs to be fleshed out -- but I think we're talking about two things 1) adding container management to KeyManager and 2) adding cert stuff to a CertManager 20:36:53 would most deployments use the same backend for both key manager and cert manager? 20:37:03 woodster_: I would assume so 20:37:28 So I assume if we provide a lot of interfaces, they could all be implemented without any real code duplication 20:37:38 by the same provider 20:37:42 I think container management is relatively uncontroversial. certmanager needs some more thought. 20:37:53 yeah, I just don't want to see the specifics get dropped 20:38:06 Part of this too is what is a key. I would say a certificate would be another object it would manage. 20:38:09 I would prefer to see some extra classes with more specific purpose 20:38:19 than trying to genericize too much 20:38:42 rm_work, I think we need a blueprint we can all bash .. 20:38:46 yes 20:38:47 +1 20:38:48 rm_work: +1 20:39:12 #action rm_work to write blueprint for Certificate management in Castellan 20:39:18 so, for now, we can agree that we need container support, and the basic project scope can be fixed to include that? i will be happy with that for now 20:39:24 lol, aaaaand I just signed myself up for that 20:39:38 rm_work :) 20:39:42 ok 20:39:43 rm_work, yup :) 20:39:44 one method is all you need: do_something(something_code, *args, **kwargs) 20:39:54 sweet, thanks woodster_ 20:39:56 q what's castellan ? 20:39:59 I'm all set now :P 20:40:17 sorry guys - need to drop - back online later today .. but out for rest of the week .. 20:40:29 ekarlso- it's the working name for a separate repo to hold a generic key manager interface 20:40:30 happy t-day! 20:40:33 ekarlso- it's the new library that has the KeyManager interface 20:40:42 alee, take care 20:40:46 ok :) 20:40:48 alee_ have fun! eat lots of turkey! 20:40:51 alee_: have fun =) 20:40:52 alee_, have fun 20:41:01 * rm_work waves at alee_ 20:41:19 next topic redrobot? 20:41:25 #topic Content type 20:41:32 not sure who added this one? rellerreller ? 20:41:39 That was me 20:41:49 So for those unfamiliar with the content type problem here is the gist of it. 20:41:58 A user uploads a secret to Barbican in format X. Another user downloads the key for usage but expects the key to be in another format. How do we handle different formats and what formats do we support? How can we change that a secret of type X is really a secret of type X? 20:42:06 This problem comes up with public keys. Some people are expecting PEM and others DER. 20:42:28 This has caused us a lot of confusion. 20:42:30 oh thank god -- escaping before content types .. :) 20:42:44 alee_ lol 20:42:47 The first part of this is how to represent keys and certificates. 20:43:04 so is deep inspection and built-in automagic conversion routines out of the question? :P 20:43:21 rm_work that is something that I would like and am working on 20:43:27 only if that take work on the API nodes to do it :) 20:43:47 well, API nodes scale to whatever, right? :) 20:43:48 We need to define types so that when we are passed a public or private key then we can validate that it is one of those things 20:44:01 rellerreller: HEY. this is a tie-in to topic #1 >_> 20:44:18 I have been looking at RFCs for days now trying to find how to represent keys. 20:44:30 rm_work I think this will help you out a lot 20:44:42 so, Typed Secrets? 20:44:49 rm_work, agreed. I think that is leakage reaperhulk was concerned about? 20:44:59 sounds like, yes 20:45:00 http://pki-tutorial.readthedocs.org/en/latest/mime.html 20:45:03 I am leaning toward Base64 encoding of ASN.1 objects that are DER encoded. 20:45:03 is typing different than metadata then? 20:45:17 still leaks data 20:45:26 woodster_ typing? 20:45:35 "Oh this is a PrivateKeySecret, yummy" 20:45:43 yeah, I'd prefer to have one standard type rather than allowing multiple ones 20:46:03 The RFC, https://tools.ietf.org/html/rfc5912#section-6, has some ASN.1 representations of public keys 20:46:04 rellerreller, typing, as in Typed Secret 20:46:24 * redrobot needs to brush up on ASN1 20:46:36 ...instead of relying on the metadata for a secret 20:46:36 famous last words 20:47:11 last time I looked at content-types I was a bit confused on how to represent Base64 20:47:22 No metadata for secret. First cut I plan to make all secrets of a type have the same represenation. Then later we can add translation to different types 20:47:27 technically Base64 encoding is a Transport-Encoding not a Content-Type 20:47:30 reaperhulk, would having a 'type' sort of attribute to direct what type a secret is a no no? 20:47:59 rellerreller: you mean we decide that all Certs are PEM, so if we get passed anything not PEM, we detect and convert to PEM for storage? 20:48:17 ...or reject it outright 20:48:19 Just wondering what people think of Base64 encoding of ASN.1 with DER encoding. 20:48:20 woodster_: I would be okay with that 20:48:45 rm_work I would think that we'd want to define our own content types? "application/barbican+asn1der" 20:48:55 rellerreller: that's pretty much the definition of PEM although the underlying DER representation would ideally be PKCS8 for asymmetric keys 20:48:58 redrobot: that seems redundant :/ 20:49:02 rellerreller, I think that will cause problem in case of RSA container with password protected private keys 20:49:05 rm_work We would reject any object that is not encoded to the exact encoding for that type. 20:49:20 rellerreller: ok, so we ONLY accept PEM / whatever 20:49:23 rellerreller, as mentioned in bug #link https://bugs.launchpad.net/barbican/+bug/1365187 20:49:25 Launchpad bug 1365187 in barbican "Accept header application/octet-stream is not honored while getting Asymmetric secrets" [Undecided,In progress] 20:49:28 rm_work so if we decide certs will be in DER format then all certs must be in DER format and PEM certs will be rejected 20:49:48 yeah, k 20:49:58 atiwari: depends on how the validation is done 20:50:01 atiwari How so? 20:50:08 if it's done by attempting to load it up, then yes that'd cause problems 20:50:27 if it's done just by looking at structure and not validating functionally, then it'd be OK 20:50:36 rellerreller, please take a look in the bug 20:50:38 or if that were a fallback -- doesn't functionally validate, but it LOOKS ok 20:50:48 though yeah, hard to convert that 20:51:05 issue is we are storing in PEM serialized format 20:51:34 atiwari the issue is that people are storing things in whatever format they are given, and we have no idea what that is 20:51:44 rellerreller, is that a 'natural' format generated by ssl related tooling, or would folks need to use barbican client (yet again) to do the conversion easily? 20:52:18 ....a little concerned about AJAX-y web pages using barbican API directly 20:52:21 DER encoding of ASN.1 seems to be the standard 20:52:35 I kinda thought PEM was the standard, but I may live in a bubble 20:52:47 ...okay, everyone halt for a minute :) 20:53:00 LBaaS / Octavia was planning to assume/require PEM :P 20:53:01 PEM is Base64 of DER with a header and footer 20:53:04 When it comes to asymmetric keys inconsistency is the order of the day 20:53:15 as rellerreller said, PEM is just DER in base64 with delimiters 20:53:19 rellerreller, IMO we have to restrict the format depending on type of secret ans associated properties . 20:53:24 however, DER can be multiple formats inside it 20:53:41 I chose DER because of inclusion in X.509. That RFC says how public keys are embedded in certificates. 20:53:58 DER is merely the distinguished encoding rules for ASN.1 and there are several ASN.1 structures 20:54:05 X.509 certs have only one (thankfully!) 20:54:08 but the private keys do not :) 20:54:10 lol thanks for the clarification reaperhulk -- though now I am confused about some conversations I have had recently >_> 20:54:44 reaperhulk That was one of my problems is how to represent private keys 20:54:55 pkcs8? 20:55:05 Yeah we talked a bit about this in Paris. I would prefer a normalization to PKCS8 as it is the closest thing to a real standard that exists 20:55:06 The RFC only defines public keys. I cannot find ASN.1 modules for private keys except for RSA. 20:55:26 we need a new unifying standard dammit...how hard can that be? :) 20:55:43 Yeah, we've run into the same problem in pyca/cryptography... we should take this outside this meeting rellerreller but we may have some useful code for you 20:55:51 75% of private keys I see are PKCS8 I think :/ 20:55:51 maybe we need an etherpad to capture some the typical formats folks use with some examples? 20:55:52 But PKCS8 is only for RSA? 20:56:12 woodster_: +1 20:56:34 I can start etherpad on this 20:56:49 I can make the etherpad the beginning of my blueprint. 20:56:57 rellerreller: You can definitely generate a PKCS8 for ECDSA/DSA keys 20:57:07 This is turning out to be a lot more difficult than what I anticipated. 20:57:32 https://github.com/pyca/cryptography/pull/1390 <-- pure python parser for PEM keys and a serious PITA 20:57:38 rellerreller heh.. isn't that always the case. :) 20:57:48 reapherhulk Thanks. There are a lot of new RFCs that I am trying to become expert with and that is not easy for me. 20:58:10 That PR also has comments noting what RFC some of the ASN.1 structures came from 20:58:13 so that might be helpful :) 20:58:27 reaperhulk that would be fantastic :) 20:58:38 #link https://etherpad.openstack.org/p/barbican-formats-discussion 20:58:41 Google searching for this has been terrible 20:58:58 Almost out of time y'all 20:59:10 thanks for the etherpad woodster_ 20:59:16 well, if we could come up with reasonable typical formats and stick with those, that might do the trick? 21:00:00 we can continue discussion back at #openstack-barbican 21:00:04 thanks for coming everyone 21:00:05 #endmeeting