-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cloud Security] Versioning CSP rules type and api
- Loading branch information
Showing
114 changed files
with
572 additions
and
500 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
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
47 changes: 0 additions & 47 deletions
47
x-pack/plugins/cloud_security_posture/common/schemas/csp_rule_template.ts
This file was deleted.
Oops, something went wrong.
60 changes: 0 additions & 60 deletions
60
x-pack/plugins/cloud_security_posture/common/schemas/csp_rule_template_metadata.ts
This file was deleted.
Oops, something went wrong.
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
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/cloud_security_posture/common/types/index.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. | ||
*/ | ||
|
||
export * as rulesV1 from './rules/v1'; | ||
export * as rulesV2 from './rules/v2'; | ||
export * as rulesV3 from './rules/v3'; | ||
|
||
// Explicit export of everything from latest | ||
export type { | ||
cspBenchmarkRuleMetadataSchema, | ||
CspBenchmarkRuleMetadata, | ||
CspBenchmarkRule, | ||
FindCspBenchmarkRuleRequest, | ||
FindCspBenchmarkRuleResponse, | ||
} from './latest'; |
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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './rules/v3'; |
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/cloud_security_posture/common/types/rules/v1.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,30 @@ | ||
/* | ||
* 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 { schema, TypeOf } from '@kbn/config-schema'; | ||
|
||
// Since version 8.3.0 | ||
export const cspBenchmarkRuleSchema = schema.object({ | ||
audit: schema.string(), | ||
benchmark: schema.object({ name: schema.string(), version: schema.string() }), | ||
default_value: schema.maybe(schema.string()), | ||
description: schema.string(), | ||
enabled: schema.boolean(), | ||
id: schema.string(), | ||
impact: schema.maybe(schema.string()), | ||
muted: schema.boolean(), | ||
name: schema.string(), | ||
profile_applicability: schema.string(), | ||
rationale: schema.string(), | ||
references: schema.maybe(schema.string()), | ||
rego_rule_id: schema.string(), | ||
remediation: schema.string(), | ||
section: schema.string(), | ||
tags: schema.arrayOf(schema.string()), | ||
version: schema.string(), | ||
}); | ||
|
||
export type CspBenchmarkRule = TypeOf<typeof cspBenchmarkRuleSchema>; |
38 changes: 38 additions & 0 deletions
38
x-pack/plugins/cloud_security_posture/common/types/rules/v2.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,38 @@ | ||
/* | ||
* 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 { schema, TypeOf } from '@kbn/config-schema'; | ||
|
||
// Since version 8.4.0 | ||
export const cspBenchmarkRuleMetadataSchema = schema.object({ | ||
audit: schema.string(), | ||
benchmark: schema.object({ | ||
name: schema.string(), | ||
id: schema.string(), | ||
version: schema.string(), | ||
}), | ||
default_value: schema.maybe(schema.string()), | ||
description: schema.string(), | ||
id: schema.string(), | ||
impact: schema.maybe(schema.string()), | ||
name: schema.string(), | ||
profile_applicability: schema.string(), | ||
rationale: schema.string(), | ||
references: schema.maybe(schema.string()), | ||
rego_rule_id: schema.string(), | ||
remediation: schema.string(), | ||
section: schema.string(), | ||
tags: schema.arrayOf(schema.string()), | ||
version: schema.string(), | ||
}); | ||
|
||
export const cspBenchmarkRuleSchema = schema.object({ | ||
enabled: schema.boolean(), | ||
metadata: cspBenchmarkRuleMetadataSchema, | ||
muted: schema.boolean(), | ||
}); | ||
|
||
export type CspBenchmarkRule = TypeOf<typeof cspBenchmarkRuleSchema>; |
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.