fix: add missing authorization check to fingerprint endpoint - #40706
Conversation
|
Looks like this PR is ready to merge! 🎉 |
WalkthroughThis PR enforces the ChangesSecurity Fix - /fingerprint Endpoint Authorization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🦋 Changeset detectedLatest commit: 72e7458 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
6225b98 to
72e7458
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #40706 +/- ##
===========================================
- Coverage 69.66% 69.62% -0.04%
===========================================
Files 3339 3339
Lines 123287 123287
Branches 21954 21950 -4
===========================================
- Hits 85887 85844 -43
- Misses 34048 34076 +28
- Partials 3352 3367 +15
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/backport 8.2.6 |
|
Pull request #40907 added to Project: "Patch 8.2.6" |
|
/backport 8.1.6 |
|
Sorry, I couldn't do that backport because of conflicts. Could you please solve them? you can do so by running the following commands: after that just run |
|
/backport 8.1.6 |
|
Pull request #40908 added to Project: "Patch 8.1.6" |
|
/backport 8.0.7 |
|
Sorry, I couldn't do that backport because of conflicts. Could you please solve them? you can do so by running the following commands: after that just run |
|
/backport 8.0.7 |
|
Pull request #40910 added to Project: "Patch 8.0.7" |
|
/backport 7.13.9 |
|
Sorry, I couldn't do that backport because of conflicts. Could you please solve them? you can do so by running the following commands: after that just run |
|
/backport 7.13.9 |
|
Pull request #40911 added to Project: "Patch 7.13.9" |
|
/backport 7.10.13 |
|
Sorry, I couldn't do that backport because of conflicts. Could you please solve them? you can do so by running the following commands: after that just run |
|
/backport 7.10.13 |
|
Pull request #40912 added to Project: "Patch 7.10.13" |
Proposed changes (including videos or screenshots)
The
POST /api/v1/fingerprintendpoint was protected byauthRequired: truebut had nopermissionsRequiredcheck. The endpoint is still actively used as part of the deployment fingerprint change flow.Fix: add
permissionsRequired: ['manage-cloud']to the endpoint options, matching the authorization pattern used by every other cloud management endpoint incloud.ts. Themanage-cloudpermission is assigned to theadminrole by default, so the legitimate flow is unaffected.The
403response code is also added to the endpoint's response schema, which was missing.Issue(s)
CORE-2238, VLN-398
Steps to test or reproduce
Before the fix:
POST /api/v1/fingerprintas a user without themanage-cloudpermission -> returns200After the fix:
POST /api/v1/fingerprintas a user without themanage-cloudpermission -> expect403 ForbiddenPOST /api/v1/fingerprintas a user with themanage-cloudpermission -> expect200Site_Urlsetting) -> confirm the modal still works end-to-endFurther comments
The
manage-cloudpermission was chosen because it is already used by all other cloud management endpoints (cloud.syncWorkspace,cloud.createRegistrationIntent,cloud.getRegistrationStatus, etc.) and is semantically correct for an action that modifies workspace cloud identity.