-
Notifications
You must be signed in to change notification settings - Fork 723
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
Folder credentials and its chicken-and-egg problem #782
Comments
Check gitter we had a discussion about how to go about job-dsl and folder credentials not too long ago (within the last two days) |
This is really more of a job dsl issue than it is JCasC, yes JCasC can provide Job DSL with secret context when running your seed job but besides that folder creation is all Job DSL |
Not in the context of folder credentials. Folders are a job/project inside Jenkins that can hold configuration and credentials plugin can add credentials to folders; hence it is a Job DSL issue. JCasC is already providing Job DSL with credentials context when JCasC configures Job DSL. So any environment variables, docker secrets, vault secrets are accessible to Job DSL |
right, now I get it.
And in order to make sure some credentials only accessible within the folder: we can only use the second option. Is my understanding correct? |
Yes on both accounts 😄 We use Vault instead, yes Jenkins can see everything in Vault under That way we avoid the Jenkins credential store as much as possible. |
This a more an issue with the core not providing JCasC compatible databinding for jobs, |
@Casz thanks for the hint 👍 . I think Vault is a good candidate for a slightly more complex environment. But what we are looking for is a fully automated pipeline for small team, with Pull Request (Branch) being our only safe guard. Ideal setup in Jenkins land:
In this case, folder credential is the only solution in the land of Jenkins. (Or in Gitlab CI using protected variable) @timja 👍 👍 thanks, now I get the full picture. I wish Jenkins can be battery-included in the future. |
Hi folks, I'm currently trying to accomplish the same thing. Do you have a more complete example of how to put credentials into folders using CasC and Job DSL? Seems to be a pretty common thing to do, but I'm kinda stuck. :-/ |
@twz123: Here is my example of a Job DSL that creates such a folder. CasC only creates a seed job in my case which checksout the Job DSL here.
A bit strange why you need the "domainCredentials" encapsulated twice but this is the only way it is working for me. |
Following the above comment from @zhming0 , does anyone have example job-dsl code "to query credentials provided by CasC"? Many thanks. |
@holmesb: In our setup we use job-dsl only create a job which points to a Jenkinsfile
An example Jenkinsfile to reference a password looks like:
Only make sure to use the credentialsID you defined in the Jenkins credential store (via JCasC or manually). |
Sorry if my comment wasn't clear @linkeal , we're trying to create a folder credential using job-dsl (by querying credentials provided by CasC - as suggested by @zhming0), not attach a credential to a job. Our credentials are currently created by CasC and exist globally (not at folder level). The reason we are using both CasC and JobDSL is CasC mounts our kubernetes secret. This means in our code we can create a credential referring to a secret using |
Hi CasC team, thanks for making this wonderful plugin! I am evaluating it to use it for my team.
I meet one blocking point:
We want to use folder to group credentials (so we can separate CI and CD for security purpose), but:
Detail for point 1:
Detail for point 2:
job-dsl
to configure all jobs and folders. AFAIK, DSL's depends on credentials (for git checkout) and folder credentials depends on DSL (to spin up the folder).So this looks like a chicken-and-egg problem.
So my questions are:
Context:
The text was updated successfully, but these errors were encountered: