-
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.
[EDR Workflows][Serverless] Gate Protection Updates (#175129)
With this pull request, we implement Protection Updates gating on the Security Essentials tier. The changes include: 1. Addition of an upselling component on the Protection Updates tab. 2. Extension of the package policy create/update API callback to verify the protection updates app feature before committing changes to global_manifest_version. 3. Extension of the turn_off_policy_protections plugin callback to inspect the protection updates app feature on server start. If no app feature is present, it will roll down global_manifest_version to the default of 'latest'. ![Screenshot 2024-01-18 at 15 50 32](https://github.com/elastic/kibana/assets/29123534/a018562f-e528-4f29-a070-57b3b20c949f)
- Loading branch information
1 parent
9872b70
commit 57374ab
Showing
17 changed files
with
570 additions
and
26 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
71 changes: 71 additions & 0 deletions
71
...t/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_complete.cy.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,71 @@ | ||
/* | ||
* 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 type { IndexedFleetEndpointPolicyResponse } from '../../../../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; | ||
import { login } from '../../../../tasks/login'; | ||
import { loadPage } from '../../../../tasks/common'; | ||
import { APP_POLICIES_PATH } from '../../../../../../../common/constants'; | ||
|
||
describe( | ||
'When displaying the Policy Details in Endpoint Essentials PLI', | ||
{ | ||
tags: ['@serverless'], | ||
env: { | ||
ftrConfig: { | ||
productTypes: [ | ||
{ product_line: 'security', product_tier: 'essentials' }, | ||
{ product_line: 'endpoint', product_tier: 'complete' }, | ||
], | ||
}, | ||
}, | ||
}, | ||
() => { | ||
let loadedPolicyData: IndexedFleetEndpointPolicyResponse; | ||
let policyId: string; | ||
|
||
before(() => { | ||
cy.task( | ||
'indexFleetEndpointPolicy', | ||
{ policyName: 'tests-serverless' }, | ||
{ timeout: 5 * 60 * 1000 } | ||
).then((res) => { | ||
const response = res as IndexedFleetEndpointPolicyResponse; | ||
loadedPolicyData = response; | ||
policyId = response.integrationPolicies[0].id; | ||
}); | ||
}); | ||
|
||
after(() => { | ||
if (loadedPolicyData) { | ||
cy.task('deleteIndexedFleetEndpointPolicies', loadedPolicyData); | ||
} | ||
}); | ||
|
||
beforeEach(() => { | ||
login(); | ||
}); | ||
|
||
it('should display upselling section for protection updates', () => { | ||
loadPage(`${APP_POLICIES_PATH}/${policyId}/protectionUpdates`); | ||
[ | ||
'endpointPolicy-protectionUpdatesLockedCard-title', | ||
'endpointPolicy-protectionUpdatesLockedCard', | ||
'endpointPolicy-protectionUpdatesLockedCard-badge', | ||
].forEach((testSubj) => { | ||
cy.getByTestSubj(testSubj).should('not.exist'); | ||
}); | ||
[ | ||
'protection-updates-warning-callout', | ||
'protection-updates-automatic-updates-enabled', | ||
'protection-updates-manifest-switch', | ||
'protection-updates-manifest-name-title', | ||
].forEach((testSubj) => { | ||
cy.getByTestSubj(testSubj).should('exist').and('be.visible'); | ||
}); | ||
}); | ||
} | ||
); |
64 changes: 64 additions & 0 deletions
64
...cypress/e2e/serverless/feature_access/components/policy_details_endpoint_essentials.cy.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,64 @@ | ||
/* | ||
* 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 type { IndexedFleetEndpointPolicyResponse } from '../../../../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; | ||
import { login } from '../../../../tasks/login'; | ||
import { loadPage } from '../../../../tasks/common'; | ||
import { APP_POLICIES_PATH } from '../../../../../../../common/constants'; | ||
|
||
describe( | ||
'When displaying the Policy Details in Endpoint Essentials PLI', | ||
{ | ||
tags: ['@serverless'], | ||
env: { | ||
ftrConfig: { | ||
productTypes: [ | ||
{ product_line: 'security', product_tier: 'essentials' }, | ||
{ product_line: 'endpoint', product_tier: 'essentials' }, | ||
], | ||
}, | ||
}, | ||
}, | ||
() => { | ||
let loadedPolicyData: IndexedFleetEndpointPolicyResponse; | ||
let policyId: string; | ||
|
||
before(() => { | ||
cy.task( | ||
'indexFleetEndpointPolicy', | ||
{ policyName: 'tests-serverless' }, | ||
{ timeout: 5 * 60 * 1000 } | ||
).then((res) => { | ||
const response = res as IndexedFleetEndpointPolicyResponse; | ||
loadedPolicyData = response; | ||
policyId = response.integrationPolicies[0].id; | ||
}); | ||
}); | ||
|
||
after(() => { | ||
if (loadedPolicyData) { | ||
cy.task('deleteIndexedFleetEndpointPolicies', loadedPolicyData); | ||
} | ||
}); | ||
|
||
beforeEach(() => { | ||
login(); | ||
}); | ||
|
||
it('should display upselling section for protection updates', () => { | ||
loadPage(`${APP_POLICIES_PATH}/${policyId}/protectionUpdates`); | ||
[ | ||
'endpointPolicy-protectionUpdatesLockedCard-title', | ||
'endpointPolicy-protectionUpdatesLockedCard', | ||
'endpointPolicy-protectionUpdatesLockedCard-badge', | ||
].forEach((testSubj) => { | ||
cy.getByTestSubj(testSubj, { timeout: 60000 }).should('exist').and('be.visible'); | ||
}); | ||
cy.getByTestSubj('protection-updates-layout').should('not.exist'); | ||
}); | ||
} | ||
); |
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
13 changes: 13 additions & 0 deletions
13
.../policy/view/protection_updates/hooks/use_get_protection_updates_unavailable_component.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,13 @@ | ||
/* | ||
* 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 type React from 'react'; | ||
import { useUpsellingComponent } from '../../../../../../common/hooks/use_upselling'; | ||
|
||
export const useGetProtectionUpdatesUnavailableComponent = (): React.ComponentType | null => { | ||
return useUpsellingComponent('endpoint_protection_updates'); | ||
}; |
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
Oops, something went wrong.