Commit graph

634 commits

Author SHA1 Message Date
Tim Roes 9bab09a0e0
Remove queryManager from vis docs (#23923) 2018-10-17 09:51:18 +02:00
lcawl 85c62afc2f [DOCS] Fixes broken link in monitoring page 2018-10-04 13:13:34 -07:00
Lisa Cawley 3a9deb0850
[DOCS] Update Kibana monitoring tasks (#23736) 2018-10-04 11:31:15 -07:00
Brandon Kobel 937e07c5f1
Limiting maximum number of Spaces (#23673)
* Limiting the number of spaces

* Adding docs

* Adding forgotten fixture

* Fixing tslint error

* Adjusting docs

* Changing test descriptions from Boom.badRequest to bad request

* Updating error snapshots
2018-10-03 09:09:12 -07:00
Court Ewing fd050fbcd3
docs: note about permissions for grok debugger (#23664) 2018-10-03 11:35:46 -04:00
Larry Gregory 1f38026731
Spaces Phase 1 (#21408)
### Review notes
This is generally ready for review. We are awaiting https://github.com/elastic/elasticsearch/issues/32777 to improve handling when users do not have any access to Kibana, but this should not hold up the overall review for this PR.

This PR is massive, there's no denying that. Here's what to focus on:
1) `x-pack/plugins/spaces`: This is, well, the Spaces plugin. Everything in here is brand new. The server code is arguably more important, but feel free to review whatever you see fit.
2) `x-pack/plugins/security`: There are large and significant changes here to allow Spaces to be securable. To save a bit of time, you are free to ignore changes in `x-pack/plugins/security/public`: These are the UI changes for the role management screen, which were previously reviewed by both us and the design team.
3) `x-pack/test/saved_object_api_integration` and `x-pack/test/spaces_api_integration`: These are the API test suites which verify functionality for:
     a) Both security and spaces enabled
     b) Only security enabled
     c) Only spaces enabled

What to ignore:
1) As mentioned above, you are free to ignore changes in `x-pack/plugins/security/public`
2) Changes to `kibana/src/server/*`: These changes are part of a [different PR that we're targeting against master](https://github.com/elastic/kibana/pull/23378) for easier review.

## Saved Objects Client Extensions
A bulk of the changes to the saved objects service are in the namespaces PR, but we have a couple of important changes included here.

### Priority Queue for wrappers
We have implemented a priority queue which allows plugins to specify the order in which their SOC wrapper should be applied: `kibana/src/server/saved_objects/service/lib/priority_collection.ts`. We are leveraging this to ensure that both the security SOC wrapper and the spaces SOC wrapper are applied in the correct order (more details below).

### Spaces SOC Wrapper
This wrapper is very simple, and it is only responsible for two things:
1) Prevent users from interacting with any `space` objects (use the Spaces client instead, described below)
2) Provide a `namespace` to the underlying Saved Objects Client, and ensure that no other wrappers/callers have provided a namespace. In order to accomplish this, the Spaces wrapper uses the priority queue to ensure that it is the last wrapper invoked before calling the underlying client.

### Security SOC Wrapper
This wrapper is responsible for performing authorization checks. It uses the priority queue to ensure that it is the first wrapper invoked. To say another way, if the authorization checks fail, then no other wrappers will be called, and the base client will not be called either. This wrapper authorizes users in one of two ways: RBAC or Legacy. More details on this are below.


### Examples:
`GET /s/marketing/api/saved_objects/index-pattern/foo`

**When both Security and Spaces are enabled:**
1) Saved objects API retrieves an instance of the SOC via `savedObjects.getScopedClient()`, and invokes its `get` function
2) The Security wrapper is invoked.
    a) Authorization checks are performed to ensure user can access this particular saved object at this space.
3) The Spaces wrapper is invoked.
   a) Spaces applies a `namespace` to be used by the underlying client
4) The underlying client/repository are invoked to retrieve the object from ES.

**When only Spaces are enabled:**
1) Saved objects API retrieves an instance of the SOC via `savedObjects.getScopedClient()`, and invokes its `get` function
2) The Spaces wrapper is invoked.
   a) Spaces applies a `namespace` to be used by the underlying client
3) The underlying client/repository are invoked to retrieve the object from ES.

**When only Security is enabled:**
(assume `/s/marketing` is no longer part of the request)
1) Saved objects API retrieves an instance of the SOC via `savedObjects.getScopedClient()`, and invokes its `get` function
2) The Security wrapper is invoked.
   a) Authorization checks are performed to ensure user can access this particular saved object globally.
3) The underlying client/repository are invoked to retrieve the object from ES.

## Authorization
Authorization changes for this project are centered around Saved Objects, and builds on the work introduced in RBAC Phase 1.

### Saved objects client
#### Security without spaces
When security is enabled, but spaces is disabled, then the authorization model behaves the same way as before: If the user is taking advantage of Kibana Privileges, then we check their privileges "globally" before proceeding. A "global" privilege check specifies `resources: ['*']` when calling the [ES _has_privileges api.](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html). Legacy users (non-rbac) will continue to use the underlying index privileges for authorization.

#### Security with spaces
When both plugins are enabled, then the authorization model becomes more fine-tuned. Rather than checking privileges globally, the privileges are checked against a specific resource that matches the user's active space. In order to accomplish this, the Security plugin needs to know if Spaces is enabled, and if so, it needs to ask Spaces for the user's active space. The subsequent call to the `ES _has_privileges api` would use `resources: ['space:marketing']` to verify that the user is authorized at the `marketing` space. Legacy users (non-rbac) will continue to use the underlying index privileges for authorization. **NOTE** The legacy behavior implies that those users will have access to all spaces. The read/write restrictions are still enforced, but there is no way to restrict access to a specific space for legacy auth users.

#### Spaces without security
No authorization performed. Everyone can access everything.

### Spaces client
Spaces, when enabled, prevents saved objects of type `space` from being CRUD'd via the Saved Objects Client. Instead, the only "approved" way to work with these objects is through the new Spaces client (`kibana/x-pack/plugins/spaces/lib/spaces_client.ts`).

When security is enabled, the Spaces client performs its own set of authorization checks before allowing the request to proceed. The Spaces client knows which authorization checks need to happen for a particular request, but it doesn't know _how_ to check privileges. To accomplish this, the spaces client will delegate the check security's authorization service.

#### FAQ: Why oh why can't you used the Saved Objects Client instead!?
That's a great question! We did this primarily to simplify the authorization model (at least for our initial release). Accessing regular saved objects follows a predictible authorization pattern (described above). Spaces themselves inform the authorization model, and this interplay would have greatly increased the complexity. We are brainstorming ideas to obselete the Spaces client in favor of using the Saved Objects Client everywhere, but that's certainly out of scope for this release.



## Test Coverage
### Saved Objects API
A bulk of the changes to enable spaces are centered around saved objects, so we have spent a majority of our time automating tests against the saved objects api.

**`x-pack/test/saved_object_api_integration/`** contains the test suites for the saved objects api. There is a `common/suites` subfolder which contains a bulk of the test logic. The suites defined here are used in the following test configurations:
1) Spaces only: `./spaces_only`
2) Security and spaces: `./security_and_spaces`
3) Security only: `./security_only`

Each of these test configurations will start up ES/Kibana with the appropriate license and plugin set. Each set runs through the entire test suite described in `common/suites`. Each test with in each suite is run multiple times with different inputs, to test the various permutations of authentication, authorization type (legacy vs RBAC), space-level privileges, and the user's active space.  

### Spaces API
Spaces provides an experimental public API.

**`x-pack/test/spaces_api_integration`** contains the test suites for the Spaces API. Similar to the Saved Objects API tests described above, there is a `common/suites` folder which contains a bulk of the test logic. The suites defined here are used in the following test configurations:
1) Spaces only: `./spaces_only`
2) Security and spaces: `./security_and_spaces`


