Skip to content

Commit c78b7fa

Browse files
authored
[Cloud Posture] feat: enable auto update (#144664)
1 parent b980c8c commit c78b7fa

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
8080
"endpoint:user-artifact": "f94c250a52b30d0a2d32635f8b4c5bdabd1e25c0",
8181
"endpoint:user-artifact-manifest": "8c14d49a385d5d1307d956aa743ec78de0b2be88",
8282
"enterprise_search_telemetry": "fafcc8318528d34f721c42d1270787c52565bad5",
83-
"epm-packages": "c4c39f20d6bcfff40994813ee0f2bab01d34b646",
83+
"epm-packages": "cb22b422398a785e7e0565a19c6d4d5c7af6f2fd",
8484
"epm-packages-assets": "9fd3d6726ac77369249e9a973902c2cd615fc771",
8585
"event_loop_delays_daily": "d2ed39cf669577d90921c176499908b4943fb7bd",
8686
"exception-list": "fe8cc004fd2742177cdb9300f4a67689463faf9c",

x-pack/plugins/fleet/common/constants/epm.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const autoUpdatePackages = [
4141
FLEET_ENDPOINT_PACKAGE,
4242
FLEET_APM_PACKAGE,
4343
FLEET_SYNTHETICS_PACKAGE,
44+
FLEET_CLOUD_SECURITY_POSTURE_PACKAGE,
4445
];
4546

4647
export const HIDDEN_API_REFERENCE_PACKAGES = [
@@ -49,7 +50,11 @@ export const HIDDEN_API_REFERENCE_PACKAGES = [
4950
FLEET_SYNTHETICS_PACKAGE,
5051
];
5152

52-
export const autoUpgradePoliciesPackages = [FLEET_APM_PACKAGE, FLEET_SYNTHETICS_PACKAGE];
53+
export const autoUpgradePoliciesPackages = [
54+
FLEET_APM_PACKAGE,
55+
FLEET_SYNTHETICS_PACKAGE,
56+
FLEET_CLOUD_SECURITY_POSTURE_PACKAGE,
57+
];
5358

5459
export const agentAssetTypes = {
5560
Input: 'input',

x-pack/plugins/fleet/server/saved_objects/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import {
4747
migratePackagePolicyToV840,
4848
} from './migrations/to_v8_4_0';
4949
import { migratePackagePolicyToV850, migrateAgentPolicyToV850 } from './migrations/to_v8_5_0';
50-
import { migrateSettingsToV860 } from './migrations/to_v8_6_0';
50+
import { migrateSettingsToV860, migrateInstallationToV860 } from './migrations/to_v8_6_0';
5151

5252
/*
5353
* Saved object types and mappings
@@ -297,6 +297,7 @@ const getSavedObjectTypes = (
297297
'8.0.0': migrateInstallationToV800,
298298
'8.3.0': migrateInstallationToV830,
299299
'8.4.0': migrateInstallationToV840,
300+
'8.6.0': migrateInstallationToV860,
300301
},
301302
},
302303
[ASSETS_SAVED_OBJECT_TYPE]: {

x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import type { SavedObjectMigrationFn } from '@kbn/core/server';
99

1010
import type { Settings } from '../../../common/types';
1111

12+
import type { Installation } from '../../../common';
13+
import { FLEET_CLOUD_SECURITY_POSTURE_PACKAGE } from '../../../common/constants';
14+
1215
export const migrateSettingsToV860: SavedObjectMigrationFn<Settings, Settings> = (
1316
settingsDoc,
1417
migrationContext
@@ -20,3 +23,12 @@ export const migrateSettingsToV860: SavedObjectMigrationFn<Settings, Settings> =
2023

2124
return settingsDoc;
2225
};
26+
27+
export const migrateInstallationToV860: SavedObjectMigrationFn<Installation, Installation> = (
28+
installationDoc
29+
) => {
30+
if (installationDoc.attributes.name === FLEET_CLOUD_SECURITY_POSTURE_PACKAGE) {
31+
installationDoc.attributes.keep_policies_up_to_date = true;
32+
}
33+
return installationDoc;
34+
};

0 commit comments

Comments
 (0)