-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Security Solution] Add host isolation exception IPs UI #113762
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
Merged
academo
merged 26 commits into
elastic:master
from
academo:feature/host-isolation-exception-add
Oct 11, 2021
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b4ecec8
Initial empty form to add an exception
academo da94c6e
Merge remote-tracking branch 'upstream/master' into feature/host-isol…
academo 0fb4d41
WIP add form construction
academo c73b47f
Add code to handle the add form
academo 671faa0
Merge remote-tracking branch 'upstream/master' into feature/host-isol…
academo a4775ce
WIP create entry
academo 1754d41
Working add
academo 6fc871f
Add toast to create and failure
academo 0378a57
Add validation for ipv4 and CIDR format
academo 64669d8
Reload the list of exceptions after adding
academo dcbb5df
Remove unused import
academo 02b2f11
Merge remote-tracking branch 'upstream/master' into feature/host-isol…
academo 02cbe0b
Replace mockclear with mockreset
becaa1a
Add tests for reducer and add host Isolation exception
82a47aa
Fix TS error
d18264e
Firsts test for form
3ccdf9e
Tests for form
138fca7
Remove unused dependencies
346dbf2
Add tests for for the form flyout
0e2d84b
Add tests for the add button
de6e673
Merge remote-tracking branch 'upstream/master' into feature/host-isol…
e5e8b12
Fix PR comments
21dd6c7
Handle onCancel directly on the form flyout
d79ef0e
Fix dependency issue for hook
07c624a
Merge branch 'master' into feature/host-isolation-exception-add
kibanamachine 6a697ea
Fix PR comments
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
41 changes: 41 additions & 0 deletions
41
x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/utils.ts
This file contains hidden or 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,41 @@ | ||
| /* | ||
| * 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 { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; | ||
| import { ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID } from '@kbn/securitysolution-list-constants'; | ||
| import ipaddr from 'ipaddr.js'; | ||
|
|
||
| export function createEmptyHostIsolationException(): CreateExceptionListItemSchema { | ||
| return { | ||
| comments: [], | ||
| description: '', | ||
| entries: [ | ||
| { | ||
| field: 'destination.ip', | ||
| operator: 'included', | ||
| type: 'match', | ||
| value: '', | ||
| }, | ||
| ], | ||
| item_id: undefined, | ||
| list_id: ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID, | ||
| name: '', | ||
| namespace_type: 'agnostic', | ||
| os_types: ['windows', 'linux', 'macos'], | ||
| tags: ['policy:all'], | ||
| type: 'simple', | ||
| }; | ||
| } | ||
|
|
||
| export function isValidIPv4OrCIDR(maybeIp: string): boolean { | ||
| try { | ||
| ipaddr.IPv4.parseCIDR(maybeIp); | ||
| return true; | ||
| } catch (e) { | ||
| return ipaddr.IPv4.isValid(maybeIp); | ||
| } | ||
| } | ||
academo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.