-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SIEM] Register uiSettings on New Platform #64015
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { schema } from '@kbn/config-schema'; | ||
|
||
import { CoreSetup } from '../../../../src/core/server'; | ||
import { | ||
DEFAULT_INDEX_KEY, | ||
DEFAULT_INDEX_PATTERN, | ||
DEFAULT_ANOMALY_SCORE, | ||
DEFAULT_SIEM_TIME_RANGE, | ||
DEFAULT_SIEM_REFRESH_INTERVAL, | ||
DEFAULT_INTERVAL_PAUSE, | ||
DEFAULT_INTERVAL_VALUE, | ||
DEFAULT_FROM, | ||
DEFAULT_TO, | ||
ENABLE_NEWS_FEED_SETTING, | ||
NEWS_FEED_URL_SETTING, | ||
NEWS_FEED_URL_SETTING_DEFAULT, | ||
IP_REPUTATION_LINKS_SETTING, | ||
IP_REPUTATION_LINKS_SETTING_DEFAULT, | ||
} from '../common/constants'; | ||
|
||
export const initUiSettings = (uiSettings: CoreSetup['uiSettings']) => { | ||
uiSettings.register({ | ||
[DEFAULT_SIEM_REFRESH_INTERVAL]: { | ||
type: 'json', | ||
name: i18n.translate('xpack.siem.uiSettings.defaultRefreshIntervalLabel', { | ||
defaultMessage: 'Time filter refresh interval', | ||
}), | ||
value: `{ | ||
"pause": ${DEFAULT_INTERVAL_PAUSE}, | ||
"value": ${DEFAULT_INTERVAL_VALUE} | ||
}`, | ||
description: i18n.translate('xpack.siem.uiSettings.defaultRefreshIntervalDescription', { | ||
defaultMessage: | ||
'<p>Default refresh interval for the SIEM time filter, in milliseconds.</p>', | ||
}), | ||
category: ['siem'], | ||
requiresPageReload: true, | ||
schema: schema.object({ | ||
value: schema.number(), | ||
pause: schema.boolean(), | ||
}), | ||
}, | ||
[DEFAULT_SIEM_TIME_RANGE]: { | ||
type: 'json', | ||
name: i18n.translate('xpack.siem.uiSettings.defaultTimeRangeLabel', { | ||
defaultMessage: 'Time filter period', | ||
}), | ||
value: `{ | ||
"from": "${DEFAULT_FROM}", | ||
"to": "${DEFAULT_TO}" | ||
}`, | ||
description: i18n.translate('xpack.siem.uiSettings.defaultTimeRangeDescription', { | ||
defaultMessage: '<p>Default period of time in the SIEM time filter.</p>', | ||
}), | ||
category: ['siem'], | ||
requiresPageReload: true, | ||
schema: schema.object({ | ||
from: schema.string(), | ||
to: schema.string(), | ||
}), | ||
}, | ||
[DEFAULT_INDEX_KEY]: { | ||
name: i18n.translate('xpack.siem.uiSettings.defaultIndexLabel', { | ||
defaultMessage: 'Elasticsearch indices', | ||
}), | ||
value: DEFAULT_INDEX_PATTERN, | ||
description: i18n.translate('xpack.siem.uiSettings.defaultIndexDescription', { | ||
defaultMessage: | ||
'<p>Comma-delimited list of Elasticsearch indices from which the SIEM app collects events.</p>', | ||
}), | ||
category: ['siem'], | ||
requiresPageReload: true, | ||
schema: schema.arrayOf(schema.string()), | ||
}, | ||
[DEFAULT_ANOMALY_SCORE]: { | ||
name: i18n.translate('xpack.siem.uiSettings.defaultAnomalyScoreLabel', { | ||
defaultMessage: 'Anomaly threshold', | ||
}), | ||
value: 50, | ||
type: 'number', | ||
description: i18n.translate('xpack.siem.uiSettings.defaultAnomalyScoreDescription', { | ||
defaultMessage: | ||
'<p>Value above which Machine Learning job anomalies are displayed in the SIEM app.</p><p>Valid values: 0 to 100.</p>', | ||
}), | ||
category: ['siem'], | ||
requiresPageReload: true, | ||
schema: schema.number(), | ||
}, | ||
[ENABLE_NEWS_FEED_SETTING]: { | ||
name: i18n.translate('xpack.siem.uiSettings.enableNewsFeedLabel', { | ||
defaultMessage: 'News feed', | ||
}), | ||
value: true, | ||
description: i18n.translate('xpack.siem.uiSettings.enableNewsFeedDescription', { | ||
defaultMessage: '<p>Enables the News feed</p>', | ||
}), | ||
type: 'boolean', | ||
category: ['siem'], | ||
requiresPageReload: true, | ||
schema: schema.boolean(), | ||
}, | ||
[NEWS_FEED_URL_SETTING]: { | ||
name: i18n.translate('xpack.siem.uiSettings.newsFeedUrl', { | ||
defaultMessage: 'News feed URL', | ||
}), | ||
value: NEWS_FEED_URL_SETTING_DEFAULT, | ||
description: i18n.translate('xpack.siem.uiSettings.newsFeedUrlDescription', { | ||
defaultMessage: '<p>News feed content will be retrieved from this URL</p>', | ||
}), | ||
category: ['siem'], | ||
requiresPageReload: true, | ||
schema: schema.string(), | ||
}, | ||
[IP_REPUTATION_LINKS_SETTING]: { | ||
name: i18n.translate('xpack.siem.uiSettings.ipReputationLinks', { | ||
defaultMessage: 'IP Reputation Links', | ||
}), | ||
value: IP_REPUTATION_LINKS_SETTING_DEFAULT, | ||
type: 'json', | ||
description: i18n.translate('xpack.siem.uiSettings.ipReputationLinksDescription', { | ||
defaultMessage: | ||
'Array of URL templates to build the list of reputation URLs to be displayed on the IP Details page.', | ||
}), | ||
category: ['siem'], | ||
requiresPageReload: true, | ||
schema: schema.arrayOf( | ||
schema.object({ | ||
name: schema.string(), | ||
url_template: schema.string(), | ||
}) | ||
), | ||
}, | ||
}); | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this setting may be broken? Modifying it to the below configuration on either this branch or
master
(siem-dev) does not result in any changes to the datepickerRefresh every
UI.This appears to be pre-existing, so no need to fix here. I've opened this issue to track: #64034. It looks like the setting isn't being read correctly and it just comes back as
null
.Config:
Result:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, I'll follow up on that issue.