forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Security Solution][Event Filters] Adds banner about Linux even…
…ting change for 8.16 upgrade (elastic#195177) (elastic#195917) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution][Event Filters] Adds banner about Linux eventing change for 8.16 upgrade (elastic#195177)](elastic#195177) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Candace Park","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-11T13:25:58Z","message":"[Security Solution][Event Filters] Adds banner about Linux eventing change for 8.16 upgrade (elastic#195177)\n\n## Summary\r\n\r\n- [x] Adds a banner notifying users about the Linux eventing changes for\r\n8.16\r\n- [x] Link to documentation opens in new tab \r\n- [x] Unit tests\r\n\r\n# Screenshot\r\n<img width=\"1662\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e94176b1-e57a-426e-8ebc-135f54a57be0\">\r\n\r\n\r\nhttps://github.com/user-attachments/assets/b2768462-4343-4c85-ad98-36afaba0665c\r\n\r\n---------\r\n\r\nCo-authored-by: Gergő Ábrahám <[email protected]>","sha":"3f8a6d835a89eb2fb369a16f9210c22462113812","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Defend Workflows","v8.16.0","backport:version"],"title":"[Security Solution][Event Filters] Adds banner about Linux eventing change for 8.16 upgrade","number":195177,"url":"https://github.com/elastic/kibana/pull/195177","mergeCommit":{"message":"[Security Solution][Event Filters] Adds banner about Linux eventing change for 8.16 upgrade (elastic#195177)\n\n## Summary\r\n\r\n- [x] Adds a banner notifying users about the Linux eventing changes for\r\n8.16\r\n- [x] Link to documentation opens in new tab \r\n- [x] Unit tests\r\n\r\n# Screenshot\r\n<img width=\"1662\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e94176b1-e57a-426e-8ebc-135f54a57be0\">\r\n\r\n\r\nhttps://github.com/user-attachments/assets/b2768462-4343-4c85-ad98-36afaba0665c\r\n\r\n---------\r\n\r\nCo-authored-by: Gergő Ábrahám <[email protected]>","sha":"3f8a6d835a89eb2fb369a16f9210c22462113812"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195177","number":195177,"mergeCommit":{"message":"[Security Solution][Event Filters] Adds banner about Linux eventing change for 8.16 upgrade (elastic#195177)\n\n## Summary\r\n\r\n- [x] Adds a banner notifying users about the Linux eventing changes for\r\n8.16\r\n- [x] Link to documentation opens in new tab \r\n- [x] Unit tests\r\n\r\n# Screenshot\r\n<img width=\"1662\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e94176b1-e57a-426e-8ebc-135f54a57be0\">\r\n\r\n\r\nhttps://github.com/user-attachments/assets/b2768462-4343-4c85-ad98-36afaba0665c\r\n\r\n---------\r\n\r\nCo-authored-by: Gergő Ábrahám <[email protected]>","sha":"3f8a6d835a89eb2fb369a16f9210c22462113812"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Candace Park <[email protected]>
- Loading branch information
1 parent
d360231
commit 0098832
Showing
8 changed files
with
160 additions
and
4 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
43 changes: 43 additions & 0 deletions
43
...anagement/pages/policy/view/policy_settings_form/components/event_merging_banner.test.tsx
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,43 @@ | ||
/* | ||
* 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 { RenderResult } from '@testing-library/react'; | ||
import React from 'react'; | ||
import { createAppRootMockRenderer } from '../../../../../../common/mock/endpoint'; | ||
import { EventMergingBanner, type EventMergingBannerProps } from './event_merging_banner'; | ||
|
||
describe('EventMergingBanner component', () => { | ||
let formProps: EventMergingBannerProps; | ||
let renderResult: RenderResult; | ||
|
||
beforeEach(() => { | ||
const mockedContext = createAppRootMockRenderer(); | ||
|
||
formProps = { | ||
onDismiss: jest.fn(), | ||
}; | ||
|
||
renderResult = mockedContext.render(<EventMergingBanner {...formProps} />); | ||
}); | ||
|
||
it('should render event merging banner', () => { | ||
expect(renderResult.getByTestId('eventMergingCallout')).toBeInTheDocument(); | ||
}); | ||
|
||
it('should contain a link to documentation', () => { | ||
const docLink = renderResult.getByTestId('eventMergingDocLink'); | ||
|
||
expect(docLink).toBeInTheDocument(); | ||
expect(docLink.getAttribute('href')).toContain('endpoint-data-volume.html'); | ||
}); | ||
|
||
it('should call `onDismiss` callback when user clicks dismiss', () => { | ||
renderResult.getByTestId('euiDismissCalloutButton').click(); | ||
|
||
expect(formProps.onDismiss).toBeCalled(); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
...lic/management/pages/policy/view/policy_settings_form/components/event_merging_banner.tsx
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,52 @@ | ||
/* | ||
* 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 React, { memo } from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { EuiCallOut, EuiLink, EuiText } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { useKibana } from '@kbn/kibana-react-plugin/public'; | ||
|
||
export interface EventMergingBannerProps { | ||
onDismiss: () => void; | ||
} | ||
|
||
export const EventMergingBanner = memo<EventMergingBannerProps>(({ onDismiss }) => { | ||
const { docLinks } = useKibana().services; | ||
const bannerTitle = i18n.translate( | ||
'xpack.securitySolution.endpoint.policy.eventMergingBanner.title', | ||
{ | ||
defaultMessage: "We've recently changed Linux event collection", | ||
} | ||
); | ||
|
||
return ( | ||
<EuiCallOut title={bannerTitle} onDismiss={onDismiss} data-test-subj="eventMergingCallout"> | ||
<EuiText size="s"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policy.eventMergingBanner.body" | ||
defaultMessage="Elastic Agent 8.16+ produces less telemetry without reducing system visibility, which may impact existing event filters. For more about these changes and how to adjust your settings, visit our {documentation}." | ||
values={{ | ||
documentation: ( | ||
<EuiLink | ||
href={docLinks?.links.securitySolution.eventMerging} | ||
target="_blank" | ||
data-test-subj="eventMergingDocLink" | ||
> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.eventMergingBanner.doc.link" | ||
defaultMessage="documentation" | ||
/> | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
</EuiText> | ||
</EuiCallOut> | ||
); | ||
}); | ||
EventMergingBanner.displayName = 'EventMergingBanner'; |
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