Skip to content

Commit 0d825f8

Browse files
Merge branch '7.x' into backport/7.x/pr-45299
2 parents c41705e + e56ce66 commit 0d825f8

File tree

77 files changed

+2700
-1532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2700
-1532
lines changed
79 KB
Loading
184 KB
Loading
132 KB
Loading
96.7 KB
Loading

docs/user/security/index.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ cause Kibana's authorization to behave unexpectedly.
3737
include::authorization/index.asciidoc[]
3838
include::authorization/kibana-privileges.asciidoc[]
3939
include::api-keys/index.asciidoc[]
40-
40+
include::rbac_tutorial.asciidoc[]
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
[[space-rbac-tutorial]]
2+
=== Tutorial: Use role-based access control to customize Kibana spaces
3+
4+
With role-based access control (RBAC), you can provide users access to data, tools,
5+
and Kibana spaces. In this tutorial, you will learn how to configure roles
6+
that provide the right users with the right access to the data, tools, and
7+
Kibana spaces.
8+
9+
[float]
10+
==== Scenario
11+
12+
Our user is a web developer working on a bank's
13+
online mortgage service. The web developer has these
14+
three requirements:
15+
16+
* Have access to the data for that service
17+
* Build visualizations and dashboards
18+
* Monitor the performance of the system
19+
20+
You'll provide the web developer with the access and privileges to get the job done.
21+
22+
[float]
23+
==== Prerequisites
24+
25+
To complete this tutorial, you'll need the following:
26+
27+
* **Administrative privileges**: You must have a role that grants privileges to create a space, role, and user. This is any role which grants the `manage_security` cluster privilege. By default, the `superuser` role provides this access. See the {ref}/built-in-roles.html[built-in] roles.
28+
* **A space**: In this tutorial, use `Dev Mortgage` as the space
29+
name. See <<spaces-managing, spaces management>> for
30+
details on creating a space.
31+
* **Data**: You can use <<tutorial-sample-data, sample data>> or
32+
live data. In the steps below, Filebeat and Metricbeat data are used.
33+
34+
[float]
35+
==== Steps
36+
37+
With the requirements in mind, here are the steps that you will work
38+
through in this tutorial:
39+
40+
* Create a role named `mortgage-developer`
41+
* Give the role permission to access the data in the relevant indices
42+
* Give the role permission to create visualizations and dashboards
43+
* Create the web developer's user account with the proper roles
44+
45+
[float]
46+
==== Create a role
47+
48+
Go to **Management > Roles**
49+
for an overview of your roles. This view provides actions
50+
for you to create, edit, and delete roles.
51+
52+
[role="screenshot"]
53+
image::security/images/role-management.png["Role management"]
54+
55+
56+
You can create as many roles as you like. Click *Create role* and
57+
provide a name. Use `dev-mortgage` because this role is for a developer
58+
working on the bank's mortgage application.
59+
60+
61+
[float]
62+
==== Give the role permission to access the data
63+
64+
Access to data in indices is an index-level privilege, so in
65+
*Index privileges*, add lines for the indices that contain the
66+
data for this role. Two privileges are required: `read` and
67+
`view_index_metadata`. All privileges are detailed in the
68+
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html[security privileges] documentation.
69+
70+
In the screenshots, Filebeat and Metricbeat data is used, but you
71+
should use the index patterns for your indices.
72+
73+
[role="screenshot"]
74+
image::security/images/role-index-privilege.png["Index privilege"]
75+
76+
[float]
77+
==== Give the role permission to create visualizations and dashboards
78+
79+
By default, roles do not give Kibana privileges. Click **Add space
80+
privilege** and associate this role with the `Dev Mortgage` space.
81+
82+
To enable users with the `dev-mortgage` role to create visualizations
83+
and dashboards, click *All* for *Visualize* and *Dashboard*. Also
84+
assign *All* for *Discover* because it is common for developers
85+
to create saved searches while designing visualizations.
86+
87+
[role="screenshot"]
88+
image::security/images/role-space-visualization.png["Associate space"]
89+
90+
[float]
91+
==== Create the developer's user account with the proper roles
92+
93+
Go to **Management > Users** and click on **Create user** to create a
94+
user. Give the user the `dev-mortgage` role
95+
and the `monitoring-user` role, which is required for users of **Stack Monitoring**.
96+
97+
[role="screenshot"]
98+
image::security/images/role-new-user.png["Developer user"]
99+
100+
Finally, have the developer log in and access the Dev Mortgage space
101+
and create a new visualization.
102+
103+
NOTE: If the user is assigned to only one space, they will automatically enter that space on login.
104+

