Skip to content

Commit

Permalink
Merge branch '165812-infra-ui-rename-disk-usage-charts' of https://gi…
Browse files Browse the repository at this point in the history
…thub.com/jennypavlova/kibana into 165812-infra-ui-rename-disk-usage-charts
  • Loading branch information
jennypavlova committed Sep 7, 2023
2 parents 0ecc6ab + 5c72445 commit fa608ac
Show file tree
Hide file tree
Showing 208 changed files with 6,405 additions and 882 deletions.
3 changes: 3 additions & 0 deletions .buildkite/pipelines/pipeline.kibana-serverless-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ steps:
SERVICE: kibana-controller
NAMESPACE: kibana-ci
IMAGE_NAME: kibana-serverless

notify:
- slack: "#kibana-mission-control"
1 change: 1 addition & 0 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ xpack.observability.enabled: false
xpack.securitySolution.enabled: false
xpack.serverless.observability.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false
enterpriseSearch.enabled: false
monitoring.ui.enabled: false
xpack.fleet.enabled: false
Expand Down
4 changes: 3 additions & 1 deletion config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
enterpriseSearch.enabled: false
xpack.cloudSecurityPosture.enabled: false
xpack.securitySolution.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false

## Enable the Serverless Observability plugin
xpack.serverless.observability.enabled: true
Expand All @@ -24,7 +26,7 @@ xpack.fleet.agentIdVerificationEnabled: false
xpack.apm.serverlessOnboarding: true

# Fleet specific configuration
xpack.fleet.internal.capabilities: ['apm', 'uptime', 'observability']
xpack.fleet.internal.capabilities: ['apm', 'observability']

## Required for force installation of APM Package
xpack.fleet.packages:
Expand Down
1 change: 1 addition & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ enterpriseSearch.enabled: false
xpack.apm.enabled: false
xpack.observability.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false

## Enable the Security Solution Serverless plugin
xpack.securitySolutionServerless.enabled: true
Expand Down
1 change: 1 addition & 0 deletions config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ xpack.alerting.rules.run.ruleTypeOverrides:
xpack.alerting.rules.minimumScheduleInterval.enforce: true
xpack.alerting.rules.maxScheduledPerMinute: 400
xpack.actions.run.maxAttempts: 10
xpack.actions.queued.max: 10000

# Disables ESQL in advanced settings (hides it from the UI)
uiSettings:
Expand Down
3 changes: 3 additions & 0 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ xpack.actions.run:
maxAttempts: 5
--

`xpack.actions.queued.max` {ess-icon}::
Specifies the maximum number of actions that can be queued. Default: 1000000

[float]
[[preconfigured-connector-settings]]
=== Preconfigured connector settings
Expand Down
16 changes: 16 additions & 0 deletions packages/kbn-config-schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,22 @@ function recordOf<K extends string, V>(
return new RecordOfType(keyType, valueType, options);
}

function oneOf<A, B, C, D, E, F, G, H, I, J, K>(
types: [
Type<A>,
Type<B>,
Type<C>,
Type<D>,
Type<E>,
Type<F>,
Type<G>,
Type<H>,
Type<I>,
Type<J>,
Type<K>
],
options?: TypeOptions<A | B | C | D | E | F | G | H | I | J | K>
): Type<A | B | C | D | E | F | G | H | I | J | K>;
function oneOf<A, B, C, D, E, F, G, H, I, J>(
types: [Type<A>, Type<B>, Type<C>, Type<D>, Type<E>, Type<F>, Type<G>, Type<H>, Type<I>, Type<J>],
options?: TypeOptions<A | B | C | D | E | F | G | H | I | J>
Expand Down
15 changes: 15 additions & 0 deletions packages/kbn-securitysolution-list-api/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import {
} from '@kbn/securitysolution-list-constants';
import { toError, toPromise } from '../fp_utils';

const version = '2023-10-31';

/**
* Add new ExceptionList
*
Expand All @@ -62,6 +64,7 @@ const addExceptionList = async ({
body: JSON.stringify(list),
method: 'POST',
signal,
version,
});

const addExceptionListWithValidation = async ({
Expand Down Expand Up @@ -105,6 +108,7 @@ const addExceptionListItem = async ({
body: JSON.stringify(listItem),
method: 'POST',
signal,
version,
});

const addExceptionListItemWithValidation = async ({
Expand Down Expand Up @@ -148,6 +152,7 @@ const updateExceptionList = async ({
body: JSON.stringify(list),
method: 'PUT',
signal,
version,
});

const updateExceptionListWithValidation = async ({
Expand Down Expand Up @@ -191,6 +196,7 @@ const updateExceptionListItem = async ({
body: JSON.stringify(listItem),
method: 'PUT',
signal,
version,
});

const updateExceptionListItemWithValidation = async ({
Expand Down Expand Up @@ -247,6 +253,7 @@ const fetchExceptionLists = async ({
method: 'GET',
query,
signal,
version,
});
};

Expand Down Expand Up @@ -298,6 +305,7 @@ const fetchExceptionListById = async ({
method: 'GET',
query: { id, namespace_type: namespaceType },
signal,
version,
});

const fetchExceptionListByIdWithValidation = async ({
Expand Down Expand Up @@ -361,6 +369,7 @@ const fetchExceptionListsItemsByListIds = async ({
method: 'GET',
query,
signal,
version,
});
};

Expand Down Expand Up @@ -414,6 +423,7 @@ const fetchExceptionListItemById = async ({
method: 'GET',
query: { id, namespace_type: namespaceType },
signal,
version,
});

const fetchExceptionListItemByIdWithValidation = async ({
Expand Down Expand Up @@ -450,6 +460,7 @@ const deleteExceptionListById = async ({
method: 'DELETE',
query: { id, namespace_type: namespaceType },
signal,
version,
});

const deleteExceptionListByIdWithValidation = async ({
Expand Down Expand Up @@ -486,6 +497,7 @@ const deleteExceptionListItemById = async ({
method: 'DELETE',
query: { id, namespace_type: namespaceType },
signal,
version,
});

const deleteExceptionListItemByIdWithValidation = async ({
Expand Down Expand Up @@ -518,6 +530,7 @@ const addEndpointExceptionList = async ({
http.fetch<ExceptionListItemSchema>(ENDPOINT_LIST_URL, {
method: 'POST',
signal,
version,
});

const addEndpointExceptionListWithValidation = async ({
Expand Down Expand Up @@ -561,6 +574,7 @@ export const exportExceptionList = async ({
include_expired_exceptions: includeExpiredExceptions,
},
signal,
version,
});

/**
Expand Down Expand Up @@ -647,4 +661,5 @@ export const duplicateExceptionList = async ({
include_expired_exceptions: includeExpiredExceptions,
},
signal,
version,
});
10 changes: 9 additions & 1 deletion packages/kbn-securitysolution-list-api/src/list_api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export type {
ImportListParams,
} from './types';

const version = '2023-10-31';

const findLists = async ({
http,
cursor,
Expand All @@ -79,6 +81,7 @@ const findLists = async ({
sort_order,
},
signal,
version,
});
};

Expand Down Expand Up @@ -167,6 +170,7 @@ const importList = async ({
method: 'POST',
query: { list_id, type },
signal,
version,
});
};

Expand Down Expand Up @@ -207,6 +211,7 @@ const deleteList = async ({
method: 'DELETE',
query: { deleteReferences, id, ignoreReferences },
signal,
version,
});

const deleteListWithValidation = async ({
Expand Down Expand Up @@ -236,6 +241,7 @@ const exportList = async ({
method: 'POST',
query: { list_id },
signal,
version,
});

const exportListWithValidation = async ({
Expand All @@ -256,6 +262,7 @@ const readListIndex = async ({ http, signal }: ApiParams): Promise<ListItemIndex
http.fetch<ListItemIndexExistSchema>(LIST_INDEX, {
method: 'GET',
signal,
version,
});

const readListIndexWithValidation = async ({
Expand All @@ -273,15 +280,16 @@ export { readListIndexWithValidation as readListIndex };
// TODO add types and validation
export const readListPrivileges = async ({ http, signal }: ApiParams): Promise<unknown> =>
http.fetch<unknown>(LIST_PRIVILEGES_URL, {
version: '2023-10-31',
method: 'GET',
signal,
version,
});

const createListIndex = async ({ http, signal }: ApiParams): Promise<AcknowledgeSchema> =>
http.fetch<AcknowledgeSchema>(LIST_INDEX, {
method: 'POST',
signal,
version,
});

const createListIndexWithValidation = async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3019,6 +3019,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '123abc',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
{
id: uuidv4(),
Expand All @@ -3027,6 +3028,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '456def',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
]);
expect(authorization.ensureAuthorized).toHaveBeenCalledWith({
Expand All @@ -3051,6 +3053,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '123abc',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
{
id: uuidv4(),
Expand All @@ -3059,6 +3062,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '456def',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
])
).rejects.toMatchInlineSnapshot(`[Error: Unauthorized to execute all actions]`);
Expand All @@ -3081,6 +3085,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '123abc',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
{
id: uuidv4(),
Expand All @@ -3089,6 +3094,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '456def',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
]);

Expand All @@ -3112,6 +3118,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '123abc',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
{
id: uuidv4(),
Expand All @@ -3120,6 +3127,7 @@ describe('bulkEnqueueExecution()', () => {
executionId: '456def',
apiKey: null,
source: asHttpRequestExecutionSource(request),
actionTypeId: 'my-action-type',
},
];
await expect(actionsClient.bulkEnqueueExecution(opts)).resolves.toMatchInlineSnapshot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {
ExecutionEnqueuer,
ExecuteOptions as EnqueueExecutionOptions,
BulkExecutionEnqueuer,
ExecutionResponse,
} from '../create_execute_function';
import { ActionsAuthorization } from '../authorization/actions_authorization';
import {
Expand Down Expand Up @@ -114,7 +115,7 @@ export interface ConstructorOptions {
inMemoryConnectors: InMemoryConnector[];
actionExecutor: ActionExecutorContract;
ephemeralExecutionEnqueuer: ExecutionEnqueuer<RunNowResult>;
bulkExecutionEnqueuer: BulkExecutionEnqueuer<void>;
bulkExecutionEnqueuer: BulkExecutionEnqueuer<ExecutionResponse>;
request: KibanaRequest;
authorization: ActionsAuthorization;
auditLogger?: AuditLogger;
Expand All @@ -139,7 +140,7 @@ export interface ActionsClientContext {
request: KibanaRequest;
authorization: ActionsAuthorization;
ephemeralExecutionEnqueuer: ExecutionEnqueuer<RunNowResult>;
bulkExecutionEnqueuer: BulkExecutionEnqueuer<void>;
bulkExecutionEnqueuer: BulkExecutionEnqueuer<ExecutionResponse>;
auditLogger?: AuditLogger;
usageCounter?: UsageCounter;
connectorTokenClient: ConnectorTokenClientContract;
Expand Down Expand Up @@ -766,7 +767,9 @@ export class ActionsClient {
});
}

public async bulkEnqueueExecution(options: EnqueueExecutionOptions[]): Promise<void> {
public async bulkEnqueueExecution(
options: EnqueueExecutionOptions[]
): Promise<ExecutionResponse> {
const sources: Array<ActionExecutionSource<unknown>> = [];
options.forEach((option) => {
if (option.source) {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/actions/server/actions_config.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const createActionsConfigMock = () => {
validateEmailAddresses: jest.fn().mockReturnValue(undefined),
getMaxAttempts: jest.fn().mockReturnValue(3),
enableFooterInEmail: jest.fn().mockReturnValue(true),
getMaxQueued: jest.fn().mockReturnValue(1000),
};
return mocked;
};
Expand Down
17 changes: 17 additions & 0 deletions x-pack/plugins/actions/server/actions_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,3 +563,20 @@ describe('getMaxAttempts()', () => {
expect(maxAttempts).toEqual(3);
});
});

describe('getMaxQueued()', () => {
test('returns the queued actions max defined in config', () => {
const acu = getActionsConfigurationUtilities({
...defaultActionsConfig,
queued: { max: 1 },
});
const max = acu.getMaxQueued();
expect(max).toEqual(1);
});

test('returns the default queued actions max', () => {
const acu = getActionsConfigurationUtilities(defaultActionsConfig);
const max = acu.getMaxQueued();
expect(max).toEqual(1000000);
});
});
Loading

0 comments on commit fa608ac

Please sign in to comment.