Skip to content

Commit

Permalink
Sustainable Kibana Architecture: Move modules owned by `@elastic/kiba…
Browse files Browse the repository at this point in the history
…na-cloud-security-posture` (elastic#202862)

(cherry picked from commit f508ad2)

# Conflicts:
#	.buildkite/scripts/pipelines/pull_request/pipeline.ts
#	.github/CODEOWNERS
#	x-pack/.i18nrc.json
#	x-pack/plugins/telemetry_collection_xpack/schema/xpack_security.json
  • Loading branch information
gsoldevila committed Dec 17, 2024
1 parent a01347a commit 0bd78d8
Show file tree
Hide file tree
Showing 842 changed files with 811 additions and 1,461 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
if (
(await doAnyChangesMatch([
/^x-pack\/packages\/kbn-cloud-security-posture/,
/^x-pack\/plugins\/cloud_security_posture/,
/^x-pack\/solutions\/security\/plugins\/cloud_security_posture/,
/^x-pack\/solutions\/security\/plugins\/security_solution/,
/^x-pack\/test\/security_solution_cypress/,
])) ||
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ module.exports = {
* Cloud Security Team overrides
*/
{
files: ['x-pack/plugins/cloud_security_posture/**/*.{js,mjs,ts,tsx}'],
files: ['x-pack/solutions/security/plugins/cloud_security_posture/**/*.{js,mjs,ts,tsx}'],
plugins: ['testing-library'],
rules: {
'testing-library/await-async-utils': 'error',
Expand Down
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,6 @@ src/plugins/vis_types/xy @elastic/kibana-visualizations
packages/kbn-visualization-ui-components @elastic/kibana-visualizations
packages/kbn-visualization-utils @elastic/kibana-visualizations
src/plugins/visualizations @elastic/kibana-visualizations
x-pack/platform/plugins/private/watcher @elastic/kibana-management
packages/kbn-web-worker-stub @elastic/kibana-operations
packages/kbn-whereis-pkg-cli @elastic/kibana-operations
packages/kbn-xstate-utils @elastic/obs-ux-logs-team
Expand Down
2 changes: 1 addition & 1 deletion .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ paths-ignore:
- scripts
- test
- x-pack/plugins/canvas/scripts
- x-pack/plugins/cloud_security_posture/common/scripts
- x-pack/solutions/security/plugins/cloud_security_posture/common/scripts
- x-pack/solutions/security/plugins/elastic_assistant/scripts
- x-pack/plugins/event_log/scripts
- x-pack/plugins/fleet/scripts
Expand Down
7 changes: 6 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@
"searchIndexDocuments": "packages/kbn-search-index-documents",
"searchResponseWarnings": "packages/kbn-search-response-warnings",
"searchTypes": "packages/kbn-search-types",
"securitySolutionPackages": "x-pack/solutions/security/packages",
"securitySolutionPackages": [
"x-pack/solutions/security/packages"
],
"sharedPlatformPackages": [
"x-pack/platform/packages/shared/kbn-cloud-security-posture"
],
"serverlessPackages": "packages/serverless",
"sse": ["src/platform/packages/shared/kbn-sse-utils"],
"coloring": "packages/kbn-coloring/src",
Expand Down
10 changes: 5 additions & 5 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ The plugin exposes the static DefaultEditorController class to consume.
|WARNING: Missing README.
|{kib-repo}blob/{branch}/x-pack/plugins/asset_inventory/README.md[assetInventory]
|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/asset_inventory/README.md[assetInventory]
|Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments.
Expand Down Expand Up @@ -499,7 +499,7 @@ It was removed, but the plugin was left behind to register no longer used config
|Static migration page where self-managed users can see text/copy about migrating to Elastic Cloud
|{kib-repo}blob/{branch}/x-pack/plugins/cloud_defend/README.md[cloudDefend]
|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/cloud_defend/README.md[cloudDefend]
|This plugin currently only exists to provide custom fleet policy UX for a set of new BPF LSM features. The first feature being container "drift prevention".
Expand All @@ -516,7 +516,7 @@ This plugin no-longer exposes any evaluation APIs. Refer to <DocLink id="kibFeat
|Adds all the links to the Elastic Cloud console.
|{kib-repo}blob/{branch}/x-pack/plugins/cloud_security_posture/README.md[cloudSecurityPosture]
|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/cloud_security_posture/README.md[cloudSecurityPosture]
|Cloud Posture automates the identification and remediation of risks across cloud infrastructures
Expand Down Expand Up @@ -673,7 +673,7 @@ the infrastructure monitoring use-case within Kibana.
|undefined
|{kib-repo}blob/{branch}/x-pack/plugins/kubernetes_security/README.md[kubernetesSecurity]
|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/kubernetes_security/README.md[kubernetesSecurity]
|This plugin provides interactive visualizations of your Kubernetes workload and session data.
Expand Down Expand Up @@ -890,7 +890,7 @@ This plugin is only enabled when the application is built for serverless project
|This plugin contains configuration and code used to create a Serverless Search project. It leverages universal configuration and other APIs in the serverless plugin to configure Kibana.
|{kib-repo}blob/{branch}/x-pack/plugins/session_view/README.md[sessionView]
|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/session_view/README.md[sessionView]
|Session View is meant to provide a visualization into what is going on in a particular Linux environment where the agent is running. It looks likes a terminal emulator; however, it is a tool for introspecting process activity and understanding user and service behaviour in your Linux servers and infrastructure. It is a time-ordered series of process executions displayed in a tree over time.
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"@kbn/apm-utils": "link:packages/kbn-apm-utils",
"@kbn/app-link-test-plugin": "link:test/plugin_functional/plugins/app_link_test",
"@kbn/application-usage-test-plugin": "link:x-pack/test/usage_collection/plugins/application_usage_test",
"@kbn/asset-inventory-plugin": "link:x-pack/plugins/asset_inventory",
"@kbn/asset-inventory-plugin": "link:x-pack/solutions/security/plugins/asset_inventory",
"@kbn/audit-log-plugin": "link:x-pack/test/security_api_integration/plugins/audit_log",
"@kbn/avc-banner": "link:src/platform/packages/shared/kbn-avc-banner",
"@kbn/banners-plugin": "link:x-pack/plugins/banners",
Expand All @@ -211,16 +211,16 @@
"@kbn/cloud": "link:packages/cloud",
"@kbn/cloud-chat-plugin": "link:x-pack/plugins/cloud_integrations/cloud_chat",
"@kbn/cloud-data-migration-plugin": "link:x-pack/platform/plugins/private/cloud_integrations/cloud_data_migration",
"@kbn/cloud-defend-plugin": "link:x-pack/plugins/cloud_defend",
"@kbn/cloud-defend-plugin": "link:x-pack/solutions/security/plugins/cloud_defend",
"@kbn/cloud-experiments-plugin": "link:x-pack/plugins/cloud_integrations/cloud_experiments",
"@kbn/cloud-full-story-plugin": "link:x-pack/plugins/cloud_integrations/cloud_full_story",
"@kbn/cloud-integration-saml-provider-plugin": "link:x-pack/test/cloud_integration/plugins/saml_provider",
"@kbn/cloud-links-plugin": "link:x-pack/plugins/cloud_integrations/cloud_links",
"@kbn/cloud-plugin": "link:x-pack/plugins/cloud",
"@kbn/cloud-security-posture": "link:x-pack/packages/kbn-cloud-security-posture/public",
"@kbn/cloud-security-posture-common": "link:x-pack/packages/kbn-cloud-security-posture/common",
"@kbn/cloud-security-posture-graph": "link:x-pack/packages/kbn-cloud-security-posture/graph",
"@kbn/cloud-security-posture-plugin": "link:x-pack/plugins/cloud_security_posture",
"@kbn/cloud-security-posture": "link:x-pack/solutions/security/packages/kbn-cloud-security-posture/public",
"@kbn/cloud-security-posture-common": "link:x-pack/platform/packages/shared/kbn-cloud-security-posture/common",
"@kbn/cloud-security-posture-graph": "link:x-pack/solutions/security/packages/kbn-cloud-security-posture/graph",
"@kbn/cloud-security-posture-plugin": "link:x-pack/solutions/security/plugins/cloud_security_posture",
"@kbn/code-editor": "link:packages/shared-ux/code_editor/impl",
"@kbn/code-editor-mock": "link:packages/shared-ux/code_editor/mocks",
"@kbn/coloring": "link:packages/kbn-coloring",
Expand Down Expand Up @@ -605,7 +605,7 @@
"@kbn/kibana-react-plugin": "link:src/plugins/kibana_react",
"@kbn/kibana-usage-collection-plugin": "link:src/plugins/kibana_usage_collection",
"@kbn/kibana-utils-plugin": "link:src/plugins/kibana_utils",
"@kbn/kubernetes-security-plugin": "link:x-pack/plugins/kubernetes_security",
"@kbn/kubernetes-security-plugin": "link:x-pack/solutions/security/plugins/kubernetes_security",
"@kbn/langchain": "link:x-pack/platform/packages/shared/kbn-langchain",
"@kbn/language-documentation": "link:src/platform/packages/private/kbn-language-documentation",
"@kbn/lens-config-builder-example-plugin": "link:x-pack/examples/lens_config_builder_example",
Expand Down Expand Up @@ -870,7 +870,7 @@
"@kbn/serverless-security-settings": "link:src/platform/packages/shared/serverless/settings/security_project",
"@kbn/serverless-types": "link:packages/serverless/types",
"@kbn/session-notifications-plugin": "link:test/plugin_functional/plugins/session_notifications",
"@kbn/session-view-plugin": "link:x-pack/plugins/session_view",
"@kbn/session-view-plugin": "link:x-pack/solutions/security/plugins/session_view",
"@kbn/set-map": "link:packages/kbn-set-map",
"@kbn/share-examples-plugin": "link:examples/share_examples",
"@kbn/share-plugin": "link:src/plugins/share",
Expand Down
4 changes: 2 additions & 2 deletions src/platform/packages/shared/deeplinks/security/deep_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ export enum SecurityPageName {
caseCreate = 'cases_create', // must match `CasesDeepLinkId.casesCreate`
/*
* Warning: Computed values are not permitted in an enum with string valued members
* All cloud security posture page names must match `CloudSecurityPosturePageId` in x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts
* All cloud security posture page names must match `CloudSecurityPosturePageId` in x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/types.ts
*/
cloudSecurityPostureBenchmarks = 'cloud_security_posture-benchmarks',
cloudSecurityPostureDashboard = 'cloud_security_posture-dashboard',
cloudSecurityPostureFindings = 'cloud_security_posture-findings',
cloudSecurityPostureRules = 'cloud_security_posture-rules',
/*
* Warning: Computed values are not permitted in an enum with string valued members
* All cloud defend page names must match `CloudDefendPageId` in x-pack/plugins/cloud_defend/public/common/navigation/types.ts
* All cloud defend page names must match `CloudDefendPageId` in x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/types.ts
*/
cloudDefend = 'cloud_defend',
cloudDefendPolicies = 'cloud_defend-policies',
Expand Down
32 changes: 16 additions & 16 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
"@kbn/app-link-test-plugin/*": ["test/plugin_functional/plugins/app_link_test/*"],
"@kbn/application-usage-test-plugin": ["x-pack/test/usage_collection/plugins/application_usage_test"],
"@kbn/application-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/application_usage_test/*"],
"@kbn/asset-inventory-plugin": ["x-pack/plugins/asset_inventory"],
"@kbn/asset-inventory-plugin/*": ["x-pack/plugins/asset_inventory/*"],
"@kbn/asset-inventory-plugin": ["x-pack/solutions/security/plugins/asset_inventory"],
"@kbn/asset-inventory-plugin/*": ["x-pack/solutions/security/plugins/asset_inventory/*"],
"@kbn/audit-log-plugin": ["x-pack/test/security_api_integration/plugins/audit_log"],
"@kbn/audit-log-plugin/*": ["x-pack/test/security_api_integration/plugins/audit_log/*"],
"@kbn/avc-banner": ["src/platform/packages/shared/kbn-avc-banner"],
Expand Down Expand Up @@ -164,8 +164,8 @@
"@kbn/cloud-chat-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_chat/*"],
"@kbn/cloud-data-migration-plugin": ["x-pack/platform/plugins/private/cloud_integrations/cloud_data_migration"],
"@kbn/cloud-data-migration-plugin/*": ["x-pack/platform/plugins/private/cloud_integrations/cloud_data_migration/*"],
"@kbn/cloud-defend-plugin": ["x-pack/plugins/cloud_defend"],
"@kbn/cloud-defend-plugin/*": ["x-pack/plugins/cloud_defend/*"],
"@kbn/cloud-defend-plugin": ["x-pack/solutions/security/plugins/cloud_defend"],
"@kbn/cloud-defend-plugin/*": ["x-pack/solutions/security/plugins/cloud_defend/*"],
"@kbn/cloud-experiments-plugin": ["x-pack/plugins/cloud_integrations/cloud_experiments"],
"@kbn/cloud-experiments-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_experiments/*"],
"@kbn/cloud-full-story-plugin": ["x-pack/plugins/cloud_integrations/cloud_full_story"],
Expand All @@ -176,14 +176,14 @@
"@kbn/cloud-links-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_links/*"],
"@kbn/cloud-plugin": ["x-pack/plugins/cloud"],
"@kbn/cloud-plugin/*": ["x-pack/plugins/cloud/*"],
"@kbn/cloud-security-posture": ["x-pack/packages/kbn-cloud-security-posture/public"],
"@kbn/cloud-security-posture/*": ["x-pack/packages/kbn-cloud-security-posture/public/*"],
"@kbn/cloud-security-posture-common": ["x-pack/packages/kbn-cloud-security-posture/common"],
"@kbn/cloud-security-posture-common/*": ["x-pack/packages/kbn-cloud-security-posture/common/*"],
"@kbn/cloud-security-posture-graph": ["x-pack/packages/kbn-cloud-security-posture/graph"],
"@kbn/cloud-security-posture-graph/*": ["x-pack/packages/kbn-cloud-security-posture/graph/*"],
"@kbn/cloud-security-posture-plugin": ["x-pack/plugins/cloud_security_posture"],
"@kbn/cloud-security-posture-plugin/*": ["x-pack/plugins/cloud_security_posture/*"],
"@kbn/cloud-security-posture": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/public"],
"@kbn/cloud-security-posture/*": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/public/*"],
"@kbn/cloud-security-posture-common": ["x-pack/platform/packages/shared/kbn-cloud-security-posture/common"],
"@kbn/cloud-security-posture-common/*": ["x-pack/platform/packages/shared/kbn-cloud-security-posture/common/*"],
"@kbn/cloud-security-posture-graph": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/graph"],
"@kbn/cloud-security-posture-graph/*": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/*"],
"@kbn/cloud-security-posture-plugin": ["x-pack/solutions/security/plugins/cloud_security_posture"],
"@kbn/cloud-security-posture-plugin/*": ["x-pack/solutions/security/plugins/cloud_security_posture/*"],
"@kbn/code-editor": ["packages/shared-ux/code_editor/impl"],
"@kbn/code-editor/*": ["packages/shared-ux/code_editor/impl/*"],
"@kbn/code-editor-mock": ["packages/shared-ux/code_editor/mocks"],
Expand Down Expand Up @@ -1126,8 +1126,8 @@
"@kbn/kibana-usage-collection-plugin/*": ["src/plugins/kibana_usage_collection/*"],
"@kbn/kibana-utils-plugin": ["src/plugins/kibana_utils"],
"@kbn/kibana-utils-plugin/*": ["src/plugins/kibana_utils/*"],
"@kbn/kubernetes-security-plugin": ["x-pack/plugins/kubernetes_security"],
"@kbn/kubernetes-security-plugin/*": ["x-pack/plugins/kubernetes_security/*"],
"@kbn/kubernetes-security-plugin": ["x-pack/solutions/security/plugins/kubernetes_security"],
"@kbn/kubernetes-security-plugin/*": ["x-pack/solutions/security/plugins/kubernetes_security/*"],
"@kbn/langchain": ["x-pack/platform/packages/shared/kbn-langchain"],
"@kbn/langchain/*": ["x-pack/platform/packages/shared/kbn-langchain/*"],
"@kbn/language-documentation": ["src/platform/packages/private/kbn-language-documentation"],
Expand Down Expand Up @@ -1714,8 +1714,8 @@
"@kbn/serverless-types/*": ["packages/serverless/types/*"],
"@kbn/session-notifications-plugin": ["test/plugin_functional/plugins/session_notifications"],
"@kbn/session-notifications-plugin/*": ["test/plugin_functional/plugins/session_notifications/*"],
"@kbn/session-view-plugin": ["x-pack/plugins/session_view"],
"@kbn/session-view-plugin/*": ["x-pack/plugins/session_view/*"],
"@kbn/session-view-plugin": ["x-pack/solutions/security/plugins/session_view"],
"@kbn/session-view-plugin/*": ["x-pack/solutions/security/plugins/session_view/*"],
"@kbn/set-map": ["packages/kbn-set-map"],
"@kbn/set-map/*": ["packages/kbn-set-map/*"],
"@kbn/share-examples-plugin": ["examples/share_examples"],
Expand Down
8 changes: 4 additions & 4 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"xpack.canvas": "plugins/canvas",
"xpack.cases": "plugins/cases",
"xpack.cloud": "plugins/cloud",
"xpack.cloudDefend": "plugins/cloud_defend",
"xpack.cloudDefend": "solutions/security/plugins/cloud_defend",
"xpack.cloudLinks": "plugins/cloud_integrations/cloud_links",
"xpack.cloudDataMigration": "platform/plugins/private/cloud_integrations/cloud_data_migration",
"xpack.csp": [
"plugins/cloud_security_posture",
"solutions/security/plugins/cloud_security_posture",
"packages/kbn-cloud-security-posture-common",
"packages/kbn-cloud-security-posture"
],
Expand Down Expand Up @@ -70,7 +70,7 @@
"xpack.inventory": "plugins/observability_solution/inventory",
"xpack.investigate": "solutions/observability/plugins/investigate",
"xpack.investigateApp": "solutions/observability/plugins/investigate_app",
"xpack.kubernetesSecurity": "plugins/kubernetes_security",
"xpack.kubernetesSecurity": "solutions/security/plugins/kubernetes_security",
"xpack.lens": "plugins/lens",
"xpack.licenseApiGuard": "platform/plugins/private/license_api_guard",
"xpack.licenseMgmt": "platform/plugins/shared/license_management",
Expand Down Expand Up @@ -149,7 +149,7 @@
"xpack.securitySolution": "solutions/security/plugins/security_solution",
"xpack.securitySolutionEss": "solutions/security/plugins/security_solution_ess",
"xpack.securitySolutionServerless": "solutions/security/plugins/security_solution_serverless",
"xpack.sessionView": "plugins/session_view",
"xpack.sessionView": "solutions/security/plugins/session_view",
"xpack.streams": [
"solutions/observability/plugins/streams_app"
],
Expand Down
9 changes: 0 additions & 9 deletions x-pack/packages/kbn-cloud-security-posture/common/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @kbn/cloud-security-posture-common

This package provides common code consumed in both the browser, i.e. the
`packages/kbn-cloud-security-posture` package and `solutions/security/plugins/cloud_security_posture` plugin, and on the server, i.e. the
`solutions/security/plugins/cloud_security_posture` plugin.

## Maintainers

Maintained by the Cloud Security Team
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture/common'],
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/packages/shared/kbn-cloud-security-posture/common'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ import { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types';
import { i18n } from '@kbn/i18n';
import type { CspBenchmarkRulesStates } from '../schema/rules/latest';

export const defaultErrorMessage = i18n.translate('xpack.csp.common.utils.helpers.unknownError', {
defaultMessage: 'Unknown Error',
});
export const defaultErrorMessage = i18n.translate(
'sharedPlatformPackages.csp.common.utils.helpers.unknownError',
{
defaultMessage: 'Unknown Error',
}
);

export const extractErrorMessage = (e: unknown, fallbackMessage?: string): string => {
if (e instanceof Error) return e.message;
Expand Down
Loading

0 comments on commit 0bd78d8

Please sign in to comment.