Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ export const configSchema = schema.object({
}),
monitoring: schema.object({
privileges: schema.object({
developer: schema.object({
syncInterval: schema.number({ defaultValue: 600 }), // 10 minutes in seconds
}),
users: schema.object({
csvUpload: schema.object({
errorRetries: schema.number({ defaultValue: 1 }),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

describe('Privilege Monitoring API Key Manager', () => {
describe('generate', () => {
it('should create and store an API key', async () => {
// TODO: Implement this test for creating and storing an API key
});
it('should throw if encryptedSavedObjects is missing', async () => {
// TODO: Implement this test for missing encryptedSavedObjects
});
it('should throw if request is missing', async () => {
// TODO: Implement this test for missing request
});
});

describe('getClient', () => {
it('should return clusterClient if key is found', async () => {
// TODO: Implement this test for returning clusterClient when API key is found
});

it('should return undefined if no API key is found', async () => {
// TODO: Implement this test for returning undefined when no API key is found
});
});

describe('getRequestFromApiKey', () => {
it('should return a fake request from API key', async () => {
// TODO: Implement this test for returning a fake request from API key
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
*/

import { EXCLUDE_ELASTIC_CLOUD_INDICES, INCLUDE_INDEX_PATTERN } from '../../../../common/constants';

export const SCOPE = ['securitySolution'];
export const TYPE = 'entity_analytics:monitoring:privileges:engine';
export const VERSION = '1.0.0';
export const TIMEOUT = '10m';
export const INTERVAL = '10m';
export const INTERVAL = this.opts.config.privileges.developer.syncInterval; // 10 minutes in seconds (default)

export const PRIVILEGE_MONITORING_ENGINE_STATUS = {
// TODO Make the engine initialization async before uncommenting these lines
Expand Down
Loading