Skip to content
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

[Security Solution] Only attempt to rollover signals index if version < builtin version #84982

Merged
merged 1 commit into from
Dec 4, 2020
Merged
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 @@ -78,7 +78,7 @@ export const createDetectionIndex = async (
const indexExists = await getIndexExists(callCluster, index);
if (indexExists) {
const indexVersion = await getIndexVersion(callCluster, index);
if (indexVersion !== SIGNALS_TEMPLATE_VERSION) {
if ((indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION) {
await callCluster('indices.rollover', { alias: index });
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const readIndexRoute = (router: IRouter) => {
let mappingOutdated: boolean | null = null;
try {
const indexVersion = await getIndexVersion(clusterClient.callAsCurrentUser, index);
mappingOutdated = indexVersion !== SIGNALS_TEMPLATE_VERSION;
mappingOutdated = (indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION;
} catch (err) {
const error = transformError(err);
// Some users may not have the view_index_metadata permission necessary to check the index mapping version
Expand Down