Skip to content

[BUG][NewHomePage] Avoid Requiring Index Write Permission for the New Homepage Loading #6320

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

Closed
Flyingliuhub opened this issue Apr 3, 2024 · 10 comments
Assignees
Labels
bug Something isn't working home v2.16.0

Comments

@Flyingliuhub
Copy link
Member

Flyingliuhub commented Apr 3, 2024

Describe the bug

The new homepage was introduced in the 2.13 release, which required index write permission when loading. However, this should be avoided as dashboard users may not have index write permission.

To Reproduce
Steps to reproduce the behavior:

  1. Enable useNewHomePage in the advance setting
  2. Open the homepage with users who only have readonly permission users
  3. The new homepage was broken with error message "There was an error loading the homepage."

Steps to reproduce the behavior in local cluster:

  1. Run OS with security plugin yarn opensearch snapshot --security
  2. Run osd yarn start --no-base-path
  3. Login with osd with admin user and enable newhome feature from advanced setting for Global tenant
  4. Copy the default role readall and add Global tenant read permission
  5. Create user test and map to the copied readall_copy role
  6. Login with osd with test user which created in the step 5
  7. Navigate to homepage

Expected behavior
The new home page loading should not required to index write permission

Impact
In case of admin enabled advance setting in the global tenant, all the readonly users under global tenant will impact when visit new home page.

OpenSearch Version
8.13.0

Dashboards Version
2.13.0

Plugins

All the official release plugins

Screenshots

image
newhomepageissue2.mov

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Browser and version [e.g. 22]

Additional context

{
    "statusCode": 403,
    "error": "Forbidden",
    "message": "no permissions for [indices:data/write/index] and User [name=xxx, backend_roles=[xxx], requestedTenant=null]: security_exception: [security_exception] Reason: no permissions for [indices:data/write/index] and User [name=xxxx, backend_roles=[xxxx], requestedTenant=null]"
}

@Flyingliuhub Flyingliuhub added bug Something isn't working untriaged labels Apr 3, 2024
@seraphjiang
Copy link
Member

Thanks @Flyingliuhub @ashwin-pc

@bbarani @wbeckler do you think we should conduct a patch release to include fix for this?

cc: @kgcreative @elfisher

@bbarani
Copy link
Member

bbarani commented Apr 3, 2024

Based on feedback from @ashwin-pc, this bug is in an opt-in feature and the new dashboard is not enabled by default so the risk is low. Please let me know if you think otherwise.

@seraphjiang
Copy link
Member

Based on feedback from @ashwin-pc, this bug is in an opt-in feature and the new dashboard is not enabled by default so the risk is low. Please let me know if you think otherwise.

not sure how we define the opt-in feature, compare the experimental feature , GA feature.

@Flyingliuhub Flyingliuhub removed their assignment Apr 4, 2024
@ananzh
Copy link
Member

ananzh commented Apr 24, 2024

@Flyingliuhub I am not able reproduce this. Here are my steps:

  • Add opensearch_security.auth.anonymous_auth_enabled: true in opensearch_dashboards. also set http:
    anonymous_auth_enabled: true in opensearch
  • I use global admin to set to use new home page
  • log out
  • remove login part from url and reload

Here is the video, and start at 40s
https://github.com/opensearch-project/OpenSearch-Dashboards/assets/79961084/2ae244dc-6c27-46cc-bf70-5392b4387312

@Flyingliuhub
Copy link
Member Author

Flyingliuhub commented Apr 24, 2024

@Flyingliuhub I am not able reproduce this. Here are my steps:

* Add opensearch_security.auth.anonymous_auth_enabled: true in opensearch_dashboards. also set http:
  anonymous_auth_enabled: true in opensearch

* I use global admin to set to use new home page

* log out

* remove login part from url and reload

Here is the video, and start at 40s https://github.com/opensearch-project/OpenSearch-Dashboards/assets/79961084/2ae244dc-6c27-46cc-bf70-5392b4387312

@ananzh You are visit default home, not newhome page, you need to visit the new home page for repro the issue

@ananzh ananzh added v2.15.0 and removed v2.14.0 labels May 4, 2024
@ananzh
Copy link
Member

ananzh commented May 4, 2024

@Flyingliuhub will revisit this in 2.15

@ananzh ananzh removed the v2.15.0 label Jun 7, 2024
@ananzh
Copy link
Member

ananzh commented Jun 7, 2024

Issue is in src/plugins/home/public/services/section_type/section_type.ts . Fix is to update

if (heroes || sections) {
              homepage
                .save({})
                .then(() => error$.next(undefined))
                .catch((e) => error$.next(e));
            }

to

if (heroes || sections) {
              homepage
                .save({})
            }

@Flyingliuhub
Copy link
Member Author

@ananzh 2.15 is release soon. do you have a fix for this issue? we still saw this error in the future.playground with 2.15 build

ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Jun 18, 2024
@ananzh ananzh closed this as completed in 25009ba Jun 19, 2024
opensearch-trigger-bot bot pushed a commit that referenced this issue Jun 19, 2024
…e permission (#7054)

* [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission

Issue Resolve:
#6320

---------

Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 25009ba)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Jun 19, 2024
…e permission (#7054)

* [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission

Issue Resolve:
#6320

---------

Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 25009ba)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this issue Jun 19, 2024
…e permission (#7054) (#7063)

* [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission

Issue Resolve:
#6320

---------



(cherry picked from commit 25009ba)

Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this issue Jun 19, 2024
…e permission (#7054) (#7064)

* [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission

Issue Resolve:
#6320

---------



(cherry picked from commit 25009ba)

Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
@ananzh ananzh reopened this Jun 19, 2024
mengweieric pushed a commit to mengweieric/OpenSearch-Dashboards that referenced this issue Jun 24, 2024
…e permission (opensearch-project#7054)

* [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission

Issue Resolve:
opensearch-project#6320

---------

Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
@ashwin-pc ashwin-pc assigned ruanyl and unassigned ananzh Jul 19, 2024
@ananzh
Copy link
Member

ananzh commented Jul 19, 2024

@ruanyl I think this bug is fixed in #7054. I don't quite remember why I reopen it on the same day when PR is merged. I think it might just be a mistake when I check all the 2.15 PRs. Feel free to verify this.

@ruanyl
Copy link
Member

ruanyl commented Jul 22, 2024

Introduced a new framework for dynamic content rendering #7201, the issue no longer existing, closing this now.

@ruanyl ruanyl closed this as completed Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working home v2.16.0
Projects
None yet
Development

No branches or pull requests

7 participants