### Role Management UI
We did not provide any new functional UI tests for role management, but the existing suite was updated to accomidate the screen rewrite.

We do have a decent suite of jest unit tests for the various components that make up the new role management screen. They're nested within `kibana/x-pack/plugins/security/public/views/management/edit_role`

### Spaces Management UI
We did not provide any new functional UI tests for spaces management, but the components that make up the screens are well-tested, and can be found within `kibana/x-pack/plugins/spaces/public/views/management/edit_space`

### Spaces Functional UI Tests
There are a couple of UI tests that verify _basic_ functionality. They assert that a user can login, select a space, and then choose a different space once inside: `kibana/x-pack/test/functional/apps/spaces`



## Reference

Notable child PRs are listed below for easier digesting. Note that some of these PRs are built on other PRs, so the deltas in the links below may be outdated. Cross reference with this PR when in doubt.

### UI
- Reactify Role Management Screen: https://github.com/elastic/kibana/pull/19035
- Space Aware Privileges UI: https://github.com/elastic/kibana/pull/21049
- Space Selector (in Kibana Nav): https://github.com/elastic/kibana/pull/19497
- Recently viewed Widget: https://github.com/elastic/kibana/pull/22492
- Support Space rename/delete: https://github.com/elastic/kibana/pull/22586

### Saved Objects Client
- ~~Space Aware Saved Objects: https://github.com/elastic/kibana/pull/18862~~
- ~~Add Space ID to document id: https://github.com/elastic/kibana/pull/21372~~
- Saved object namespaces (supercedes #18862 and #21372):  https://github.com/elastic/kibana/pull/22357
- Securing saved objects: https://github.com/elastic/kibana/pull/21995
- Dedicated Spaces client (w/ security): https://github.com/elastic/kibana/pull/21995

### Other
- Public Spaces API (experimental): https://github.com/elastic/kibana/pull/22501
- Telemetry: https://github.com/elastic/kibana/pull/20581
- Reporting: https://github.com/elastic/kibana/pull/21457
- Spencer's original Spaces work: https://github.com/elastic/kibana/pull/18664
- Expose `spaceId` to "Add Data" tutorials: https://github.com/elastic/kibana/pull/22760

Closes #18948 

"Release Note: Create spaces within Kibana to organize dashboards, visualizations, and other saved objects. Secure access to each space when X-Pack Security is enabled"
2018-10-01 07:09:33 -04:00
Martijn Rondeel 7f1ee07405 Add ElastAlert Kibana Plugin to known plugins list (#23598)
* Add ElastAlert Kibana Plugin to known plugins list

* Add author of ElastAlert plugin
2018-09-28 10:47:27 +02:00
Lisa Cawley 186cea2d74
[DOCS] Adds TLS info to licensing page (#20638) 2018-09-27 10:09:14 -07:00
Tim Roes 832b896877
Remove last mentions of spy panels (#23527) 2018-09-26 16:53:23 +02:00
Matt Bargar fceddf8610
Mention license change for autocomplete 2018-09-25 12:45:22 -04:00
Larry Gregory 33acd60f9f
Remove ability to implicitly find across all types (#23198) 2018-09-19 07:22:43 -04:00
Lisa Cawley 428ee421ee
[DOCS] Adds troubleshooting info for monitoring (#21005) 2018-09-17 18:27:36 -07:00
Jonathan Budzenski f5d44f6d9f
Add optimize and --no-optimize flags (#16302)
* Add optimize flags

* update docs to --no-optimize

* docs

* extra newline

* lint

* update mocks

* update default config

* update snapshots
2018-09-17 12:45:51 -05:00
Jonathan Budzenski cc10fc02f6
[es] set default port based on protocol (#21564)
* [es] set default port based on protocol

* explicit https/http check

* url parses port as string

* breaking changes docs

* remove 9200 fallback
2018-09-17 09:54:05 -05:00
Caroline Horn 9c83f81f08
Visualize LESS to SASS (#22679) 2018-09-14 13:25:03 -04:00
Lisa Cawley 8ed6084db9
[DOCS] Synchronize location of Breaking Changes (#22939) 2018-09-12 09:19:38 -07:00
Stacey Gammon ac03ffb42c
Default to chromium and add deprecation warning for phantom. (#21505)
* Default to chromium and add deprecation warning for phantom.

* use int, not float
2018-09-11 13:37:57 -04:00
Matt Bargar 15322e7256
Expose max_concurrent_shard_requests for _msearch requests (#22379)
Allows Kibana users to configure the max_concurrent_shard_requests param used by Kibana when sending _msearch requests. Exposes the config as an advanced setting. By default we won't send the param at all, relying on the ES default instead.
2018-09-11 11:23:18 -04:00
truman.p.du 6d682155e5 List "Cleaner" plugin for setting index TTL (#22616) 2018-09-10 07:03:35 -07:00
Court Ewing 54ab5a7374
docs: dashboard import/export API (#22835)
* docs: dashboard import/export API

* docs: clarify response handling of errors in import api
2018-09-07 15:52:08 -04:00
Larry Gregory 5f96c903f3
Deprecate xpack:defaultAdminEmail for monitoring alerts (#22195) 2018-09-06 10:26:05 -04:00
Tim Roes 9c01863c0a
Fix react vis type documentation (#22573) 2018-09-05 09:35:18 +02:00
Jonathan Budzenski a64738d277
[docs] fix missing float 2018-09-04 17:09:16 -05:00
Jonathan Budzenski e89abb3a39
[config] logging.useUTC -> logging.timezone (#21561)
* [config] logging.useUTC -> logging.timezone

* docs

* [env] exit if starting as root

* fix import path

* add link and timezone example

* Revert "[env] exit if starting as root"

This reverts commit f6e9090833a5180fe360a9ff54543c37c0ca3a58.
2018-09-04 16:52:51 -05:00
Tim Roes 8c3f4af8ed
Fix link in embed visualize docs (#22557) 2018-08-31 08:49:31 +02:00
Brandon Kobel 7ecd1357d8
Changing doc link from ES to Stack docs (#22497) 2018-08-29 11:06:27 -04:00
Brandon Kobel 50facf42e9
Fixing a few typos and some links that were updated (#22470) 2018-08-29 07:33:09 -04:00
Søren Louv-Jansen 879a8b158d
[Docs] Use literal asterix in APM docs (#22460) 2018-08-28 21:48:19 +02:00
Søren Louv-Jansen 11488d5055
[APM] Revert to using apm-* as default indices (#22445)
* [APM] Revert to using apm-* as default indices

* Update docs
2018-08-28 17:17:53 +02:00
Søren Louv-Jansen 22d3bcf334
[docs] Import APM dashboards in 6.4+ (#22439) 2018-08-28 13:33:08 +02:00
Aaron Zhao 02a56b39b1 doc: add calendar vis plugin link to docs (#22366) 2018-08-27 02:49:15 -04:00
Lisa Cawley 0ff0832281
[DOCS] Updates links to user management APIs (#22161) 2018-08-24 08:34:10 -07:00
Brandon Kobel 77597d6288
Move note about needing access to additional indices above the fold (#22248) 2018-08-23 06:40:26 -04:00
Jason Rhodes c7c3654a2a
Updates * characters to an escaped * (#22269)
GitHub's asciidoc parser handles `*` characters fine but markdown thinks its italicizing unless you escape the first asterisk. Subsequent asterisks on the same line can stay unescaped and should work fine.
2018-08-22 15:19:58 -04:00
Marius Dragomir a5f74131c2
Add clarification for server.ssl.supportedProtocols setting (#22244)
* Add clarification for server.ssl.supportedProtocols setting

Added clarification that the setting has to be an array. With the current wording you can assume that you can just add it as a simple string.

* Update settings.asciidoc

* Update settings.asciidoc

extra dot
2018-08-22 19:57:51 +03:00
lcawl 068d82d116 [DOCS] Updates links to user APIs 2018-08-17 23:27:19 -07:00
lcawl 7b921ca2b9 [DOCS] Fixes links to role management APIs 2018-08-17 21:53:17 -07:00
lcawl 34b140b2ba [DOCS] Fixes links to role management APIs 2018-08-17 10:45:48 -07:00
Spencer 0afca8ed95
[docs/vis] document Top Hit metric agg (#20433) 2018-08-16 15:08:40 -07:00
gchaps 91335df93a
[DOCS] New tutorial for exploring Kibana with sample data set (#21699)
* [DOCS] New tutorial for exploring Kibana with sample data set

* [DOCS] Incorporated review comments into sample tutorial

* [DOCS] GS: Edits for consistency
2018-08-16 05:52:38 -07:00
Deb Adair 0dcb8ac430 [DOCS] Fixing cross doc links to stack overview security topic 2018-08-15 15:14:41 -07:00
debadair 0c9657c43b
Fix bad cross doc link to auditing topic (#21938) 2018-08-13 11:17:08 -07:00
Brandon Kobel add876281b
Adding RBAC Phase 1 Docs (#21178)
* Beginning to work on the role management APIs. Added docs for GET

* Adding PUT docs

* Adding PUT details

* Adding delete docs

* Fixing linking

* Adding Kibana privileges section

* Fixing dashboard only mode docs

* Fixing a few more references to managing roles

* Beginning to work on authorization docs, might be moving some to
stack-docs

* Collapsing authorization description in the kibana privileges page

* Adding audit logging section

* Revising the language on the Kibana role management section

* Splitting back out the auth/privileges and adding legacy fallback
details

* Revising language around impact of disabling security

* Changing Kibana to {kib} and Elasticsearch to {es}

* Beginning to work on developer centric docs

* Fixing some formatting, adding some diagrams

* Adding note about the role management APIs

* Adding overview, fixing small syntax issues

* Fixing chunk name for transitioning to application privileges

* Adjusting tone for the authorization introduction

* Changing the tone and structure of the RBAC docs

* Deleting blog stuff after refactoring

* Addressing first round of peer review comments

* Fixing endpoints links

* Peer review suggested edits

* Addressing other PR feedback
2018-08-13 12:06:25 -04:00
Nathan Reese a0dd3e6089
remove deprectated /shorten API (#21861)
* remove deprectated /shorten API

* breaking change log
2018-08-13 07:27:20 -06:00
Nathan Reese 78e1c8b147
add section about running API tests in functional test documentation (#21738)
* add section about running API tests in functional test documentation

* list valid configs under more section
2018-08-09 15:54:24 -06:00
Nathan Reese 803a3f1c2d
Move /shorten to /api/shorten_url (#21808)
* Move /shorten to /api/shorten_url

* better API test assertions

* add API documenation

* use async await

* import dependencies instead of pass in
2018-08-09 15:05:16 -06:00
Casper Hübertz 92026c3db8
[DOCS] APM UI docs for ML and query bar features (#21727)
Adding content for Machine Learning integration and query bar UI in the Using the APM UI docs.
2018-08-08 11:54:17 +02:00
Tim Roes cb8fcdca16
Update destroy documentation of vis loader (#21649) 2018-08-06 12:02:23 +02:00
DeDe Morton 0939151c38
[Docs] Light edit to docker content (#21240) 2018-08-02 15:53:22 -07:00
Søren Louv-Jansen 2ad265b73f
[APM] Document APM config settings (#21492)
* [APM] Document APM config settings

* Don’t discern between OSS and xpack config options

* Change to apm_oss

* Reword docs
2018-08-01 15:24:34 +02:00