Feature #7243
Additional data in Puppet CSRs (certdnsnames, and custom data)
| Status: | Tests Insufficient | Start date: | 04/26/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | SSL | |||
| Target version: | 2.7.x | |||
| Affected Puppet version: | Branch: | https://github.com/puppetlabs/puppet/pull/269 | ||
| Keywords: | ||||
| Votes: | 2 |
Description
Puppet Clients currently do not support filling in ‘certdnsnames’ in their CSR. That is only done on the signing-server side of things. This should be updated so that either the client, or server can set the certdnsnames (or both).
In addition to this, the Puppet CSR generation code should allow for the addition of arbitrary data in the form of keypairs (foo=xyz) that is embedded into the CSR. That data should then be accessible in some way to the Puppet master process itself during catalog compilation. This allows for companies to build in their own security models around the SSL certs.
Related issues
History
Updated by James Turnbull about 1 year ago
- Status changed from Unreviewed to Needs Decision
- Assignee set to Nigel Kersten
Updated by Jeff McCune about 1 year ago
- Tracker changed from Bug to Feature
Updated by Daniel Pittman about 1 year ago
I think this is a good idea: providing extra data in the CSR and the subsequent signed certificate provides capabilities that our users will benefit from.
I think we are better off allowing any extensions available as part of the regular CSR process, which includes appropriate extra attribute fields for use in, among other things, the CA determining if this is an acceptable request.
Updated by Nigel Kersten 11 months ago
- Status changed from Needs Decision to Accepted
- Assignee deleted (
Nigel Kersten)
Updated by Nigel Kersten 11 months ago
- Category set to SSL
- Target version changed from 2.7.x to 3.X
Updated by James Turnbull 11 months ago
- Status changed from Accepted to Needs More Information
Matt – how would you like the data added? Where should Puppet get it from? A file on the client defined in puppet.conf?
Updated by James Turnbull 11 months ago
- Assignee set to Matt Wise
Updated by James Turnbull 11 months ago
- Status changed from Needs More Information to Duplicate
Closed in favour of #7243.
Updated by James Turnbull 11 months ago
- Status changed from Duplicate to Needs More Information
Updated by James Turnbull 11 months ago
- Branch set to https://github.com/jamtur01/puppet/tree/tickets/master/7243
Some prototype code at https://github.com/jamtur01/puppet/tree/tickets/master/7243.
Updated by James Turnbull 11 months ago
The patch series has been updated to include sending certdnsnames also.
Updated by Matt Wise 11 months ago
So this looks like a good start … I’m confused a bit by the documentation because you supply a value of ‘attrval1 and 'attrval2’ — but your returned valuees when you check with openssl are ‘testoid1’ and ‘testoid2’. Perhaps I don’t understand properly how that works — do the numbers in the YaML file turn into text of some kind?
Overall though, the idea of filling out a separate CSR data file is fine with me. For us, we’d be filling two things into the CSR. 1) the ‘class’ that we intend on our node getting and 2) the ‘token’ we use to authenticate a node on bootup. Both of these would probably work in this setting just fine, as long as we can pull these CSR values independently as ‘facts’ or something.
Updated by James Turnbull 11 months ago
Matt
X509 Attributes are made up of OIDs (like SNMP) and values. The OIDs in the file are converted to their named values – in this case testoid1 and testoid2.
How do you intend to get the values from the CSR to validate them?
Updated by Matt Wise 11 months ago
Two different places .. 1) Having them available as ‘facts’ … something like $csrdata_foo. 2) Ability to pass them as variables to the ‘auto sign verification script’ that we’ve referenced in the other ticket. Something like $autosign = ‘myautosign.sh $csrdata_foo’
Updated by James Turnbull 11 months ago
So some issues. The attributes are on the CSR which is destroyed/deleted when the certificate is signed. This may or may not be part of a Puppet run. Hence we need someway to extract and store the attributes from the CSR somewhere that results in them being added to Puppet. I am unclear how we could do this – except perhaps to write them to the certificate?
An alternative approach might be to be able to retrieve the CSR attributes using the certificate signing API? That way you could work out if you sign a certificate based on the value of the attribute returned by the API?
Thoughts?
Updated by Daniel Pittman 11 months ago
So some issues. The attributes are on the CSR which is destroyed/deleted when the certificate is signed. This may or may not be part of a Puppet run. Hence we need someway to extract and store the attributes from the CSR somewhere that results in them being added to Puppet. I am unclear how we could do this – except perhaps to write them to the certificate?
I would have expected that additional attributes in the CSR would be transferred to the certificate, unless they were specifically part of the request process. (eg: the cert is basically the CSR, signed.)
An alternative approach might be to be able to retrieve the CSR attributes using the certificate signing API? That way you could work out if you sign a certificate based on the value of the attribute returned by the API?
This seems cumbersome, and to be much more prone to data drift. (eg: submit a new CSR with security=superdude, get a catalog with the wrong data, because the CSR lookup sees that, and not the certificate signed from the original CSR with security=nobody.)
Better, I think, embed the values into the certificate, and allow whatever introspection on that, since that has the signature chain to protect and authenticate it.
Updated by James Turnbull 9 months ago
- Status changed from Needs More Information to Tests Insufficient
This needs some tests – will pair with someone in dev shortly to flesh out patch.
Updated by James Turnbull 8 months ago
- Branch changed from https://github.com/jamtur01/puppet/tree/tickets/master/7243 to https://github.com/jamtur01/puppet_old/tree/tickets/master/7243
Added in branch.
Updated by James Turnbull 7 months ago
- Status changed from Tests Insufficient to Code Insufficient
- Assignee changed from Matt Wise to Daniel Pittman
- Target version changed from 3.X to 2.7.x
Updated by James Turnbull 5 months ago
- Status changed from Code Insufficient to In Topic Branch Pending Review
- Branch changed from https://github.com/jamtur01/puppet_old/tree/tickets/master/7243 to https://github.com/puppetlabs/puppet/pull/269
I’ve updated this code since the Code Orange changes. It still needs tests for which I will need help. But it’s a long-standing requirement for several large customers and I’d like to get this on the radar. Or if someone can suggest a better implementation I am also open to that! :)
Updated by Nigel Kersten 4 months ago
- Assignee changed from Daniel Pittman to Teyo Tyree
Daniel and James. Teyo is going to work on getting tests for this code so it can be merged.
Updated by Daniel Pittman 4 months ago
- Status changed from In Topic Branch Pending Review to Tests Insufficient
Nigel Kersten wrote:
Daniel and James. Teyo is going to work on getting tests for this code so it can be merged.
Great. I am going to close off the older pull request in the meanwhile.