-
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
[SECURITY_SOLUTION][ENDPOINT] Improve Endpoint Host data generator to also integrate with Ingest #74305
Merged
parkiino
merged 31 commits into
elastic:master
from
paul-tavares:task/endpoint-host-data-generator-create-policy
Sep 30, 2020
Merged
[SECURITY_SOLUTION][ENDPOINT] Improve Endpoint Host data generator to also integrate with Ingest #74305
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
293eeaf
Create Policies for each generated host
paul-tavares 2b5ab65
Refactor Ingest setup to also setup Fleet
paul-tavares ad39d54
Rename prop name
paul-tavares c2aea57
Add generic response type to KbnClient.request + support for headers
paul-tavares b71e438
first attempt at adding fleet agent registration
paul-tavares 73a0754
a little closer with fleet integration
paul-tavares a8221bb
SUCCESS. Able to enroll agent and set it to online
paul-tavares e3ef509
update names to be policy
kevinlog 4deebbf
policy generator has advanced types in endpoint confit
parkiino 0e61d00
use KbnClientWithRequestAPI
parkiino dfb9627
fix typecheck errors
parkiino 76db23b
add flag to skip fleet
parkiino a6b6d3f
Merge remote-tracking branch 'upstream/master' into task/endpoint-hos…
parkiino 848eec5
fix tests
parkiino 4caaf96
make advanced field type optional
parkiino 02cd8fa
remove advanced fields
parkiino 58ef6d5
another advanced removal
parkiino 7b82e05
revert experimental change
parkiino e8ead7f
shorten urls that use requestWithApiKey
parkiino 51730fa
Merge remote-tracking branch 'upstream/master' into task/endpoint-hos…
parkiino 65596ec
remove excess quaotes
parkiino 047925b
Merge remote-tracking branch 'upstream/master' into task/endpoint-hos…
parkiino c6ee44e
Merge remote-tracking branch 'upstream/master' into task/endpoint-hos…
parkiino 2f4d043
fix ci errors
parkiino c3d9282
agent enrollment fix
parkiino 02d122f
Merge remote-tracking branch 'upstream/master' into task/endpoint-hos…
parkiino 321546a
Merge remote-tracking branch 'upstream/master' into task/endpoint-hos…
parkiino 56d2c99
marshall's changes + edits to hostname
parkiino edd7bde
fetch kibana version
parkiino 575282e
Merge remote-tracking branch 'upstream/master' into task/endpoint-hos…
parkiino 369318c
remove circular dependency
parkiino 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,12 @@ const Mac: OSFields[] = []; | |
|
||
const OS: OSFields[] = [...Windows, ...Mac, ...Linux]; | ||
|
||
const POLICY_RESPONSE_STATUSES: HostPolicyResponseActionStatus[] = [ | ||
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. Noice |
||
HostPolicyResponseActionStatus.success, | ||
HostPolicyResponseActionStatus.failure, | ||
HostPolicyResponseActionStatus.warning, | ||
]; | ||
|
||
const APPLIED_POLICIES: Array<{ | ||
name: string; | ||
id: string; | ||
|
@@ -125,6 +131,11 @@ const APPLIED_POLICIES: Array<{ | |
id: 'C2A9093E-E289-4C0A-AA44-8C32A414FA7A', | ||
status: HostPolicyResponseActionStatus.success, | ||
}, | ||
{ | ||
name: 'Detect Malware Only', | ||
id: '47d7965d-6869-478b-bd9c-fb0d2bb3959f', | ||
status: HostPolicyResponseActionStatus.success, | ||
}, | ||
]; | ||
|
||
const FILE_OPERATIONS: string[] = ['creation', 'open', 'rename', 'execution', 'deletion']; | ||
|
@@ -364,15 +375,12 @@ export class EndpointDocGenerator { | |
} | ||
|
||
/** | ||
* Creates new random policy id for the host to simulate new policy application | ||
* Updates the current Host common record applied Policy to a different one from the list | ||
* of random choices and gives it a random policy response status. | ||
*/ | ||
public updatePolicyId() { | ||
this.commonInfo.Endpoint.policy.applied.id = this.randomChoice(APPLIED_POLICIES).id; | ||
this.commonInfo.Endpoint.policy.applied.status = this.randomChoice([ | ||
HostPolicyResponseActionStatus.success, | ||
HostPolicyResponseActionStatus.failure, | ||
HostPolicyResponseActionStatus.warning, | ||
]); | ||
public updateHostPolicyData() { | ||
this.commonInfo.Endpoint.policy.applied = this.randomChoice(APPLIED_POLICIES); | ||
this.commonInfo.Endpoint.policy.applied.status = this.randomChoice(POLICY_RESPONSE_STATUSES); | ||
} | ||
|
||
private createHostData(): HostInfo { | ||
|
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.
We need someone from Kibana (??) to look over this change and give us a 👍 - just to make sure they are aware 😬 .