-
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
[SECURITY_SOLUTION][ENDPOINT] Improve Endpoint Host data generator to also integrate with Ingest #74305
Changes from 14 commits
293eeaf
2b5ab65
ad39d54
c2aea57
b71e438
73a0754
a8221bb
e3ef509
4deebbf
0e61d00
dfb9627
76db23b
a6b6d3f
848eec5
4caaf96
02cd8fa
58ef6d5
7b82e05
e8ead7f
51730fa
65596ec
047925b
c6ee44e
2f4d043
c3d9282
02d122f
321546a
56d2c99
edd7bde
575282e
369318c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ export interface ReqOptions { | |
path: string; | ||
query?: Record<string, any>; | ||
method: 'GET' | 'POST' | 'PUT' | 'DELETE'; | ||
headers?: Record<string, string>; | ||
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. I think we can revert the changes in this file. Originally, I was trying to use this client to make Kibana API calls using an API key, which requires us to pass in 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. For the Kibana Team: It would be great if |
||
body?: any; | ||
retries?: number; | ||
} | ||
|
@@ -117,6 +118,7 @@ export class KbnClientRequester { | |
params: options.query, | ||
headers: { | ||
'kbn-xsrf': 'kbn-client', | ||
...options.headers, | ||
}, | ||
httpsAgent: this.httpsAgent, | ||
}); | ||
|
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 { | ||
|
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 😬 .