-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix circular ref. Move the code & tests into Fleet
- Loading branch information
John Schulz
committed
Mar 9, 2021
1 parent
35d01f5
commit 1f25c2f
Showing
8 changed files
with
57 additions
and
24 deletions.
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
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
39 changes: 39 additions & 0 deletions
39
x-pack/plugins/fleet/server/saved_objects/security_solution/to_v7_11_0.ts
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,39 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { SavedObjectMigrationFn, SavedObjectUnsanitizedDoc } from 'kibana/server'; | ||
import { cloneDeep } from 'lodash'; | ||
|
||
import { PackagePolicy } from '../../../common'; | ||
|
||
export const migratePackagePolicyToV7110: SavedObjectMigrationFn<PackagePolicy, PackagePolicy> = ( | ||
packagePolicyDoc | ||
) => { | ||
const updatedPackagePolicyDoc: SavedObjectUnsanitizedDoc<PackagePolicy> = cloneDeep( | ||
packagePolicyDoc | ||
); | ||
if (packagePolicyDoc.attributes.package?.name === 'endpoint') { | ||
const input = updatedPackagePolicyDoc.attributes.inputs[0]; | ||
const popup = { | ||
malware: { | ||
message: '', | ||
enabled: false, | ||
}, | ||
}; | ||
if (input && input.config) { | ||
const policy = input.config.policy.value; | ||
|
||
policy.windows.antivirus_registration = policy.windows.antivirus_registration || { | ||
enabled: false, | ||
}; | ||
policy.windows.popup = popup; | ||
policy.mac.popup = popup; | ||
} | ||
} | ||
|
||
return updatedPackagePolicyDoc; | ||
}; |
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