Repository navigation
Pipeline identity token var_source - #9035
Conversation
b000a00 to
0458916
Compare
becd951 to
fd0872d
Compare
|
Hey @taylorsilva , as of now Phase 1 of the RFC is nearly complete. Tokens can be obtained from the var-source, keys are stored in the DB and published via a public API-Endpoint as JWKs. I tested it with vault's JWT-Auth feature and it is working just fine. Still missing is the job/step info in the token (honestly, I have no idea how to do this...) and of course tests. If you have some time to spare, I would appreciate some feedback, so I can see if I am going in the right direction. |
|
@dbaumgarten I'll try and take a look next week. Got a bit in my plate right now. |
fd0872d to
e5c03e4
Compare
taylorsilva
left a comment
There was a problem hiding this comment.
I've given the smaller pieces of this a quick glance. It's looking good so far.
I haven't had time to dig into the job/step name stuff yet. Definitely isn't straight forward how we'll get that in there. Not sure if it may bee a good opportunity to use the Options pattern here 🤔
I see you're adding testflight tests now, really appreciate that!
Don't forget to add tests to the API layer.
Thanks for the work so far, it's looking great! 👏
277c5a7 to
911665e
Compare
|
I tried adding the job-info. But it turned out to be a gigantic mess and in the end didn't even work out properly...
|
1648310 to
636fce6
Compare
|
Hey @taylorsilva , i finally figured out how to get instance-vars and job-name into the idtoken (however I have still no idea how to get step-info in there). See the latest commit. It isn't beautiful and I had to change stuff in quite a few places. The basic idea is to add a new parameter to creds.NewVariables (which contains context-info for the secrets-lookup) and therefore force all callers of creds.NewVariables to provide these context-infos. Resulting tokens now look like this: |
|
Awesome! Thanks for all the work. I'm going to start wrapping my head around all the code changes here and reviewing. There is a lot so might take me a bit of time. |
|
Yeah, this somehow turned out much larger than expected... |
There was a problem hiding this comment.
Thanks for waiting. Overall this is looking really good! I haven't had time to test it locally but I'm happy to see you added some tests to testflight!
I just unpaused the pipeline for this PR, so we'll see how all those tests go. I'll play around with this soon, just wanted to share the feedback I have so far.
I think the changes you made to get the job name in are good. It does seem like too much work to get the step name in. Like our RFC said, best effort to get it in. I think most folks will be happy having the job name in there. It's probably enough granularity for users to work with.
The majority of my feedback is what I'd consider "nit-pick" level stuff, though they should be easy to resolve.
The one thing I do request be changed is how the SigningKeyLifecycler gets wired up and invoked.
Once that's resolved though and I play around with it a bit, I'm not seeing any other blockers with getting this in. Thanks so much for all the work you've done so far!
|
That's a lot of (quite reasonable) feedback. I will resolve it step by step, but it might take a few days. |
b96ee62 to
e3daab3
Compare
|
Hi @taylorsilva , |
|
@taylorsilva did you already find some time to play around with this feature? |
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]> Co-authored-by: Taylor Silva <[email protected]>
Signed-off-by: dbaumgarten <[email protected]> Co-authored-by: Taylor Silva <[email protected]>
Signed-off-by: dbaumgarten <[email protected]> Co-authored-by: Taylor Silva <[email protected]>
Signed-off-by: dbaumgarten <[email protected]> Co-authored-by: Taylor Silva <[email protected]>
Signed-off-by: dbaumgarten <[email protected]> Co-authored-by: Taylor Silva <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
Signed-off-by: dbaumgarten <[email protected]>
7d95137 to
d6d6c94
Compare
|
FYI: I had to rebase the branch, the goimport command had a small change and some unrelated files needed to be updated, which was done on I am actively reviewing this now, thanks for waiting 🙏 |
taylorsilva
left a comment
There was a problem hiding this comment.
Almost there, just want your thoughts on the new instance scope.
|
@dbaumgarten Thanks again for the work on this PR. Would you have time to add documentation for it here: https://github.com/concourse/docs/blob/master/lit/docs/vars.lit#L385-L529 |
|
You're welcome :) I will take a look at the documentation in the next few days. Do you already have a rough idea when a version containing this feature will be released? |
I am planning to make a 7.14 release that would contain this feature. 7.14 will also contain the first official ARM release of Concourse, which is the main reason for the release. I need to finish the release engineering work and then I'll make a release. Some time in July is my current goal. |
|
@taylorsilva Do you think I should also add a page to the Credential Management Section of the docs, explaining the feature in more detail (maybe including examples)? Or is the section under var-sources good enough? |
I think that's a good idea. It feels a bit odd putting it on that page, but I don't think there's a better place for it right now. Do it! |

Changes proposed by this PR
This PR is the implementation of RFC139.
The idtoken var_source generates a signed jwt, which contains infomation about the pipeline (team, pipeline-name etc.). It can be send to external services for authentication.
This PR makes it possible to have a pipeline like this:
Phase 1:
Phase 2:
Phase 3: