Skip to content

Commit

Permalink
Merge branch 'master' into fix_ilm_navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Nov 5, 2020
2 parents 0c16d97 + 7e5ca29 commit 0baccad
Show file tree
Hide file tree
Showing 41 changed files with 163 additions and 116 deletions.
5 changes: 4 additions & 1 deletion docs/user/alerting/alerting-getting-started.asciidoc
Expand Up @@ -169,12 +169,15 @@ If you are using an *on-premises* Elastic Stack deployment with <<using-kibana-w

To access alerting in a space, a user must have access to one of the following features:

* Alerting
* <<xpack-apm,*APM*>>
* <<logs-app,*Logs*>>
* <<metrics-app,*Metrics*>>
* <<xpack-siem,*Security*>>
* <<uptime-app,*Uptime*>>

See <<kibana-feature-privileges, feature privileges>> for more information on configuring roles that provide access to these features.
See <<kibana-feature-privileges, feature privileges>> for more information on configuring roles that provide access to these features.
Also note that a user will need +read+ privileges for the *Actions and Connectors* feature to attach actions to an alert or to edit an alert that has an action attached to it.

[float]
[[alerting-spaces]]
Expand Down
@@ -0,0 +1,7 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export { SourceConfigFields } from './source_config_fields';
@@ -0,0 +1,45 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { shallow } from 'enzyme';

import { ApiKey } from '../api_key';
import { CredentialItem } from '../credential_item';

import { SourceConfigFields } from './';

describe('SourceConfigFields', () => {
it('renders empty with no items', () => {
const wrapper = shallow(<SourceConfigFields />);

expect(wrapper.find(ApiKey)).toHaveLength(0);
expect(wrapper.find(CredentialItem)).toHaveLength(0);
});

it('renders with all items, hiding API Keys', () => {
const wrapper = shallow(
<SourceConfigFields
clientId="123"
clientSecret="456"
publicKey="abc"
consumerKey="def"
baseUrl="ghi"
/>
);

expect(wrapper.find(ApiKey)).toHaveLength(0);
expect(wrapper.find(CredentialItem)).toHaveLength(3);
});

it('shows API keys', () => {
const wrapper = shallow(
<SourceConfigFields clientSecret="456" publicKey="abc" consumerKey="def" baseUrl="ghi" />
);

expect(wrapper.find(ApiKey)).toHaveLength(2);
});
});
@@ -0,0 +1,61 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';

import { EuiSpacer } from '@elastic/eui';

import { ApiKey } from '../api_key';
import { CredentialItem } from '../credential_item';

interface ISourceConfigFieldsProps {
clientId?: string;
clientSecret?: string;
publicKey?: string;
consumerKey?: string;
baseUrl?: string;
}

export const SourceConfigFields: React.FC<ISourceConfigFieldsProps> = ({
clientId,
clientSecret,
publicKey,
consumerKey,
baseUrl,
}) => {
const showApiKey = (publicKey || consumerKey) && !clientId;

const credentialItem = (label: string, item?: string) =>
item && <CredentialItem label={label} value={item} testSubj={label} hideCopy />;

const keyElement = (
<>
{publicKey && (
<>
<ApiKey label="Public Key" apiKey={publicKey} />
<EuiSpacer />
</>
)}
{consumerKey && (
<>
<ApiKey label="Consumer Key" apiKey={consumerKey} />
<EuiSpacer />
</>
)}
</>
);

return (
<>
{showApiKey && keyElement}
{credentialItem('Client id', clientId)}
<EuiSpacer size="s" />
{credentialItem('Client secret', clientSecret)}
<EuiSpacer size="s" />
{credentialItem('Base URL', baseUrl)}
</>
);
};
Expand Up @@ -25,8 +25,6 @@ import {
import * as i18n from './translations';
import { DocValueFields } from '../../../../../common/search_strategy';

const ID = 'timelineEventsLastEventTimeQuery';

export interface UseTimelineLastEventTimeArgs {
lastSeen: string | null;
refetch: inputsModel.Refetch;
Expand Down Expand Up @@ -56,7 +54,6 @@ export const useTimelineLastEventTime = ({
defaultIndex: indexNames,
docValueFields,
factoryQueryType: TimelineEventsQueries.lastEventTime,
id: ID,
indexKey,
details,
});
Expand Down
Expand Up @@ -45,8 +45,6 @@ export interface UseMatrixHistogramArgs {
}>;
}

const ID = 'matrixHistogramQuery';

export const useMatrixHistogram = ({
endDate,
errorMessage,
Expand All @@ -73,7 +71,6 @@ export const useMatrixHistogram = ({
factoryQueryType: MatrixHistogramQuery,
filterQuery: createFilter(filterQuery),
histogramType,
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -88,7 +88,6 @@ export const useAuthentications = ({
docValueFields: docValueFields ?? [],
factoryQueryType: HostsQueries.authentications,
filterQuery: createFilter(filterQuery),
id: ID,
pagination: generateTablePaginationOptions(activePage, limit),
timerange: {
interval: '12h',
Expand Down Expand Up @@ -203,7 +202,6 @@ export const useAuthentications = ({
docValueFields: docValueFields ?? [],
factoryQueryType: HostsQueries.authentications,
filterQuery: createFilter(filterQuery),
id: ID,
pagination: generateTablePaginationOptions(activePage, limit),
timerange: {
interval: '12h',
Expand Down
Expand Up @@ -65,7 +65,6 @@ export const useHostDetails = ({
? {
defaultIndex: indexNames,
hostName,
id,
factoryQueryType: HostsQueries.details,
timerange: {
interval: '12h',
Expand All @@ -79,7 +78,7 @@ export const useHostDetails = ({
const [hostDetailsResponse, setHostDetailsResponse] = useState<HostDetailsArgs>({
endDate,
hostDetails: {},
id: ID,
id,
inspect: {
dsl: [],
response: [],
Expand Down Expand Up @@ -154,7 +153,6 @@ export const useHostDetails = ({
defaultIndex: indexNames,
factoryQueryType: HostsQueries.details,
hostName,
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -83,7 +83,6 @@ export const useAllHost = ({
docValueFields: docValueFields ?? [],
factoryQueryType: HostsQueries.hosts,
filterQuery: createFilter(filterQuery),
id: ID,
pagination: generateTablePaginationOptions(activePage, limit),
timerange: {
interval: '12h',
Expand Down Expand Up @@ -200,7 +199,6 @@ export const useAllHost = ({
docValueFields: docValueFields ?? [],
factoryQueryType: HostsQueries.hosts,
filterQuery: createFilter(filterQuery),
id: ID,
pagination: generateTablePaginationOptions(activePage, limit),
timerange: {
interval: '12h',
Expand Down
Expand Up @@ -61,7 +61,6 @@ export const useHostsKpiAuthentications = ({
defaultIndex: indexNames,
factoryQueryType: HostsKpiQueries.kpiAuthentications,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -159,7 +158,6 @@ export const useHostsKpiAuthentications = ({
defaultIndex: indexNames,
factoryQueryType: HostsKpiQueries.kpiAuthentications,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -60,7 +60,6 @@ export const useHostsKpiHosts = ({
defaultIndex: indexNames,
factoryQueryType: HostsKpiQueries.kpiHosts,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -149,7 +148,6 @@ export const useHostsKpiHosts = ({
defaultIndex: indexNames,
factoryQueryType: HostsKpiQueries.kpiHosts,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -61,7 +61,6 @@ export const useHostsKpiUniqueIps = ({
defaultIndex: indexNames,
factoryQueryType: HostsKpiQueries.kpiUniqueIps,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -156,7 +155,6 @@ export const useHostsKpiUniqueIps = ({
defaultIndex: indexNames,
factoryQueryType: HostsKpiQueries.kpiUniqueIps,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -85,7 +85,6 @@ export const useUncommonProcesses = ({
docValueFields: docValueFields ?? [],
factoryQueryType: HostsQueries.uncommonProcesses,
filterQuery: createFilter(filterQuery),
id: ID,
pagination: generateTablePaginationOptions(activePage, limit),
timerange: {
interval: '12h',
Expand Down Expand Up @@ -204,7 +203,6 @@ export const useUncommonProcesses = ({
docValueFields: docValueFields ?? [],
factoryQueryType: HostsQueries.uncommonProcesses,
filterQuery: createFilter(filterQuery),
id: ID,
pagination: generateTablePaginationOptions(activePage, limit),
timerange: {
interval: '12h',
Expand Down
Expand Up @@ -69,7 +69,6 @@ export const useNetworkDetails = ({
docValueFields: docValueFields ?? [],
factoryQueryType: NetworkQueries.details,
filterQuery: createFilter(filterQuery),
id,
ip,
}
: null
Expand Down Expand Up @@ -153,7 +152,6 @@ export const useNetworkDetails = ({
docValueFields: docValueFields ?? [],
factoryQueryType: NetworkQueries.details,
filterQuery: createFilter(filterQuery),
id,
ip,
};
if (!skip && !deepEqual(prevRequest, myRequest)) {
Expand Down
Expand Up @@ -65,7 +65,6 @@ export const useNetworkKpiDns = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.dns,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -152,7 +151,6 @@ export const useNetworkKpiDns = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.dns,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -65,7 +65,6 @@ export const useNetworkKpiNetworkEvents = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.networkEvents,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -157,7 +156,6 @@ export const useNetworkKpiNetworkEvents = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.networkEvents,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -65,7 +65,6 @@ export const useNetworkKpiTlsHandshakes = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.tlsHandshakes,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -156,7 +155,6 @@ export const useNetworkKpiTlsHandshakes = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.tlsHandshakes,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -65,7 +65,6 @@ export const useNetworkKpiUniqueFlows = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.uniqueFlows,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -157,7 +156,6 @@ export const useNetworkKpiUniqueFlows = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.uniqueFlows,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -69,7 +69,6 @@ export const useNetworkKpiUniquePrivateIps = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.uniquePrivateIps,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down Expand Up @@ -168,7 +167,6 @@ export const useNetworkKpiUniquePrivateIps = ({
defaultIndex: indexNames,
factoryQueryType: NetworkKpiQueries.uniquePrivateIps,
filterQuery: createFilter(filterQuery),
id: ID,
timerange: {
interval: '12h',
from: startDate,
Expand Down
Expand Up @@ -79,7 +79,6 @@ export const useNetworkDns = ({
defaultIndex: indexNames,
factoryQueryType: NetworkQueries.dns,
filterQuery: createFilter(filterQuery),
id: ID,
isPtrIncluded,
pagination: generateTablePaginationOptions(activePage, limit),
sort,
Expand Down Expand Up @@ -197,7 +196,6 @@ export const useNetworkDns = ({
isPtrIncluded,
factoryQueryType: NetworkQueries.dns,
filterQuery: createFilter(filterQuery),
id: ID,
pagination: generateTablePaginationOptions(activePage, limit),
sort,
timerange: {
Expand Down

0 comments on commit 0baccad

Please sign in to comment.