Skip to content
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

Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-security #202748

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7e1e0a6
Relocating module `@kbn/crypto`
gsoldevila Dec 5, 2024
dd21e05
Relocating module `@kbn/encrypted-saved-objects-plugin`
gsoldevila Dec 5, 2024
1eb9428
Relocating module `@kbn/handlebars`
gsoldevila Dec 5, 2024
20c392d
Relocating module `@kbn/interactive-setup-plugin`
gsoldevila Dec 5, 2024
683f04c
Relocating module `@kbn/safer-lodash-set`
gsoldevila Dec 5, 2024
16a7d6b
Relocating module `@kbn/security-api-key-management`
gsoldevila Dec 5, 2024
9aba395
Relocating module `@kbn/security-authorization-core`
gsoldevila Dec 5, 2024
1a8b483
Relocating module `@kbn/security-authorization-core-common`
gsoldevila Dec 5, 2024
fc69a22
Relocating module `@kbn/security-form-components`
gsoldevila Dec 5, 2024
5e84f7a
Relocating module `@kbn/security-hardening`
gsoldevila Dec 5, 2024
39c2a72
Relocating module `@kbn/security-plugin`
gsoldevila Dec 5, 2024
068f2e1
Relocating module `@kbn/security-plugin-types-common`
gsoldevila Dec 5, 2024
51333f9
Relocating module `@kbn/security-plugin-types-public`
gsoldevila Dec 5, 2024
b397ad2
Relocating module `@kbn/security-plugin-types-server`
gsoldevila Dec 5, 2024
01c62b0
Relocating module `@kbn/security-role-management-model`
gsoldevila Dec 5, 2024
49d9bb8
Relocating module `@kbn/security-ui-components`
gsoldevila Dec 5, 2024
f1c2a73
Relocating module `@kbn/spaces-plugin`
gsoldevila Dec 5, 2024
33582ae
Relocating module `@kbn/user-profile-components`
gsoldevila Dec 5, 2024
9312f57
[CI] Auto-commit changed files from 'node scripts/telemetry_check'
kibanamachine Dec 5, 2024
7d6fd74
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Dec 5, 2024
e0fa7e9
Fixes i18n paths
jeramysoucy Dec 6, 2024
db38b3d
Fixes path in kbn safer lodash set package file
jeramysoucy Dec 6, 2024
d66abdc
Fix references to kbn-handlebars
gsoldevila Dec 7, 2024
98bb09a
Merge branch 'main' into kbn-team-1309-move-kibana-security
gsoldevila Dec 9, 2024
ffccb7f
Fixes commit-specific links, removes old comment
jeramysoucy Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 9 additions & 9 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
if (
(await doAnyChangesMatch([
/^packages\/kbn-securitysolution-.*/,
/^x-pack\/plugins\/security_solution/,
/^x-pack\/platform\/plugins\/shared\/security_solution/,
/^x-pack\/test\/defend_workflows_cypress/,
/^x-pack\/test\/security_solution_cypress/,
/^fleet_packages\.json/,
Expand All @@ -244,9 +244,9 @@ const getPipeline = (filename: string, removeSteps = true) => {
/^x-pack\/plugins\/data_views\/common/,
/^x-pack\/plugins\/lists/,
/^x-pack\/plugins\/rule_registry\/common/,
/^x-pack\/plugins\/security_solution/,
/^x-pack\/plugins\/security_solution_ess/,
/^x-pack\/plugins\/security_solution_serverless/,
/^x-pack\/platform\/plugins\/shared\/security_solution/,
/^x-pack\/platform\/plugins\/shared\/security_solution_ess/,
/^x-pack\/platform\/plugins\/shared\/security_solution_serverless/,
/^x-pack\/plugins\/task_manager/,
/^x-pack\/plugins\/timelines/,
/^x-pack\/plugins\/triggers_actions_ui\/public\/application\/sections\/action_connector_form/,
Expand Down Expand Up @@ -327,9 +327,9 @@ const getPipeline = (filename: string, removeSteps = true) => {
/^x-pack\/plugins\/elastic_assistant/,
/^x-pack\/plugins\/lists/,
/^x-pack\/plugins\/rule_registry\/common/,
/^x-pack\/plugins\/security_solution/,
/^x-pack\/plugins\/security_solution_ess/,
/^x-pack\/plugins\/security_solution_serverless/,
/^x-pack\/platform\/plugins\/shared\/security_solution/,
/^x-pack\/platform\/plugins\/shared\/security_solution_ess/,
/^x-pack\/platform\/plugins\/shared\/security_solution_serverless/,
/^x-pack\/plugins\/task_manager/,
/^x-pack\/plugins\/threat_intelligence/,
/^x-pack\/plugins\/timelines/,
Expand All @@ -349,7 +349,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
((await doAnyChangesMatch([
/^x-pack\/plugins\/osquery/,
/^x-pack\/test\/osquery_cypress/,
/^x-pack\/plugins\/security_solution/,
/^x-pack\/platform\/plugins\/shared\/security_solution/,
])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')) &&
!GITHUB_PR_LABELS.includes('ci:skip-cypress-osquery')
Expand All @@ -363,7 +363,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
(await doAnyChangesMatch([
/^x-pack\/packages\/kbn-cloud-security-posture/,
/^x-pack\/plugins\/cloud_security_posture/,
/^x-pack\/plugins\/security_solution/,
/^x-pack\/platform\/plugins\/shared\/security_solution/,
/^x-pack\/test\/security_solution_cypress/,
])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ module.exports = {
'x-pack/platform/plugins/shared/encrypted_saved_objects/**/*.{js,mjs,ts,tsx}',
'x-pack/test/encrypted_saved_objects_api_integration/**/*.{js,mjs,ts,tsx}',

'x-pack/plugins/security/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/plugins/shared/security/**/*.{js,mjs,ts,tsx}',
'x-pack/packages/security/**/*.{js,mjs,ts,tsx}',
'x-pack/test/security_api_integration/**/*.{js,mjs,ts,tsx}',
'x-pack/test/security_functional/**/*.{js,mjs,ts,tsx}',
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ x-pack/platform/packages/private/security/authorization_core_common @elastic/kib
x-pack/platform/packages/shared/security/api_key_management @elastic/kibana-security
x-pack/platform/packages/shared/security/form_components @elastic/kibana-security
x-pack/platform/plugins/shared/encrypted_saved_objects @elastic/kibana-security
x-pack/platform/plugins/shared/security @elastic/kibana-security
x-pack/plugins/actions @elastic/response-ops
x-pack/plugins/ai_infra/llm_tasks @elastic/appex-ai-infra
x-pack/plugins/ai_infra/product_doc_base @elastic/appex-ai-infra
Expand Down Expand Up @@ -971,7 +972,6 @@ x-pack/plugins/search_notebooks @elastic/search-kibana
x-pack/plugins/search_playground @elastic/search-kibana
x-pack/plugins/search_solution/search_navigation @elastic/search-kibana
x-pack/plugins/searchprofiler @elastic/kibana-management
x-pack/plugins/security @elastic/kibana-security
x-pack/plugins/security_solution @elastic/security-solution
x-pack/plugins/security_solution_ess @elastic/security-solution
x-pack/plugins/security_solution_serverless @elastic/security-solution
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ detailed information on how Elasticsearch executed the search request. People us
to understand why a search request might be slow.


|{kib-repo}blob/{branch}/x-pack/plugins/security/README.md[security]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/security/README.md[security]
|See Configuring security in
Kibana.

Expand Down
2 changes: 1 addition & 1 deletion legacy_rfcs/text/0007_lifecycle_unblocked.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ functions and will be impacted:
6. [code](https://github.com/elastic/kibana/blob/5049b460b47d4ae3432e1d9219263bb4be441392/x-pack/legacy/plugins/code/server/plugin.ts#L129-L149)
7. [spaces](https://github.com/elastic/kibana/blob/096c7ee51136327f778845c636d7c4f1188e5db2/x-pack/legacy/plugins/spaces/server/new_platform/plugin.ts#L95)
8. [licensing](https://github.com/elastic/kibana/blob/4667c46caef26f8f47714504879197708debae32/x-pack/plugins/licensing/server/plugin.ts)
9. [security](https://github.com/elastic/kibana/blob/0f2324e44566ce2cf083d89082841e57d2db6ef6/x-pack/plugins/security/server/plugin.ts#L96)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to update these old legacy RFCs

9. [security](https://github.com/elastic/kibana/blob/0f2324e44566ce2cf083d89082841e57d2db6ef6/x-pack/platform/plugins/shared/security/server/plugin.ts#L96)

# How we teach this

Expand Down
2 changes: 1 addition & 1 deletion legacy_rfcs/text/0016_ols_phase_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export interface SavedObject<T = unknown> {

### 3.1.3 Saved Objects Client: Security wrapper

The [security wrapper](https://github.com/elastic/kibana/blob/701697cc4a34d07c0508c3bdf01dca6f9d40a636/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts) authorizes and audits operations against saved objects.
The [security wrapper](https://github.com/elastic/kibana/blob/701697cc4a34d07c0508c3bdf01dca6f9d40a636/x-pack/platform/plugins/shared/security/server/saved_objects/secure_saved_objects_client_wrapper.ts) authorizes and audits operations against saved objects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SO wrapper no longer exists (was replaced with the extension a long while back), and IMO we don't need to update any of these legacy RFC docs.


There are two primary changes to this wrapper:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
"@kbn/security-authorization-core-common": "link:x-pack/platform/packages/private/security/authorization_core_common",
"@kbn/security-form-components": "link:x-pack/platform/packages/shared/security/form_components",
"@kbn/security-hardening": "link:src/platform/packages/shared/kbn-security-hardening",
"@kbn/security-plugin": "link:x-pack/plugins/security",
"@kbn/security-plugin": "link:x-pack/platform/plugins/shared/security",
"@kbn/security-plugin-types-common": "link:x-pack/packages/security/plugin_types_common",
"@kbn/security-plugin-types-public": "link:x-pack/packages/security/plugin_types_public",
"@kbn/security-plugin-types-server": "link:x-pack/packages/security/plugin_types_server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface AuditLogger {
* current user, space and correlation id.
*
* Guidelines around what events should be logged and how they should be
* structured can be found in: `/x-pack/plugins/security/README.md`
* structured can be found in: `/x-pack/platform/plugins/shared/security/README.md`
*
* @example
* ```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as groupBy from '../../lib/group_by_owners.ts';
import * as groupBySource from '../../lib/group_by_source.ts';

const codeOwners: Record<string, string[]> = {
'plugins/security': ['team_security'],
'platform/plugins/shared/security': ['team_security'],
'plugins/data_visualization': ['team_visualization'],
'plugins/data_charts': ['team_visualization'],
'plugins/analytics': ['team_analytics'],
Expand All @@ -39,7 +39,7 @@ const mockCruiseResult = {
summary: {
violations: [
{
from: 'plugins/security',
from: 'platform/plugins/shared/security',
to: 'node_modules/rxjs',
},
{
Expand All @@ -64,7 +64,7 @@ const mockCruiseResult = {
{
source: 'node_modules/rxjs',
dependents: [
'plugins/security/server/index.ts',
'platform/plugins/shared/security/server/index.ts',
'plugins/data_charts/public/charts.ts',
'plugins/data_visualization/public/visualization.ts',
'plugins/data_visualization/public/ingest.ts',
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('identifyDependencyUsage', () => {

expect(result).toEqual({
team_security: {
modules: ['plugins/security'],
modules: ['platform/plugins/shared/security'],
deps: ['rxjs'],
teams: ['team_security'],
},
Expand Down Expand Up @@ -161,7 +161,7 @@ describe('identifyDependencyUsage', () => {
expect(groupFilesByOwnersSpy).toHaveBeenCalledWith(mockCruiseResult.output.summary.violations);

expect(result).toEqual({
'plugins/security': ['rxjs'],
'platform/plugins/shared/security': ['rxjs'],
'plugins/data_visualization': ['rxjs'],
'plugins/data_charts': ['rxjs'],
'plugins/analytics': ['rxjs', '@hapi/boom'],
Expand All @@ -179,14 +179,14 @@ describe('identifyDependencyUsage', () => {

expect(result).toEqual({
modules: [
'plugins/security',
'platform/plugins/shared/security',
'plugins/data_visualization',
'plugins/data_charts',
'plugins/analytics',
],
dependents: {
rxjs: [
'plugins/security/server/index.ts',
'platform/plugins/shared/security/server/index.ts',
'plugins/data_charts/public/charts.ts',
'plugins/data_visualization/public/visualization.ts',
'plugins/data_visualization/public/ingest.ts',
Expand All @@ -207,7 +207,7 @@ describe('identifyDependencyUsage', () => {

expect(result).toEqual({
modules: [
'plugins/security',
'platform/plugins/shared/security',
'plugins/data_visualization',
'plugins/data_charts',
'plugins/analytics',
Expand Down Expand Up @@ -266,7 +266,7 @@ describe('identifyDependencyUsage', () => {
summary: {
violations: [
{ from: 'plugins/unknown_plugin', to: 'node_modules/some_module' },
{ from: 'plugins/security', to: 'node_modules/rxjs' },
{ from: 'platform/plugins/shared/security', to: 'node_modules/rxjs' },
],
},
modules: [],
Expand All @@ -288,7 +288,7 @@ describe('identifyDependencyUsage', () => {
teams: ['unknown'],
},
team_security: {
modules: ['plugins/security'],
modules: ['platform/plugins/shared/security'],
deps: ['rxjs'],
teams: ['team_security'],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-user-profile-components/src/user_profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { UserProfileAvatarData, UserProfileData } from './types';
* IMPORTANT:
*
* The types in this file have been imported from
* `x-pack/plugins/security/common/model/user_profile.ts`
* `x-pack/platform/plugins/shared/security/common/model/user_profile.ts`
*
* When making changes please ensure to keep both files in sync.
*/
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,8 @@
"@kbn/security-form-components/*": ["x-pack/platform/packages/shared/security/form_components/*"],
"@kbn/security-hardening": ["src/platform/packages/shared/kbn-security-hardening"],
"@kbn/security-hardening/*": ["src/platform/packages/shared/kbn-security-hardening/*"],
"@kbn/security-plugin": ["x-pack/plugins/security"],
"@kbn/security-plugin/*": ["x-pack/plugins/security/*"],
"@kbn/security-plugin": ["x-pack/platform/plugins/shared/security"],
"@kbn/security-plugin/*": ["x-pack/platform/plugins/shared/security/*"],
"@kbn/security-plugin-types-common": ["x-pack/packages/security/plugin_types_common"],
"@kbn/security-plugin-types-common/*": ["x-pack/packages/security/plugin_types_common/*"],
"@kbn/security-plugin-types-public": ["x-pack/packages/security/plugin_types_public"],
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"xpack.searchAssistant": "plugins/search_assistant",
"xpack.searchProfiler": "plugins/searchprofiler",
"xpack.security": [
"plugins/security",
"platform/plugins/shared/security",
"packages/security"
],
"xpack.server": "legacy/server",
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is off here - the source and destination do not match. There is a jest.config.js file in the new x-pack/platform/packages/private/security/role_management_model folder, which looks like a new added file. It should have been moved and adjusted from the old location.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/plugins/security'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/security'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/security',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security/{common,public,server}/**/*.{ts,tsx}'],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/security/{common,public,server}/**/*.{ts,tsx}'],
};
Loading