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

[v8.4.x] Security: Sync security changes on main (#45083) #45140

Merged
merged 3 commits into from
Feb 9, 2022

Conversation

vtorosyan
Copy link
Contributor

What this PR does / why we need it:

Manual backport of #45083

* * Teams: Appropriately apply user id filter in /api/teams/:id and /api/teams/search
* Teams: Ensure that users searching for teams are only able see teams they have access to
* Teams: Require teamGuardian admin privileges to list team members
* Teams: Prevent org viewers from administering teams
* Teams: Add org_id condition to team count query
* Teams: clarify permission requirements in teams api docs
* Teams: expand scenarios for team search tests
* Teams: mock teamGuardian in tests

Co-authored-by: Dan Cech <dcech@grafana.com>

* remove duplicate WHERE statement

* Fix for CVE-2022-21702

(cherry picked from commit 202d7c190082c094bc1dc13f7fe9464746c37f9e)

* Lint and test fixes

(cherry picked from commit 3e6b67d5504abf4a1d7b8d621f04d062c048e981)

* check content type properly

(cherry picked from commit 70b4458892bf2f776302720c10d24c9ff34edd98)

* basic csrf origin check

(cherry picked from commit 3adaa5ff39832364f6390881fb5b42ad47df92e1)

* compare origin to host

(cherry picked from commit 5443892699e8ed42836bb2b9a44744ff3e970f42)

* simplify url parsing

(cherry picked from commit b2ffbc9513fed75468628370a48b929d30af2b1d)

* check csrf for GET requests, only compare origin

(cherry picked from commit 8b81dc12d8f8a1f07852809c5b4d44f0f0b1d709)

* parse content type properly

(cherry picked from commit 16f76f4902e6f2188bea9606c68b551af186bdc0)

* mentioned get in the comment

(cherry picked from commit a7e61811ef8ae558ce721e2e3fed04ce7a5a5345)

* add content-type: application/json to test HTTP requests

* fix pluginproxy test

* Fix linter when comparing errors

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
(cherry picked from commit 605d056)
@vtorosyan vtorosyan requested review from pkolyvas and a team as code owners February 9, 2022 12:58
@vtorosyan vtorosyan added this to the 8.4.0 milestone Feb 9, 2022
@vtorosyan vtorosyan added backport A backport PR and removed type/docs area/backend labels Feb 9, 2022
@marefr marefr added backport A backport PR and removed backport A backport PR labels Feb 9, 2022
Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

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

Think these suggestions should resolve pluginproxy issues

pkg/api/pluginproxy/pluginproxy_test.go Outdated Show resolved Hide resolved
pkg/api/pluginproxy/pluginproxy_test.go Outdated Show resolved Hide resolved
@marefr
Copy link
Member

marefr commented Feb 9, 2022

Something with service accounts failing now that I don't know of. Is there something not backported to 8.4.x yet, or have something been merged to main targeting 8.5.x?

@Jguer
Copy link
Contributor

Jguer commented Feb 9, 2022

Hey, seems to be failing on the changes of #44871 , how can I help?

@Jguer
Copy link
Contributor

Jguer commented Feb 9, 2022

Hey, seems to be failing on the changes of #44871 , how can I help?

File did not exist in 8.4, in back porting the patch, the full file as it existed in main was ported

@Jguer Jguer requested a review from marefr February 9, 2022 16:51
@vtorosyan
Copy link
Contributor Author

Thanks @Jguer and @marefr for jumping in.

Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

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

LGTM

@vtorosyan vtorosyan merged commit ff8e53a into v8.4.x Feb 9, 2022
@vtorosyan vtorosyan deleted the backport-45083-to-v8.4.x branch February 9, 2022 19:43
@gamab gamab changed the title Security: Sync security changes on main (#45083) [v8.4.x] Security: Sync security changes on main (#45083) Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants