Skip to content

Commit 86daa13

Browse files
Merge branch '7.15' into backport/7.15/pr-110609
2 parents 3fd4837 + 4689cef commit 86daa13

File tree

11 files changed

+64
-41
lines changed

11 files changed

+64
-41
lines changed

docs/settings/reporting-settings.asciidoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,15 @@ NOTE: This setting exists for backwards compatibility, but is unused and hardcod
279279
[[reporting-advanced-settings]]
280280
==== Security settings
281281

282-
[[xpack-reporting-roles-enabled]] `xpack.reporting.roles.enabled`::
283-
deprecated:[7.14.0,This setting must be set to `false` in 8.0.] When `true`, grants users access to the {report-features} by assigning reporting roles, specified by `xpack.reporting.roles.allow`. Granting access to users this way is deprecated. Set to `false` and use {kibana-ref}/kibana-privileges.html[{kib} privileges] instead. Defaults to `true`.
282+
With Security enabled, Reporting has two forms of access control: each user can only access their own reports, and custom roles determine who has privilege to generate reports. When Reporting is configured with <<kibana-privileges, {kib} application privileges>>, you can control the spaces and applications where users are allowed to generate reports.
284283

285284
[NOTE]
286285
============================================================================
287-
In 7.x, the default value of `xpack.reporting.roles.enabled` is `true`. To migrate users to the
288-
new method of securing access to *Reporting*, you must set `xpack.reporting.roles.enabled: false`. In the next major version of {kib}, `false` will be the only valid configuration.
286+
The `xpack.reporting.roles` settings are for a deprecated system of access control in Reporting. It does not allow API Keys to generate reports, and it doesn't allow {kib} application privileges. We recommend you explicitly turn off reporting's deprecated access control feature by adding `xpack.reporting.roles.enabled: false` in kibana.yml. This will enable application privileges for reporting, as described in <<grant-user-access, granting users access to reporting>>.
289287
============================================================================
290288

291-
`xpack.reporting.roles.allow`::
292-
deprecated:[7.14.0,This setting will be removed in 8.0.] Specifies the roles, in addition to superusers, that can generate reports, using the {ref}/security-api.html#security-role-apis[{es} role management APIs]. Requires `xpack.reporting.roles.enabled` to be `true`. Granting access to users this way is deprecated. Use {kibana-ref}/kibana-privileges.html[{kib} privileges] instead. Defaults to `[ "reporting_user" ]`.
289+
[[xpack-reporting-roles-enabled]] `xpack.reporting.roles.enabled`::
290+
deprecated:[7.14.0,The default for this setting will be `false` in an upcoming version of {kib}.] Sets access control to a set of assigned reporting roles, specified by `xpack.reporting.roles.allow`. Defaults to `true`.
293291

294-
NOTE: Each user has access to only their own reports.
292+
`xpack.reporting.roles.allow`::
293+
deprecated:[7.14.0] In addition to superusers, specifies the roles that can generate reports using the {ref}/security-api.html#security-role-apis[{es} role management APIs]. Requires `xpack.reporting.roles.enabled` to be `true`. Defaults to `[ "reporting_user" ]`.

docs/setup/configuring-reporting.asciidoc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ To troubleshoot the problem, start the {kib} server with environment variables t
4141
[float]
4242
[[grant-user-access]]
4343
=== Grant users access to reporting
44+
When security is enabled, you grant users access to generate reports with <<kibana-privileges, {kib} application privileges>>, which allow you to create custom roles that control the spaces and applications where users generate reports.
4445

45-
When security is enabled, access to the {report-features} is controlled by roles and <<kibana-privileges, privileges>>. With privileges, you can define custom roles that grant *Reporting* privileges as sub-features of {kib} applications. To grant users permission to generate reports and view their reports in *Reporting*, create and assign the reporting role.
46-
47-
[[reporting-app-users]]
48-
NOTE: In 7.12.0 and earlier, you grant access to the {report-features} by assigning users the `reporting_user` role in {es}.
46+
. Enable application privileges in Reporting. To enable, turn off the default user access control features in `kibana.yml`:
47+
+
48+
[source,yaml]
49+
------------------------------------
50+
xpack.reporting.roles.enabled: false
51+
------------------------------------
52+
+
53+
NOTE: If you use the default settings, you can still create a custom role that grants reporting privileges. The default role is `reporting_user`. This behavior is being deprecated and does not allow application-level access controls for {report-features}, and does not allow API keys or authentication tokens to authorize report generation. Refer to <<reporting-advanced-settings, reporting security settings>> for information and caveats about the deprecated access control features.
4954

5055
. Create the reporting role.
5156

@@ -90,10 +95,12 @@ If the *Reporting* option is unavailable, contact your administrator, or <<repor
9095

9196
.. Click *Update user*.
9297

98+
Granting the privilege to generate reports also grants the user the privilege to view their reports in *Stack Management > Reporting*. Users can only access their own reports.
99+
93100
[float]
94101
[[reporting-roles-user-api]]
95102
==== Grant access with the role API
96-
You can also use the {ref}/security-api-put-role.html[role API] to grant access to the reporting features. Grant the reporting role to users in combination with other roles that grant read access to the data in {es}, and at least read access in the applications where users can generate reports.
103+
With <<grant-user-access, {kib} application privileges>> enabled in Reporting, you can also use the {ref}/security-api-put-role.html[role API] to grant access to the {report-features}. Grant custom reporting roles to users in combination with other roles that grant read access to the data in {es}, and at least read access in the applications where users can generate reports.
97104

98105
[source, sh]
99106
---------------------------------------------------------------

src/core/server/elasticsearch/client/client_config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export function parseClientOptions(
5555
...DEFAULT_HEADERS,
5656
...config.customHeaders,
5757
},
58+
// do not make assumption on user-supplied data content
59+
// fixes https://github.com/elastic/kibana/issues/101944
60+
disablePrototypePoisoningProtection: true,
5861
};
5962

6063
if (config.pingTimeout != null) {

x-pack/plugins/ml/public/application/components/controls/checkbox_showcharts/checkbox_showcharts.tsx

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,22 @@
88
import React, { FC, useCallback, useMemo } from 'react';
99
import { EuiCheckbox, htmlIdGenerator } from '@elastic/eui';
1010
import { FormattedMessage } from '@kbn/i18n/react';
11-
import { useExplorerUrlState } from '../../../explorer/hooks/use_explorer_url_state';
1211

13-
const SHOW_CHARTS_DEFAULT = true;
14-
15-
export const useShowCharts = (): [boolean, (v: boolean) => void] => {
16-
const [explorerUrlState, setExplorerUrlState] = useExplorerUrlState();
17-
18-
const showCharts = explorerUrlState?.mlShowCharts ?? SHOW_CHARTS_DEFAULT;
19-
20-
const setShowCharts = useCallback(
21-
(v: boolean) => {
22-
setExplorerUrlState({ mlShowCharts: v });
23-
},
24-
[setExplorerUrlState]
25-
);
26-
27-
return [showCharts, setShowCharts];
28-
};
12+
export interface CheckboxShowChartsProps {
13+
showCharts: boolean;
14+
setShowCharts: (update: boolean) => void;
15+
}
2916

3017
/*
3118
* React component for a checkbox element to toggle charts display.
3219
*/
33-
export const CheckboxShowCharts: FC = () => {
34-
const [showCharts, setShowCharts] = useShowCharts();
35-
36-
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
37-
setShowCharts(e.target.checked);
38-
};
20+
export const CheckboxShowCharts: FC<CheckboxShowChartsProps> = ({ showCharts, setShowCharts }) => {
21+
const onChange = useCallback(
22+
(e: React.ChangeEvent<HTMLInputElement>) => {
23+
setShowCharts(e.target.checked);
24+
},
25+
[setShowCharts]
26+
);
3927

4028
const id = useMemo(() => htmlIdGenerator()(), []);
4129

x-pack/plugins/ml/public/application/components/controls/checkbox_showcharts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* 2.0.
66
*/
77

8-
export { useShowCharts, CheckboxShowCharts } from './checkbox_showcharts';
8+
export { CheckboxShowCharts } from './checkbox_showcharts';

x-pack/plugins/ml/public/application/explorer/explorer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,10 @@ export class ExplorerUI extends React.Component {
498498
</EuiFlexItem>
499499
{chartsData.seriesToPlot.length > 0 && selectedCells !== undefined && (
500500
<EuiFlexItem grow={false}>
501-
<CheckboxShowCharts />
501+
<CheckboxShowCharts
502+
showCharts={showCharts}
503+
setShowCharts={explorerService.setShowCharts}
504+
/>
502505
</EuiFlexItem>
503506
)}
504507
</EuiFlexGroup>

x-pack/plugins/ml/public/application/explorer/explorer_constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const EXPLORER_ACTION = {
3434
SET_VIEW_BY_PER_PAGE: 'setViewByPerPage',
3535
SET_VIEW_BY_FROM_PAGE: 'setViewByFromPage',
3636
SET_SWIM_LANE_SEVERITY: 'setSwimLaneSeverity',
37+
SET_SHOW_CHARTS: 'setShowCharts',
3738
};
3839

3940
export const FILTER_ACTION = {

x-pack/plugins/ml/public/application/explorer/explorer_dashboard_service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ const explorerAppState$: Observable<ExplorerAppState> = explorerState$.pipe(
8383
appState.mlExplorerSwimlane.severity = state.swimLaneSeverity;
8484
}
8585

86+
if (state.showCharts !== undefined) {
87+
appState.mlShowCharts = state.showCharts;
88+
}
89+
8690
if (state.filterActive) {
8791
appState.mlExplorerFilter.influencersFilterQuery = state.influencersFilterQuery;
8892
appState.mlExplorerFilter.filterActive = state.filterActive;
@@ -168,6 +172,9 @@ export const explorerService = {
168172
setSwimLaneSeverity: (payload: number) => {
169173
explorerAction$.next({ type: EXPLORER_ACTION.SET_SWIM_LANE_SEVERITY, payload });
170174
},
175+
setShowCharts: (payload: boolean) => {
176+
explorerAction$.next({ type: EXPLORER_ACTION.SET_SHOW_CHARTS, payload });
177+
},
171178
};
172179

173180
export type ExplorerService = typeof explorerService;

x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/reducer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ export const explorerReducer = (state: ExplorerState, nextAction: Action): Explo
158158
};
159159
break;
160160

161+
case EXPLORER_ACTION.SET_SHOW_CHARTS:
162+
nextState = {
163+
...state,
164+
showCharts: payload,
165+
};
166+
break;
167+
161168
default:
162169
nextState = state;
163170
}

x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/state.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export interface ExplorerState {
5959
viewBySwimlaneOptions: string[];
6060
swimlaneLimit?: number;
6161
swimLaneSeverity?: number;
62+
showCharts: boolean;
6263
}
6364

6465
function getDefaultIndexPattern() {
@@ -112,5 +113,6 @@ export function getExplorerDefaultState(): ExplorerState {
112113
viewByPerPage: SWIM_LANE_DEFAULT_PAGE_SIZE,
113114
viewByFromPage: 1,
114115
swimlaneLimit: undefined,
116+
showCharts: true,
115117
};
116118
}

0 commit comments

Comments
 (0)