-
Notifications
You must be signed in to change notification settings - Fork 309
Add handling of cnf claim
#1092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
c85690b
4616c58
e207f94
3eb2564
2f0500a
8a2d36e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -379,6 +379,19 @@ be stored in the 'sshpop' header.`, | |
| be stored in the 'nebula' header.`, | ||
| } | ||
|
|
||
| // Confirmation is a cli.Flag used to add a confirmation claim in the token. | ||
| Confirmation = cli.StringFlag{ | ||
| Name: "cnf", | ||
| Usage: `The <fingerprint> of the CSR to restrict this token for.`, | ||
| } | ||
|
|
||
| // ConfirmationFile is a cli.Flag used to add a confirmation claim in the | ||
| // tokens. It will add a confirmation kid with the fingerprint of the CSR. | ||
| ConfirmationFile = cli.StringFlag{ | ||
| Name: "cnf-file", | ||
| Usage: `The CSR <file> to restrict this token for.`, | ||
| } | ||
|
|
||
|
Comment on lines
+382
to
+394
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these include something about the SSH public key, or want to keep it simple?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They used to include it, but due to a comment in the certificates PR that suggested removing the cnf for SSH, I've removed it from here. Although I kept the SSH public key in the context. |
||
| // Team is a cli.Flag used to pass the team ID. | ||
| Team = cli.StringFlag{ | ||
| Name: "team", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF14RP3HJkO1yoZHjo9t/4bJgyJGiSPxhm6FApa3VtG1 mariano@overlook.local |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -----BEGIN CERTIFICATE REQUEST----- | ||
| MIIBBDCBqwIBADAbMRkwFwYDVQQDDBB0ZXN0QGV4YW1wbGUuY29tMFkwEwYHKoZI | ||
| zj0CAQYIKoZIzj0DAQcDQgAEPj0tlICeGPiz361yM+AGlZmDK+N/cT0SVloozOQH | ||
| 1ljdNbookliEX8eRnFnelZRaql1KhrVOXhfwBmd/eGhti6AuMCwGCSqGSIb3DQEJ | ||
| DjEfMB0wGwYDVR0RBBQwEoEQdGVzdEBleGFtcGxlLmNvbTAKBggqhkjOPQQDAgNI | ||
| ADBFAiEA4WuukEVIFJQHNqlZVsWtsWsSVLNRCxBBJfH7/+txNw4CIGyK3eo5MDvR | ||
| DepPHVRF16/b+iW/4HgAgIC90+5Q4IrL | ||
| -----END CERTIFICATE REQUEST----- |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing the CSR or SSH public key, the claim itself could be calculated here, and just pass it as the fingerprint directly? Or is there some flow in which to defer calculation of the fingerprint is necessary?
step ca sign, maybe?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
step ca signusecautils.WithCertificateRequest(csr)andstep ssh certificateusecautils.WithSSHPublicKey(sshPub), although the SSH one is currently totally ignored. These fields go to the shared context of thecautilspackage and end up in thetokenpackage, which takes care of calculating the fingerprint and adding the proper attribute to the final token. Right now, only the CSR gets into the token package, but sending the type allows us to specify the right attribute now that we don't share justkid.