-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[CTI] Adds Threat Intel Tab to Alert Summary Flyout #97185
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dbca7d5
adds Threat Intel tab
ecezalp 1d087cb
adds no enrichment view
ecezalp 2832e9e
fixes tests
ecezalp 87b9c9f
Merge branch 'master' into security-team-998
kibanamachine 9d0a577
tiny refactor
ecezalp f518062
updates no enrichment found design
ecezalp fcefc94
fixes overflow
ecezalp 067f90a
Merge branch 'master' into security-team-998
kibanamachine e8be273
adds sorting by first_seen, removes hook
ecezalp 455243f
adds type guards
ecezalp 0499e28
reverts addition of docLink item
ecezalp 5716b58
updates threat summary row logic
ecezalp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
52 changes: 52 additions & 0 deletions
52
...curity_solution/public/common/components/event_details/empty_threat_details_view.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,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 from 'react'; | ||
import { ThemeProvider } from 'styled-components'; | ||
|
||
import { useMountAppended } from '../../utils/use_mount_appended'; | ||
import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; | ||
import { EmptyThreatDetailsView } from './empty_threat_details_view'; | ||
|
||
jest.mock('../../lib/kibana'); | ||
|
||
describe('EmptyThreatDetailsView', () => { | ||
const mount = useMountAppended(); | ||
const mockTheme = getMockTheme({ | ||
eui: { | ||
euiBreakpoints: { | ||
l: '1200px', | ||
}, | ||
paddingSizes: { | ||
m: '8px', | ||
xl: '32px', | ||
}, | ||
}, | ||
}); | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
test('renders correct items', () => { | ||
const wrapper = mount( | ||
<ThemeProvider theme={mockTheme}> | ||
<EmptyThreatDetailsView /> | ||
</ThemeProvider> | ||
); | ||
expect(wrapper.find('[data-test-subj="empty-threat-details-view"]').exists()).toEqual(true); | ||
}); | ||
|
||
test('renders link to docs', () => { | ||
const wrapper = mount( | ||
<ThemeProvider theme={mockTheme}> | ||
<EmptyThreatDetailsView /> | ||
</ThemeProvider> | ||
); | ||
expect(wrapper.find('a').exists()).toEqual(true); | ||
}); | ||
}); |
50 changes: 50 additions & 0 deletions
50
...ns/security_solution/public/common/components/event_details/empty_threat_details_view.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,50 @@ | ||
/* | ||
* 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 { EuiLink, EuiSpacer, EuiTitle } from '@elastic/eui'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import * as i18n from './translations'; | ||
import { useKibana } from '../../lib/kibana'; | ||
|
||
const EmptyThreatDetailsViewContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
`; | ||
|
||
const Span = styled.span` | ||
color: ${({ theme }) => theme.eui.euiColorDarkShade}; | ||
line-height: 1.8em; | ||
text-align: center; | ||
padding: ${({ theme }) => `${theme.eui.paddingSizes.m} ${theme.eui.paddingSizes.xl}`}; | ||
`; | ||
|
||
const EmptyThreatDetailsViewComponent: React.FC<{}> = () => { | ||
const threatIntelDocsUrl = `${ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
useKibana().services.docLinks.links.filebeat.base | ||
}/filebeat-module-threatintel.html`; | ||
|
||
return ( | ||
<EmptyThreatDetailsViewContainer data-test-subj="empty-threat-details-view"> | ||
<EuiSpacer size="xxl" /> | ||
<EuiTitle size="m"> | ||
<h2>{i18n.NO_ENRICHMENT_FOUND}</h2> | ||
</EuiTitle> | ||
<Span> | ||
{i18n.IF_CTI_NOT_ENABLED} | ||
<EuiLink href={threatIntelDocsUrl} target="_blank"> | ||
{i18n.CHECK_DOCS} | ||
</EuiLink> | ||
</Span> | ||
</EmptyThreatDetailsViewContainer> | ||
); | ||
}; | ||
|
||
EmptyThreatDetailsViewComponent.displayName = 'EmptyThreatDetailsView'; | ||
|
||
export const EmptyThreatDetailsView = React.memo(EmptyThreatDetailsViewComponent); |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
Not worth waiting for another build, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ seemed to indicate nesting level - leaving as is now, I can update in a later commit