Skip to content

Commit ee5e143

Browse files
committed
Merge branch 'master' into fix-error-rate
2 parents 2162b92 + f398b49 commit ee5e143

File tree

122 files changed

+5153
-3108
lines changed

Some content is hidden

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

122 files changed

+5153
-3108
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/src/plugins/input_control_vis/ @elastic/kibana-app
1818
/src/plugins/management/ @elastic/kibana-app
1919
/src/plugins/kibana_legacy/ @elastic/kibana-app
20+
/src/plugins/timelion/ @elastic/kibana-app
2021
/src/plugins/vis_default_editor/ @elastic/kibana-app
2122
/src/plugins/vis_type_markdown/ @elastic/kibana-app
2223
/src/plugins/vis_type_metric/ @elastic/kibana-app
@@ -30,32 +31,23 @@
3031
/src/plugins/visualize/ @elastic/kibana-app
3132
/src/plugins/visualizations/ @elastic/kibana-app
3233
#CC# /src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
33-
#CC# /src/plugins/vis_type @elastic/kibana-app
3434
#CC# /src/legacy/core_plugins/kibana/ @elastic/kibana-app
3535
#CC# /src/legacy/core_plugins/kibana/common/utils @elastic/kibana-app
3636
#CC# /src/legacy/core_plugins/kibana/migrations @elastic/kibana-app
3737
#CC# /src/legacy/core_plugins/kibana/public @elastic/kibana-app
3838
#CC# /src/legacy/core_plugins/kibana/public/dashboard/ @elastic/kibana-app
39-
#CC# /src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
4039
#CC# /src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
4140
#CC# /src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
42-
#CC# /src/legacy/core_plugins/console_legacy @elastic/kibana-app
4341
#CC# /src/legacy/core_plugins/input_control_vis @elastic/kibana-app
4442
#CC# /src/legacy/core_plugins/timelion @elastic/kibana-app
4543
#CC# /src/legacy/core_plugins/vis_type_tagcloud @elastic/kibana-app
4644
#CC# /src/legacy/core_plugins/vis_type_vega @elastic/kibana-app
4745
#CC# /src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
48-
#CC# /src/legacy/server/sample_data/ @elastic/kibana-app
4946
#CC# /src/legacy/server/url_shortening/ @elastic/kibana-app
5047
#CC# /src/legacy/ui/public/state_management @elastic/kibana-app
51-
#CC# /src/plugins/charts/public/static/color_maps @elastic/kibana-app
5248
#CC# /src/plugins/index_pattern_management/public @elastic/kibana-app
53-
#CC# /src/plugins/input_control_vis/ @elastic/kibana-app
54-
#CC# /src/plugins/kibana_legacy/ @elastic/kibana-app
55-
#CC# /src/plugins/timelion @elastic/kibana-app
5649
#CC# /x-pack/legacy/plugins/dashboard_mode/ @elastic/kibana-app
5750
#CC# /x-pack/plugins/dashboard_mode @elastic/kibana-app
58-
#CC# /x-pack/plugins/lens/ @elastic/kibana-app
5951

6052
# App Architecture
6153
/examples/bfetch_explorer/ @elastic/kibana-app-arch
@@ -147,6 +139,7 @@
147139
/src/plugins/home/server/services/ @elastic/kibana-core-ui
148140
/x-pack/plugins/global_search_bar/ @elastic/kibana-core-ui
149141
#CC# /src/legacy/core_plugins/newsfeed @elastic/kibana-core-ui
142+
#CC# /src/legacy/server/sample_data/ @elastic/kibana-core-ui
150143
#CC# /src/plugins/newsfeed @elastic/kibana-core-ui
151144
#CC# /src/plugins/home/public @elastic/kibana-core-ui
152145
#CC# /src/plugins/home/server/services/ @elastic/kibana-core-ui
@@ -351,6 +344,8 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
351344
/x-pack/plugins/ingest_pipelines/ @elastic/es-ui
352345
/packages/kbn-ace/ @elastic/es-ui
353346
/packages/kbn-monaco/ @elastic/es-ui
347+
#CC# /src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/es-ui
348+
#CC# /src/legacy/core_plugins/console_legacy @elastic/es-ui
354349
#CC# /x-pack/legacy/plugins/rollup/ @elastic/es-ui
355350
#CC# /x-pack/legacy/server/lib/create_router/ @elastic/es-ui
356351
#CC# /x-pack/legacy/server/lib/check_license/ @elastic/es-ui

docs/developer/plugin-list.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ It also provides a stateful version of it on the start contract.
168168
169169
170170
|{kib-repo}blob/{branch}/src/plugins/telemetry_management_section/README.md[telemetryManagementSection]
171-
|This plugin adds the Advanced Settings section for the Usage Data collection (aka Telemetry).
171+
|This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry).
172172
173173
174174
|{kib-repo}blob/{branch}/src/plugins/tile_map[tileMap]

docs/user/security/authorization/index.asciidoc

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
[[xpack-security-authorization]]
33

44
=== Granting access to {kib}
5-
The Elastic Stack comes with the `kibana_admin` {ref}/built-in-roles.html[built-in role], which you can use to grant access to all Kibana features in all spaces. To grant users access to a subset of spaces or features, you can create a custom role that grants the desired Kibana privileges.
5+
The Elastic Stack comes with the `kibana_admin` {ref}/built-in-roles.html[built-in role], which you can use to grant access to all {kib} features in all spaces. To grant users access to a subset of spaces or features, you can create a custom role that grants the desired {kib} privileges.
66

7-
When you assign a user multiple roles, the user receives a union of the roles’ privileges. Therefore, assigning the `kibana_admin` role in addition to a custom role that grants Kibana privileges is ineffective because `kibana_admin` has access to all the features in all spaces.
7+
When you assign a user multiple roles, the user receives a union of the roles’ privileges. Therefore, assigning the `kibana_admin` role in addition to a custom role that grants {kib} privileges is ineffective because `kibana_admin` has access to all the features in all spaces.
88

9-
NOTE: When running multiple tenants of Kibana by changing the `kibana.index` in your `kibana.yml`, you cannot use `kibana_admin` to grant access. You must create custom roles that authorize the user for that specific tenant. Although multi-tenant installations are supported, the recommended approach to securing access to Kibana segments is to grant users access to specific spaces.
9+
NOTE: When running multiple tenants of {kib} by changing the `kibana.index` in your `kibana.yml`, you cannot use `kibana_admin` to grant access. You must create custom roles that authorize the user for that specific tenant. Although multi-tenant installations are supported, the recommended approach to securing access to {kib} segments is to grant users access to specific spaces.
1010

1111
[role="xpack"]
1212
[[xpack-kibana-role-management]]
@@ -17,26 +17,26 @@ To create a role that grants {kib} privileges, open the menu, go to *Stack Manag
1717
[[adding_kibana_privileges]]
1818
==== Adding {kib} privileges
1919

20-
To assign {kib} privileges to the role, click **Add space privilege** in the Kibana section.
20+
To assign {kib} privileges to the role, click **Add {kib} privilege** in the {kib} section.
2121

2222
[role="screenshot"]
23-
image::user/security/images/add-space-privileges.png[Add space privileges]
23+
image::user/security/images/add-space-privileges.png[Add {kib} privileges]
2424

2525
Open the **Spaces** selection control to specify whether to grant the role access to all spaces *** Global (all spaces)** or one or more individual spaces. If you select *** Global (all spaces)**, you can’t select individual spaces until you clear your selection.
2626

2727
Use the **Privilege** menu to grant access to features. The default is **Custom**, which you can use to grant access to individual features. Otherwise, you can grant read and write access to all current and future features by selecting **All**, or grant read access to all current and future features by selecting **Read**.
2828

29-
When using the **Customize by feature** option, you can choose either **All**, **Read** or **None** for access to each feature. As new features are added to Kibana, roles that use the custom option do not automatically get access to the new features. You must manually update the roles.
29+
When using the **Customize by feature** option, you can choose either **All**, **Read** or **None** for access to each feature. As new features are added to {kib}, roles that use the custom option do not automatically get access to the new features. You must manually update the roles.
3030

3131
NOTE: *{stack-monitor-app}* relies on built-in roles to grant access. When a
3232
user is assigned the appropriate roles, the *{stack-monitor-app}* application is
3333
available; otherwise, it is not visible.
3434

35-
To apply your changes, click **Create space privilege**. The space privilege shows up under the Kibana privileges section of the role.
35+
To apply your changes, click **Add {kib} privilege**. The privilege shows up under the {kib} privileges section of the role.
3636

3737

3838
[role="screenshot"]
39-
image::user/security/images/create-space-privilege.png[Create space privilege]
39+
image::user/security/images/create-space-privilege.png[Add {kib} privilege]
4040

4141
==== Feature availability
4242

@@ -64,9 +64,9 @@ Features are available to users when their roles grant access to the features, *
6464

6565
==== Assigning different privileges to different spaces
6666

67-
Using the same role, it’s possible to assign different privileges to different spaces. After you’ve added space privileges, click **Add space privilege**. If you’ve already added privileges for either *** Global (all spaces)** or an individual space, you will not be able to select these in the **Spaces** selection control.
67+
Using the same role, it’s possible to assign different privileges to different spaces. After you’ve added privileges, click **Add {kib} privilege**. If you’ve already added privileges for either *** Global (all spaces)** or an individual space, you will not be able to select these in the **Spaces** selection control.
6868

69-
Additionally, if you’ve already assigned privileges at *** Global (all spaces)**, you are only able to assign additional privileges to individual spaces. Similar to the behavior of multiple roles granting the union of all privileges, space privileges are also a union. If you’ve already granted the user the **All** privilege at *** Global (all spaces)**, you’re not able to restrict the role to only the **Read** privilege at an individual space.
69+
Additionally, if you’ve already assigned privileges at *** Global (all spaces)**, you are only able to assign additional privileges to individual spaces. Similar to the behavior of multiple roles granting the union of all privileges, {kib} privileges are also a union. If you’ve already granted the user the **All** privilege at *** Global (all spaces)**, you’re not able to restrict the role to only the **Read** privilege at an individual space.
7070

7171

7272
==== Privilege summary
@@ -78,39 +78,37 @@ image::user/security/images/view-privilege-summary.png[View privilege summary]
7878

7979
==== Example 1: Grant all access to Dashboard at an individual space
8080

81-
. Click **Add space privilege**.
81+
. Click **Add {kib} privilege**.
8282
. For **Spaces**, select an individual space.
8383
. For **Privilege**, leave the default selection of **Custom**.
8484
. For the Dashboard feature, select **All**
85-
. Click **Create space privilege**.
85+
. Click **Add {kib} privilege**.
8686

8787
[role="screenshot"]
8888
image::user/security/images/privilege-example-1.png[Privilege example 1]
8989

9090
==== Example 2: Grant all access to one space and read access to another
9191

92-
. Click **Add space privilege**.
92+
. Click **Add {kib} privilege**.
9393
. For **Spaces**, select the first space.
9494
. For **Privilege**, select **All**.
95-
. Click **Create space privilege**.
96-
. Click **Add space privilege**.
95+
. Click **Add {kib} privilege**.
9796
. For **Spaces**, select the second space.
9897
. For **Privilege**, select **Read**.
99-
. Click **Create space privilege**.
98+
. Click **Add {kib} privilege**.
10099

101100
[role="screenshot"]
102101
image::user/security/images/privilege-example-2.png[Privilege example 2]
103102

104103
==== Example 3: Grant read access to all spaces and write access to an individual space
105104

106-
. Click **Add space privilege**.
105+
. Click **Add {kib} privilege**.
107106
. For **Spaces**, select *** Global (all spaces)**.
108107
. For **Privilege**, select **Read**.
109-
. Click **Create space privilege**.
110-
. Click **Add space privilege**.
108+
. Click **Add {kib} privilege**.
111109
. For **Spaces**, select the individual space.
112110
. For **Privilege**, select **All**.
113-
. Click **Create space privilege**.
111+
. Click **Add {kib} privilege**.
114112

115113
[role="screenshot"]
116114
image::user/security/images/privilege-example-3.png[Privilege example 3]

src/plugins/discover/public/application/angular/context/api/_stubs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function createContextSearchSourceStub(hits, timeField = '@timestamp') {
7474
searchSourceStub.fetch = sinon.spy(() => {
7575
const timeField = searchSourceStub._stubTimeField;
7676
const lastQuery = searchSourceStub.setField.withArgs('query').lastCall.args[1];
77-
const timeRange = lastQuery.query.constant_score.filter.range[timeField];
77+
const timeRange = lastQuery.query.bool.must.constant_score.filter.range[timeField];
7878
const lastSort = searchSourceStub.setField.withArgs('sort').lastCall.args[1];
7979
const sortDirection = lastSort[0][timeField];
8080
const sortFunction =

src/plugins/discover/public/application/angular/context/api/context.predecessors.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ describe('context app', function () {
124124
).then((hits) => {
125125
const intervals = mockSearchSource.setField.args
126126
.filter(([property]) => property === 'query')
127-
.map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
127+
.map(([, { query }]) =>
128+
get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
129+
);
128130

129131
expect(
130132
intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true))
@@ -160,7 +162,9 @@ describe('context app', function () {
160162
).then((hits) => {
161163
const intervals = mockSearchSource.setField.args
162164
.filter(([property]) => property === 'query')
163-
.map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
165+
.map(([, { query }]) =>
166+
get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
167+
);
164168

165169
// should have started at the given time
166170
expect(intervals[0].gte).toEqual(moment(MS_PER_DAY * 1000).toISOString());

src/plugins/discover/public/application/angular/context/api/context.successors.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ describe('context app', function () {
125125
).then((hits) => {
126126
const intervals = mockSearchSource.setField.args
127127
.filter(([property]) => property === 'query')
128-
.map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
128+
.map(([, { query }]) =>
129+
get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
130+
);
129131

130132
expect(
131133
intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true))
@@ -163,7 +165,9 @@ describe('context app', function () {
163165
).then((hits) => {
164166
const intervals = mockSearchSource.setField.args
165167
.filter(([property]) => property === 'query')
166-
.map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
168+
.map(([, { query }]) =>
169+
get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
170+
);
167171

168172
// should have started at the given time
169173
expect(intervals[0].lte).toEqual(moment(MS_PER_DAY * 3000).toISOString());

src/plugins/discover/public/application/angular/context/api/context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface EsHitRecord {
3131
fields: Record<string, any>;
3232
sort: number[];
3333
_source: Record<string, any>;
34+
_id: string;
3435
}
3536
export type EsHitRecordList = EsHitRecord[];
3637

@@ -100,7 +101,8 @@ function fetchContextProvider(indexPatterns: IndexPatternsContract) {
100101
interval,
101102
searchAfter,
102103
remainingSize,
103-
nanos
104+
nanos,
105+
anchor._id
104106
);
105107

106108
documents =

src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export async function fetchHitsInInterval(
4343
interval: IntervalValue[],
4444
searchAfter: EsQuerySearchAfter,
4545
maxCount: number,
46-
nanosValue: string
46+
nanosValue: string,
47+
anchorId: string
4748
): Promise<EsHitRecordList> {
4849
const range: RangeQuery = {
4950
format: 'strict_date_optional_time',
@@ -61,10 +62,19 @@ export async function fetchHitsInInterval(
6162
.setField('size', maxCount)
6263
.setField('query', {
6364
query: {
64-
constant_score: {
65-
filter: {
66-
range: {
67-
[timeField]: range,
65+
bool: {
66+
must: {
67+
constant_score: {
68+
filter: {
69+
range: {
70+
[timeField]: range,
71+
},
72+
},
73+
},
74+
},
75+
must_not: {
76+
ids: {
77+
values: [anchorId],
6878
},
6979
},
7080
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Telemetry Management Section
22

3-
This plugin adds the Advanced Settings section for the Usage Data collection (aka Telemetry).
3+
This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry).
44

55
The reason for having it separated from the `telemetry` plugin is to avoid circular dependencies. The plugin `advancedSettings` depends on the `home` app that depends on the `telemetry` plugin because of the telemetry banner in the welcome screen.

0 commit comments

Comments
 (0)