-
Notifications
You must be signed in to change notification settings - Fork 354
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
Introduce a new trust policy: "trust pull request submitter with write right in the destination repository/branch" #842
Comments
Do Bitbucket Cloud and/or Bitbucket Data Center provide an API that Jenkins could use to check whether the author of the pull request has write access? IIRC, Bitbucket Cloud in particular has tightened access to user information because of GDPR. |
Indeed looking at the API of BitBucket Data Center it really doesn't seem to exist. In BitBucket Cloud it seems there is a notion of "role", the one with write access being "contributor" but I am not sure how restricted is this API. Since in my case I care more particularly about BitBucket Data Center, and with the privacy in mind as I guess exposing who has right to do what is a bit a sensitive information, I have opened a different feature request on BitBucket Data Center side here: https://jira.atlassian.com/browse/BSERV-19339 |
The author of the pull request may be different from
There is a rejected feature request [BSERV-8635] Ability to change the author of a pull request. If that were ever implemented and Jenkins used the author of a pull request for the trust decision, then the following could happen:
BSERV-8635 seems unlikely to be implemented so this scenario cannot happen as is. Regardless, I feel it is an indication that the PR authorship might not be the best input for the trust decision. What could be used instead:
|
What feature do you want to see added?
In my corporate environment with thousands of developers using Jenkins daily, the deployment of the latest version of the BitBucket source plugin had quite some effect, because of the fix for SECURITY-3300 / CVE-2024-28152.
My own experience is that most of the time, the people who submit changes to Jenkinsfile are also the "maintainers" of a given repository (at least in corporate environment, it may be less true in an open source project having many external contributors). So in most cases, I would expect the person submitting a change to a Jenkinsfile via pull request also has the "write" right on BitBucket side, so is a rather "trusted" person. The current implementation of who is trusted and who isn't in the BitBucket source plugin assumes that if you can create a fork inside the project, then somehow you have the "write" right into the whole project, so you are "trusted". I think this encourages wrong practices (I honestly don't see why people would create some "my-project2" BitBucket project to be able to test a change targetting "my-project"), and IMO it hardly makes sense to start teaching my colleagues that:
In the end, what people would like is to keep submitting pull request like they always did, from their own personal fork, and IMO these people shall be trusted if they have the right to write in the destination branch/pull request. The fact of deducing this right from the ability to fork from inside the BitBucket project is weird and looks like a "side channelled" way to get the real information that really matters "can this person write in my repo in the end" ?
So would it be acceptable to add a 4th trust policy in this plugin, and potentially even making it the default ?
Upstream changes
No response
Are you interested in contributing this feature?
I hardly know anything in Java, and hardly know your code. If maintainers of these repo do accept the idea, but have no time to implement it, I (or someone in my company) may try to have a look to help implementing this.
The text was updated successfully, but these errors were encountered: