Skip to content
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

Allow Override PR History link #24377

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

chaodaiG
Copy link
Contributor

PR history link /pr-history from deck is currently only supported for GitHub repos, which turned out to be internal error for gerrit based prow. Allow overriding the template could possibly let users pointing to /repo=<REPO>&pull=<PULL> etc

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 16, 2021
@chaodaiG
Copy link
Contributor Author

/cc @BenTheElder

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/prow Issues or PRs related to prow area/prow/deck Issues or PRs related to prow's deck component sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Nov 16, 2021
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 16, 2021
prow/cmd/deck/main.go Outdated Show resolved Hide resolved
return "", fmt.Errorf("failed compiling template %q: %v", PRHistLinkTemplate, err)
}
tmpBuff := bytes.Buffer{}
if err = tmp.Execute(&tmpBuff, struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to think of any vulnerabilities... Looks vulnerable to XSS. For example, what happens if I use a template like: javascript:doSomethingEvil()

... I think "sanitizing/validating" a template would be tricky because of HTML entities & URL encoding.

I forget if Spyglass configuration is considered "safe" (requiring PR reviews, plus or minus in-repo config), but I'm assuming two bad actors could collaborate to merge it??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this is possible. But this field can only be changed in config.yaml file, which is supposed to be guarded by OWNERS file, to ensure that changes here can only be merged if a prow admin approve the change. So we might be fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that a (new/distracted/etc) OWNER might not pay full attention to it.

I'll leave the final say to you/others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prow had several other fields like https://github.com/kubernetes/test-infra/pull/24377/files#diff-88e6b42a331a7aa9260f9a830961e3ba3c77e0e6d781465378b510d7abc1517cR997 could also be exposed to this kind of problem. Generally this should be easy to identify during code review

PR history link /pr-history from deck is currently only supported for GitHub repos, which turned out to be internal error for gerrit based prow. Allow overriding the template could possibly let users pointing to  etc
@chaodaiG
Copy link
Contributor Author

/cc @alvaroaleman

@chaodaiG
Copy link
Contributor Author

@alvaroaleman , mind review?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, chaodaiG

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 94589f3 into kubernetes:master Nov 30, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Nov 30, 2021
@chaodaiG chaodaiG deleted the pr-history-link branch November 30, 2021 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow/deck Issues or PRs related to prow's deck component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants