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

create additional role Sidecar Manager, reviewed existing permissions #15380

Conversation

moesterheld
Copy link
Contributor

@moesterheld moesterheld commented Apr 28, 2023

Description

reviewed permissions of Sidecar System user, made sidecars/configurations unavailable to the user since it is only used from the UI, not the sidecar.
added Sidecar Manager role with permissions to manage and read sidecars

Motivation and Context

closes #12044

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@moesterheld moesterheld linked an issue Apr 28, 2023 that may be closed by this pull request
reason: `sidecars:read` gives too many privileges to the system user. It is necessary that the sidecar user cannot read configurations of all sidecars
@moesterheld moesterheld changed the title add sidecars:read to Sidecar System role create additional role Sidecar Manager, reviewed existing permissions May 2, 2023
@moesterheld moesterheld reopened this May 2, 2023
@moesterheld moesterheld requested a review from a team May 3, 2023 08:40
@AntonEbel AntonEbel self-requested a review May 10, 2023 08:44
@AntonEbel AntonEbel removed the request for review from a team May 10, 2023 14:36
Copy link
Contributor

@AntonEbel AntonEbel left a comment

Choose a reason for hiding this comment

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

Just some minor things and one thing for the Sidecar Reader role. Currently, this user can click on the edit and update buttons, which results in an error page. I think it would improve the UX if someone from the frontend team would hide these buttons for the reader role. I don't know if we should make these changes in this PR or create an issue for that.

@@ -0,0 +1,6 @@
type = "a"
message = "Add Sidecar Manager role to read and manage sidecars."
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should also mention here the role of the Sidecar Reader.

import javax.inject.Inject;
import java.time.ZonedDateTime;

public class V20230502164900_AddSidecarManagerRole extends Migration {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe V20230502164900_AddSidecarManagerAndReaderRole?

@moesterheld
Copy link
Contributor Author

I don't know if we should make these changes in this PR or create an issue for that.

created #15844

Copy link
Contributor

@AntonEbel AntonEbel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mpfz0r mpfz0r left a comment

Choose a reason for hiding this comment

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

LGTM as well 👍

@moesterheld moesterheld merged commit 346ee6d into master Jul 25, 2023
4 checks passed
@moesterheld moesterheld deleted the feature/12044-get-apisidecarsall-requires-admin-privileges-should-it branch July 25, 2023 08:53
@ryan-carroll-graylog
Copy link
Contributor

@kroepke @moesterheld @AntonEbel can this be backported to 5.0?

There's a HubSpot issue open for another customer with this same issue (HS-1821909158) who's on Graylog 5.0.10.

AntonEbel pushed a commit that referenced this pull request Sep 12, 2023
…#15380)

* fix: add `sidecars:read` to Sidecar System role

* feat: add SIDECARS_READ restriction to `/sidecars/configurations` endpoint

* fix: remove `sidecars:read` from Sidecar System role

reason: `sidecars:read` gives too many privileges to the system user. It is necessary that the sidecar user cannot read configurations of all sidecars

* feat: add Sidecar Manager role

* changelog

* fix: add license header

* fix: add license header

* add reader role and add permissions to manager

* add collector permissions for manager

* change changelog, rename migration

---------

Co-authored-by: Anton Ebel <anton.ebel@graylog.com>
(cherry picked from commit 346ee6d)
AntonEbel pushed a commit that referenced this pull request Sep 12, 2023
…#15380)

* fix: add `sidecars:read` to Sidecar System role

* feat: add SIDECARS_READ restriction to `/sidecars/configurations` endpoint

* fix: remove `sidecars:read` from Sidecar System role

reason: `sidecars:read` gives too many privileges to the system user. It is necessary that the sidecar user cannot read configurations of all sidecars

* feat: add Sidecar Manager role

* changelog

* fix: add license header

* fix: add license header

* add reader role and add permissions to manager

* add collector permissions for manager

* change changelog, rename migration

---------

Co-authored-by: Anton Ebel <anton.ebel@graylog.com>
(cherry picked from commit 346ee6d)
AntonEbel added a commit that referenced this pull request Sep 15, 2023
Co-authored-by: Anton Ebel <anton.ebel@graylog.com>
Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
fix timestamp of sidecar roles migration (#16477)
AntonEbel added a commit that referenced this pull request Sep 15, 2023
Co-authored-by: Anton Ebel <anton.ebel@graylog.com>
Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
fix timestamp of sidecar roles migration (#16477)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GET /api/sidecars/all requires admin privileges. Should it ?
4 participants