reporting icon indicating copy to clipboard operation
reporting copied to clipboard

Report definitions only working correctly in the Private tenant space[BUG]

Open ARud12 opened this issue 3 years ago • 28 comments

When creating a report definition in any other tenant space that is not private, the report definition will download the wrong dashboard. One is able to create a report definition in any tenant space successfully, but when downloading the generated report, it downloads the wrong thing.

image The above image shows the pdf that downloaded when I tried to download the report created in the report definition of the Admin tenant space. It generates the above because the dashboard that I tried to download is not available in the private tenant space, hence it cannot find it. Any advice if there is a fix for this?

ARud12 avatar Nov 08 '22 12:11 ARud12

image

ARud12 avatar Nov 08 '22 13:11 ARud12

image My user has reports_full_access

ARud12 avatar Nov 09 '22 07:11 ARud12

Any feedback on this?

ARud12 avatar Nov 10 '22 05:11 ARud12

The URL is also changed when clicking on the Dashboard under source that is created via the report definition:

Suppose to look like this: http://172.17.5.251:5601/app/dashboards?security_tenant=admin_tenant#/view/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=(time:(from:'2022-11-09T06:03:14.060Z',to:'2022-11-10T06:03:14.060Z'))&_a=(description:'Analyze%20mock%20flight%20data%20for%20OpenSearch-Air,%20Logstash%20Airways,%20OpenSearch%20Dashboards%20Airlines%20and%20BeatsWest',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),timeRestore:!t,title:'%5BFlights%5D%20Global%20Flight%20Dashboard',viewMode:view)

Mine looks like this: http://172.17.5.251:5601/app/dashboards?security_tenant=POST#/view/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=(time:(from:'2022-11-09T06:03:14.060Z',to:'2022-11-10T06:03:14.060Z'))&_a=(description:'Analyze%20mock%20flight%20data%20for%20OpenSearch-Air,%20Logstash%20Airways,%20OpenSearch%20Dashboards%20Airlines%20and%20BeatsWest',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),timeRestore:!t,title:'%5BFlights%5D%20Global%20Flight%20Dashboard',viewMode:view)

Pay attention to what happens with the security tenant part.

ARud12 avatar Nov 10 '22 08:11 ARud12

Any feedback on this?

ARud12 avatar Nov 13 '22 14:11 ARud12

@ARud12 I couldn't reproduce the issue. I tried downloading a report with custom tenant and the dashboard was not in private tenant. Could you add steps to reproduce the issue and logs?

rupal-bq avatar Nov 15 '22 01:11 rupal-bq

I am using the security plugin, together with ldap configuration. Can this be an issue? Can it be a problem if I run opensearch 1.3.2 but opensearch dashboards 1.3.1?

Can you maybe tell me why the security_tenant is not passed in the URL? Instead of passing admin_tenant is passes POST as the tenant?

Log attached - pay attention to 304 error: container (9).log

ARud12 avatar Nov 15 '22 09:11 ARud12

Any feedback on this?

ARud12 avatar Nov 17 '22 06:11 ARud12

opensearch and opensearch dashboards version should be compatible. Check if you get the same error for same version of opensearch and dashboards. If you get the same error, please share steps you followed so that I can reproduce the issue.

rupal-bq avatar Nov 17 '22 18:11 rupal-bq

Error still occurs on version 1.3.2 for both opensearch and opensearch dashboards. Can you test on 1.3.2? Is there any explicit security configurations for the reports?

ARud12 avatar Nov 18 '22 06:11 ARud12

Create a dashboard in any other tenant space - try to download the report from the report definition. A report will download but it will be a screenshot of the dashboards tab of the Private tenant, because the dashboard I want to download is not available in the Private tenant space. Image above shows how the pdf looks like. Also attached logs.

ARud12 avatar Nov 18 '22 06:11 ARud12

Any feedback on this?

ARud12 avatar Nov 21 '22 06:11 ARud12

