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

[BUG] Reports indices cannot be created with reporting_full_access role #309

Open
joshuali925 opened this issue Mar 18, 2022 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@joshuali925
Copy link
Member

joshuali925 commented Mar 18, 2022

Describe the bug
coming from https://discuss.opendistrocommunity.dev/t/reporting-insufficient-permissions-error/8764

To Reproduce
Steps to reproduce the behavior:

  1. Create a user with reporting_full_access
  2. Use created user to generate a report
  3. Error
  displayName: 'AuthorizationException',
  message:
   '[security_exception] no permissions for [indices:admin/create] and User [name=user, backend_roles=[], requestedTenant=]',
  path: '/_plugins/_reports/on_demand',
  query: {},
  body:
   { error:
      { root_cause: [Array],
        type: 'security_exception',
        reason:
         'no permissions for [indices:admin/create] and User [name=user, backend_roles=[], requestedTenant=]' },
     status: 403 },
  statusCode: 403,
  response:
   '{"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/create] and User [name=user, backend_roles=[], requestedTenant=]"}],"type":"security_exception","reason":"no permissions for [indices:admin/create] and User [name=user, backend_roles=[], requestedTenant=]"},"status":403}',
  1. Use admin and open reporting plugin page in dashboards
  2. Repeat step 2, report can now be generated

Expected behavior
A clear and concise description of what you expected to happen.

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@joshuali925 joshuali925 added the bug Something isn't working label Mar 18, 2022
@trunet
Copy link

trunet commented Jun 2, 2022

Workaround acessing with admin first works fine.

I guess adding indices:admin/create permission to create .opendistro-reports-definitions and .opendistro-reports-instances indices to reporting_full_access role would fix not requiring the workaround.

@zhongnansu
Copy link
Member

Is there a way to create the system index (reports_instance_index or report_definition index) when the plugin loads.

@joshuali925
Copy link
Member Author

i remember i tried previously but plugin loads before OpenSearch is ready to take create index requests. still need to look into permissions in security plugin, not sure if user can be allowed to create superadmin index

@gsmith-sas
Copy link

Is it possible to submit an API call, most likely using the "admin" user credentials, that will trigger the required initialization of the indices? If so, we could add such a call to our deployment tooling to take care of this during our initial deployment process. For example, could we request generation of a non-existent report knowing that the request will fail and handling that failure? Would that initialize the indices? I know that doesn't solve the real problem or work for all users, but it might in my narrow use-case.

@joshuali925
Copy link
Member Author

@gsmith-sas Yes that would work if the call is after cluster is ready. Any reporting API would try to create the related index if it doesn't exist, so something like

curl -k https://admin:admin@localhost:9200  # make sure cluster is initialized
curl -k https://admin:admin@localhost:9200/_plugins/_reports/definitions
curl -k https://admin:admin@localhost:9200/_plugins/_reports/instances

would create .opendistro-reports-definitions and .opendistro-reports-instances

cc: @rupal-bq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants