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

Append Kibana Security APIs #580

Merged
merged 2 commits into from
Apr 29, 2022
Merged

Append Kibana Security APIs #580

merged 2 commits into from
Apr 29, 2022

Conversation

stefnestor
Copy link
Contributor

@stefnestor stefnestor commented Mar 3, 2022

@pmuellr @jportner to better introspect Kibana Security/Space issues, adds APIs into Kibana diagnostic:

  • List Kibana Roles
  • List Kibana Spaces
    • Enables some introspection to mitigate this's impact.
  • Get Current Kibana User
    • URL marks internal, but this is documented here & is frequently used to diagnose Kibana permission issues.

Kindly review

  1. If endpoints return user private/sensitive data.
  2. Initial available versions.
    • I pulled via Github search / oldest doc, but there's been a lot of migrations to pinpoint oldest well.

cc: @pickypg

@pmuellr
Copy link
Member

pmuellr commented Mar 4, 2022

I'm just seeing a single commit 7cd3567 with a change to a yaml file. Is there supposed to be some code here as well?

@stefnestor
Copy link
Contributor Author

Great question. There's a CLI which targets towards Kibana. When Kibana runs it cycles through the endpoints listed in the YAML. Other CLI choices would point you to a different file in our YAML folder. So appending endpoints to the YAML is sufficient.

In the future, if we expand to cycle through spaces that will be non-YAML code, but the above is the stop gap on what could have already existed to setup the other conversation.

@pmuellr
Copy link
Member

pmuellr commented Mar 4, 2022

Ah, I see. In that case, I'm not familiar with these APIs, so can't help out with this PR.

@jportner
Copy link
Contributor

jportner commented Mar 7, 2022

  • List Kibana roles: This should be OK, it doesn't return private data. This was introduced in RBAC Phase 1 kibana#19723, initial available version is 6.4.0.
  • List Kibana spaces: This should be OK but it's not clear to me how having this information will assist in troubleshooting the linked issue. Can you clarify what the expectation here is?
  • Get Current Kibana User: This can contain some "private data" in terms of personal information, example:
    {
      "username": "elastic",
      "roles": [
        "superuser"
      ],
      "full_name": null,
      "email": null,
      "metadata": {
        "_reserved": true
      },
      "enabled": true,
      "authentication_realm": {
        "name": "reserved",
        "type": "reserved"
      },
      "lookup_realm": {
        "name": "reserved",
        "type": "reserved"
      },
      "authentication_type": "realm",
      "authentication_provider": {
        "type": "basic",
        "name": "basic"
      }
    }
    If the user is authenticated via SSO and their ES is configured to map attributes correctly, the full_name and/or email fields can be populated. That said, the rest of this data is really valuable for troubleshooting, and I think we can justify collecting this small amount of personal information for a support case where we likely already have this info anyway.

@pmuellr
Copy link
Member

pmuellr commented Mar 8, 2022

List Kibana spaces: This should be OK but it's not clear to me how having this information will assist in troubleshooting the linked issue. Can you clarify what the expectation here is?

Currently, the diagnostics get the alerting rules and connectors from the default space only. We'd like to have them for all spaces, so presumably the space names will end up showing up here. The diagnostics code will eventually be changed to get the list of spaces, and for each one, get all the rules and connectors from each space.

@jportner
Copy link
Contributor

jportner commented Mar 9, 2022

Currently, the diagnostics get the alerting rules and connectors from the default space only. We'd like to have them for all spaces, so presumably the space names will end up showing up here. The diagnostics code will eventually be changed to get the list of spaces, and for each one, get all the rules and connectors from each space.

Gotcha, that makes sense.

@stefnestor the List Kibana Spaces API was introduced in elastic/kibana#21408, initial available version is 6.5.0.
However, the include_authorized_purposes parameter wasn't added until 7.11.0. I would omit that from your test script entirely, it won't give you useful information.

src/main/resources/kibana-rest.yml Outdated Show resolved Hide resolved
src/main/resources/kibana-rest.yml Show resolved Hide resolved
Copy link
Contributor Author

@stefnestor stefnestor left a comment

Choose a reason for hiding this comment

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

Accepting JPortner changes

@stefnestor
Copy link
Contributor Author

Thanks, both 🎉 ! Late circling back, but changes accepted & ready for Dev approval for SupportOps to then merge. 🙏🏼

Copy link
Member

@pickypg pickypg left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants