-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Cloud Security] Misconfiguration preview & Refactor CSP Plugin to include new package PHASE 3 #191317
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
Merged
animehart
merged 45 commits into
elastic:main
from
animehart:misconfiguration-preview-refactor-phase-3
Aug 28, 2024
Merged
[Cloud Security] Misconfiguration preview & Refactor CSP Plugin to include new package PHASE 3 #191317
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
f97c940
preliminary adding types to csp and csp-common packages
animehart 5989868
moving types from csp plugin to csp packages + updating import and ex…
animehart 6283bd4
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 7fafa52
attempt on fixing bundle size leak
animehart dad76fd
Merge branch 'misconfiguration-preview-refactor-phase-2' of github.co…
animehart 72f00b0
change schema import to be from schema folder + updating index.ts exp…
animehart 783626e
forgot to add index.ts in last commit
animehart a89617d
removed re export on csp plugin + updated imports to be directly from…
animehart 6600a34
fix ci failure: forgot to edit some file
animehart 19d7451
fix check types failure
animehart 51b44b9
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine e2b8f48
fix failed FTR due to forgot updating imports on that file
animehart 4496119
fix conflict merge
animehart 9f2814e
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 113376a
remove re exports and update imports of csp_finding related types to …
animehart c1a3b6a
Merge branch 'misconfiguration-preview-refactor-phase-2' of github.co…
animehart 3398ecf
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 8c69b3e
fix check types failure + removed re-export and update import stateme…
animehart 0c1f750
Merge branch 'misconfiguration-preview-refactor-phase-2' of github.co…
animehart 447c47b
updating CspStatusCode imports to be directly from csp common package
animehart feae686
Merge branch 'main' into misconfiguration-preview-refactor-phase-2
animehart ceafb0b
PR Comments: Updated type imports to explicitly use import type inste…
animehart 6b8adb6
fix conflict
animehart 02bbdb8
added all Version of Rules into common csp package + updated usage of…
animehart 7cb59d3
removed rules versions from csp plugin + updated imports for rule ve…
animehart c349bac
Reverting and Updating some changes from Phase 2 so now imports for R…
animehart dff574d
fix lint and check types ci failures
animehart 1874c0c
added hooks and functions into csp packages
animehart 5a3aa7d
fix index.ts, quick checks failure
animehart 0fcacb6
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine e96f6d8
updated function imports to be directly for csp packages + deleted or…
animehart 85f8ca5
Merge branch 'misconfiguration-preview-refactor-phase-3' of github.co…
animehart 57dee10
FIX MERGE CONFLICTS
animehart 8925785
fix check types failed, removed useless file
animehart 6343043
Merge branch 'main' into misconfiguration-preview-refactor-phase-3
animehart 3078818
removed a useMisConfigurationPreview hook to make sure that hooks is …
animehart 8bdeb63
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine 050e23d
PR Comments: Addressing PR Comments + Updated Imports for BenchmarksC…
animehart 54bb14c
Merge branch 'misconfiguration-preview-refactor-phase-3' of github.co…
animehart c4127c5
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine f5f3072
missed one PR comment for previous commit, adding it now
animehart e5ae31a
Merge branch 'misconfiguration-preview-refactor-phase-3' of github.co…
animehart b01e87c
PR Comments, removed types file and re added types into types folder
animehart 39ae84b
Merge branch 'main' into misconfiguration-preview-refactor-phase-3
animehart 2395a7d
Merge branch 'main' into misconfiguration-preview-refactor-phase-3
animehart 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
let's either put it under
./types.tsor another way around splittypes.tsinto meaningful files, eg.types/status.tsandtypes/finding.ts