docs/visualize/most-frequent.asciidoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@ levels of {es} {ref}/search-aggregations-bucket.html[bucket] aggregations.
77

88
The most frequently used visualizations include:
99

10-
* Line, Area and Bar charts
10+
* Line, area, and bar charts
1111
* Pie charts
12-
* Data table
13-
* Metric visualization
14-
* Goal and Gauge visualization
12+
* Data tables
13+
* Metrics, goals, and gauges
1514
* Heat maps
16-
* Tag cloud
15+
* Tag clouds
1716

1817
[float]
1918
=== Configure your visualization
2019

21-
You configure visualizations using the default editor, which is broken into *Metrics* and *Buckets*, and includes a default count
20+
You configure visualizations using the default editor, which is broken into metrics and buckets, and includes a default count
2221
metric. Each visualization supports different configurations for what the metrics and buckets
23-
represent. For example, a Bar chart allows you to add an X-axis:
22+
represent. For example, a bar chart allows you to add an X-axis:
2423

2524
[role="screenshot"]
2625
image::images/add-bucket.png["",height=478]

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
"encode-uri-query": "1.0.1",
164164
"execa": "^3.2.0",
165165
"expiry-js": "0.1.7",
166+
"fast-deep-equal": "^3.1.1",
166167
"file-loader": "4.2.0",
167168
"font-awesome": "4.7.0",
168169
"getos": "^3.1.0",
@@ -226,6 +227,7 @@
226227
"react-resize-detector": "^4.2.0",
227228
"react-router-dom": "^4.3.1",
228229
"react-sizeme": "^2.3.6",
230+
"react-use": "^13.10.2",
229231
"reactcss": "1.2.3",
230232
"redux": "4.0.0",
231233
"redux-actions": "2.2.1",

packages/kbn-utility-types/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ type B = UnwrapPromise<A>; // string
1818

1919
## Reference
2020

21-
- `UnwrapPromise<T>` &mdash; Returns wrapped type of a promise.
22-
- `UnwrapObservable<T>` &mdash; Returns wrapped type of an observable.
23-
- `ShallowPromise<T>` &mdash; Same as `Promise` type, but it flat maps the wrapped type.
21+
- `Ensure<T, X>` &mdash; Makes sure `T` is of type `X`.
2422
- `ObservableLike<T>` &mdash; Minimal interface for an object resembling an `Observable`.
23+
- `RecursiveReadonly<T>` &mdash; Like `Readonly<T>`, but freezes object recursively.
24+
- `ShallowPromise<T>` &mdash; Same as `Promise` type, but it flat maps the wrapped type.
25+
- `UnwrapObservable<T>` &mdash; Returns wrapped type of an observable.
26+
- `UnwrapPromise<T>` &mdash; Returns wrapped type of a promise.

packages/kbn-utility-types/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,19 @@ export type UnwrapObservable<T extends ObservableLike<any>> = T extends Observab
4242
* Converts a type to a `Promise`, unless it is already a `Promise`. Useful when proxying the return value of a possibly async function.
4343
*/
4444
export type ShallowPromise<T> = T extends Promise<infer U> ? Promise<U> : Promise<T>;
45+
46+
/**
47+
* Ensures T is of type X.
48+
*/
49+
export type Ensure<T, X> = T extends X ? T : never;
50+
51+
// If we define this inside RecursiveReadonly TypeScript complains.
52+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
53+
interface RecursiveReadonlyArray<T> extends Array<RecursiveReadonly<T>> {}
54+
export type RecursiveReadonly<T> = T extends (...args: any) => any
55+
? T
56+
: T extends any[]
57+
? RecursiveReadonlyArray<T[number]>
58+
: T extends object
59+
? Readonly<{ [K in keyof T]: RecursiveReadonly<T[K]> }>
60+
: T;

0 commit comments

Comments
 (0)