-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EDR Workflows] Include Osquery openApi schemas in codegen (#170389)
- Loading branch information
Showing
27 changed files
with
800 additions
and
2 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
10 changes: 10 additions & 0 deletions
10
.buildkite/scripts/steps/code_generation/osquery_codegen.sh
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/common/util.sh | ||
|
||
echo --- Osquery OpenAPI Code Generation | ||
|
||
(cd x-pack/plugins/osquery && yarn openapi:generate) | ||
check_for_changed_files "yarn openapi:generate" true |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/osquery/common/api/asset/assets_status.gen.ts
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,19 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
export type AssetsRequestQuery = z.infer<typeof AssetsRequestQuery>; | ||
export const AssetsRequestQuery = z.object({}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_details.gen.ts
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,19 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
export type GetAgentDetailsRequestParams = z.infer<typeof GetAgentDetailsRequestParams>; | ||
export const GetAgentDetailsRequestParams = z.object({}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_policies.gen.ts
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,19 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
export type GetAgentPoliciesRequestParams = z.infer<typeof GetAgentPoliciesRequestParams>; | ||
export const GetAgentPoliciesRequestParams = z.object({}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
23 changes: 23 additions & 0 deletions
23
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_policy.gen.ts
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,23 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
import { Id } from '../model/schema/common_attributes.gen'; | ||
|
||
export type GetAgentPolicyRequestParams = z.infer<typeof GetAgentPolicyRequestParams>; | ||
export const GetAgentPolicyRequestParams = z.object({ | ||
id: Id.optional(), | ||
}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
27 changes: 27 additions & 0 deletions
27
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_status.gen.ts
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,27 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
import { KueryOrUndefined, Id } from '../model/schema/common_attributes.gen'; | ||
|
||
export type GetAgentStatusRequestParams = z.infer<typeof GetAgentStatusRequestParams>; | ||
export const GetAgentStatusRequestParams = z.object({}); | ||
|
||
export type GetAgentStatusRequestQueryParams = z.infer<typeof GetAgentStatusRequestQueryParams>; | ||
export const GetAgentStatusRequestQueryParams = z.object({ | ||
kuery: KueryOrUndefined.optional(), | ||
policyId: Id.optional(), | ||
}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agents.gen.ts
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,19 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
export type GetAgentsRequestParams = z.infer<typeof GetAgentsRequestParams>; | ||
export const GetAgentsRequestParams = z.object({}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/osquery/common/api/fleet_wrapper/get_package_policies.gen.ts
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,19 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
export type GetPackagePoliciesRequestParams = z.infer<typeof GetPackagePoliciesRequestParams>; | ||
export const GetPackagePoliciesRequestParams = z.object({}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
41 changes: 41 additions & 0 deletions
41
x-pack/plugins/osquery/common/api/live_query/create_live_query.gen.ts
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,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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
import { | ||
QueryOrUndefined, | ||
ArrayQueries, | ||
SavedQueryIdOrUndefined, | ||
ECSMappingOrUndefined, | ||
PackIdOrUndefined, | ||
} from '../model/schema/common_attributes.gen'; | ||
|
||
export type CreateLiveQueryRequestBody = z.infer<typeof CreateLiveQueryRequestBody>; | ||
export const CreateLiveQueryRequestBody = z.object({ | ||
agent_ids: z.array(z.string()).optional(), | ||
agent_all: z.boolean().optional(), | ||
agent_platforms: z.array(z.string()).optional(), | ||
agent_policy_ids: z.array(z.string()).optional(), | ||
query: QueryOrUndefined.optional(), | ||
queries: ArrayQueries.optional(), | ||
saved_query_id: SavedQueryIdOrUndefined.optional(), | ||
ecs_mapping: ECSMappingOrUndefined.optional(), | ||
pack_id: PackIdOrUndefined.optional(), | ||
alert_ids: z.array(z.string()).optional(), | ||
case_ids: z.array(z.string()).optional(), | ||
event_ids: z.array(z.string()).optional(), | ||
metadata: z.object({}).nullable().optional(), | ||
}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/osquery/common/api/live_query/find_live_query.gen.ts
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,33 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
import { | ||
KueryOrUndefined, | ||
PageOrUndefined, | ||
PageSizeOrUndefined, | ||
SortOrUndefined, | ||
SortOrderOrUndefined, | ||
} from '../model/schema/common_attributes.gen'; | ||
|
||
export type FindLiveQueryRequestQuery = z.infer<typeof FindLiveQueryRequestQuery>; | ||
export const FindLiveQueryRequestQuery = z.object({ | ||
kuery: KueryOrUndefined.optional(), | ||
page: PageOrUndefined.optional(), | ||
pageSize: PageSizeOrUndefined.optional(), | ||
sort: SortOrUndefined.optional(), | ||
sortOrder: SortOrderOrUndefined.optional(), | ||
}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
16 changes: 16 additions & 0 deletions
16
x-pack/plugins/osquery/common/api/live_query/get_live_query_details.gen.ts
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,16 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
40 changes: 40 additions & 0 deletions
40
x-pack/plugins/osquery/common/api/live_query/get_live_query_results.gen.ts
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,40 @@ | ||
/* | ||
* 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 { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
*/ | ||
|
||
import { | ||
KueryOrUndefined, | ||
PageOrUndefined, | ||
PageSizeOrUndefined, | ||
SortOrUndefined, | ||
SortOrderOrUndefined, | ||
Id, | ||
} from '../model/schema/common_attributes.gen'; | ||
|
||
export type GetLiveQueryResultsRequestQuery = z.infer<typeof GetLiveQueryResultsRequestQuery>; | ||
export const GetLiveQueryResultsRequestQuery = z.object({ | ||
kuery: KueryOrUndefined.optional(), | ||
page: PageOrUndefined.optional(), | ||
pageSize: PageSizeOrUndefined.optional(), | ||
sort: SortOrUndefined.optional(), | ||
sortOrder: SortOrderOrUndefined.optional(), | ||
}); | ||
|
||
export type GetLiveQueryResultsRequestParams = z.infer<typeof GetLiveQueryResultsRequestParams>; | ||
export const GetLiveQueryResultsRequestParams = z.object({ | ||
id: Id.optional(), | ||
actionId: Id.optional(), | ||
}); | ||
|
||
export type SuccessResponse = z.infer<typeof SuccessResponse>; | ||
export const SuccessResponse = z.object({}); |
Oops, something went wrong.