-
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] Misconfiguration preview & Refactor CSP Plugin to in…
…clude new package PHASE 3 (#191317) The previous #190105 was way too big and made it hard to review without missing any bugs or potential bugs, Thus we decided we are going to make series of smaller PR to make things more manageable We will be splitting it into 4 PR Phase 1: Creating empty packages for csp and csp-common Phase 2: Move Types from CSP plugin to the Package + Deleting duplicates in the CSP plugin where possible Phase 3: Move Functions, Utils or Helpers, Hooks to Package Phase 4: Misconfiguration Preview feature (with Cypress test and other required test) This is **Phase 3** of the Process, This also includes moving rule versions type This PR is the continuation of this PR #190933 NOTE: Merge phase 2 first before this --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
6bb38c8
commit a78c69b
Showing
89 changed files
with
471 additions
and
270 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
12 changes: 12 additions & 0 deletions
12
x-pack/packages/kbn-cloud-security-posture-common/jest.config.js
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,12 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test', | ||
rootDir: '../../..', | ||
roots: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture-common'], | ||
}; |
48 changes: 0 additions & 48 deletions
48
x-pack/packages/kbn-cloud-security-posture-common/schema/rules.ts
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
x-pack/packages/kbn-cloud-security-posture-common/schema/rules/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,12 @@ | ||
/* | ||
* 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 './v1'; | ||
export * as rulesV2 from './v2'; | ||
export * as rulesV3 from './v3'; | ||
export * as rulesV4 from './v4'; | ||
export * as rulesV5 from './v5'; |
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
File renamed without changes.
File renamed without changes.
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
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 |
---|---|---|
|
@@ -16,5 +16,7 @@ | |
], | ||
"kbn_references": [ | ||
"@kbn/config-schema", | ||
"@kbn/data-views-plugin", | ||
"@kbn/i18n", | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.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,7 @@ | ||
/* | ||
* 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 type BenchmarksCisId = 'cis_k8s' | 'cis_azure' | 'cis_aws' | 'cis_eks' | 'cis_gcp'; |
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
51 changes: 51 additions & 0 deletions
51
x-pack/packages/kbn-cloud-security-posture-common/types/status.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,51 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* 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 type CspStatusCode = | ||
| 'indexed' // latest findings index exists and has results | ||
| 'indexing' // index timeout was not surpassed since installation, assumes data is being indexed | ||
| 'unprivileged' // user lacks privileges for the latest findings index | ||
| 'index-timeout' // index timeout was surpassed since installation | ||
| 'not-deployed' // no healthy agents were deployed | ||
| 'not-installed' // number of installed csp integrations is 0; | ||
| 'waiting_for_results'; // have healthy agents but no findings at all, assumes data is being indexed for the 1st time | ||
|
||
export type IndexStatus = | ||
| 'not-empty' // Index contains documents | ||
| 'empty' // Index doesn't contain documents (or doesn't exist) | ||
| 'unprivileged'; // User doesn't have access to query the index | ||
|
||
export interface IndexDetails { | ||
index: string; | ||
status: IndexStatus; | ||
} | ||
|
||
export interface BaseCspSetupBothPolicy { | ||
status: CspStatusCode; | ||
installedPackagePolicies: number; | ||
healthyAgents: number; | ||
} | ||
|
||
export interface BaseCspSetupStatus { | ||
indicesDetails: IndexDetails[]; | ||
latestPackageVersion: string; | ||
cspm: BaseCspSetupBothPolicy; | ||
kspm: BaseCspSetupBothPolicy; | ||
vuln_mgmt: BaseCspSetupBothPolicy; | ||
isPluginInitialized: boolean; | ||
installedPackageVersion?: string | undefined; | ||
hasMisconfigurationsFindings?: boolean; | ||
} | ||
|
||
export type CspSetupStatus = BaseCspSetupStatus; |
Oops, something went wrong.