Hi @ARud12, I tried downloading report from report definition in custom tenant space. worked fine for me. What do you mean by dashboard is not available in private tenant space? Are you using private tenant space but get a download report option from other tenant space or irrespective of your current tenant space, downloading reports tries to access private tenant space. Can you share how did you setup your system and how to reproduce this? Is this specific to one report or you get same error for every report?

Also, multi-tenancy related configurations for 1.3.x are here.

rupal-bq avatar Nov 21 '22 18:11 rupal-bq

Irrespective of my current tenant space, downloading reports from the report definition tries to access the private tenant space. (this only happens with the reporting definition)

  1. Create a report definition in the Admin tenant space
  2. Try to download the report from the Admin tenant space

Expected result-Downloads the report created in the Admin tenant space

My result-Tries to access the private tenant space and is unable to download the correct dashboard because it enters the private tenant space where the dashboard is not accessible

ARud12 avatar Nov 21 '22 18:11 ARud12

Any update on this?

ARud12 avatar Nov 24 '22 13:11 ARud12

Hi @ARud12, I couldn't reproduce the issue. Please check steps I followed and let me know if you have done anything differently so that I can reproduce the issue.

  1. Default opensearch 1.3.2 setup
  2. login as admin.
  3. switch to admin_tenant.
  4. add sample flights data in admin_tenant.
  5. create a report definition in admin_tenant.
  6. Download report from definition.

Also tried a different user with roles reports_full_access, own_index, alerting_full_access, all_access and downloaded report from definitions.

Although, I don't see security_tenant=POST in logs.

rupal-bq avatar Nov 29 '22 02:11 rupal-bq

Are you using the security plugin?

ARud12 avatar Nov 29 '22 07:11 ARud12

Are you using the security plugin?

Yes

rupal-bq avatar Nov 29 '22 17:11 rupal-bq

It is very strange. Do you have any idea what can be causing this? I am also using a gateway...

ARud12 avatar Dec 12 '22 08:12 ARud12

@rupal-bq Any feedback on this?

ARud12 avatar Jan 03 '23 06:01 ARud12

@rupal-bq Is there a specific index that needs to be accessible for the reports definition functionality to work properly? Can you also show me the reports_full_access configuration you are using? Can you also show me your security configuration for the roles reports_full_access, own_index, alerting_full_access, all_access?

ARud12 avatar Jan 10 '23 09:01 ARud12

It seems like with the report definitions, the security tenant is not passed through with the request.

ARud12 avatar Jan 12 '23 07:01 ARud12

Any feedback on this? @rupal-bq

ARud12 avatar Jan 23 '23 07:01 ARud12

Any feedback on this? @rupal-bq

ARud12 avatar Jan 30 '23 06:01 ARud12

@ARud12 Sorry for the delay but I am not able to reproduce this issue. If user has all_access then user has all permissions required. To understand the root cause, more information is required.

  • Are you having this issue with pdf/png report only or csv as well?
  • Does on-demand report from Dashboard's page work for you?
  • We recently changed backend logic. Can reproduce this issue with new reporting plugin release in v2.5.0?
  • Can you please provide setup steps to reproduce this issue? Thanks!

rupal-bq avatar Feb 03 '23 16:02 rupal-bq

Can you show me the reports_full_access configuration you are using? Can you also show me your security configuration for the roles reports_full_access, own_index, alerting_full_access, all_access?

ARud12 avatar Feb 07 '23 07:02 ARud12

@ARud12 Please check https://opensearch.org/docs/1.2/security-plugin/access-control/users-roles/ for details on all roles and you can also check permissions at https://opensearch.org/docs/1.2/security-plugin/access-control/users-roles/

Please provide requested information so that we can reproduce the issue and dive deep to understand the root cause.

rupal-bq avatar Feb 09 '23 23:02 rupal-bq

Problem is only with pdf/png report definition creation. On demand report generations works fine. Currently running OpenSearch and Opensearch dashboards 1.3.1 - is there any specific configuration for reports? Please refer to earlier comments on test setup.

ARud12 avatar Feb 21 '23 06:02 ARud12