Skip to content

Commit

Permalink
Merge branch 'main' into d/2025-01-27-react18
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jan 29, 2025
2 parents 5061169 + 93f6746 commit c48ef09
Show file tree
Hide file tree
Showing 146 changed files with 3,257 additions and 1,093 deletions.
6 changes: 4 additions & 2 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,7 @@ xpack.index_management.enableProjectLevelRetentionChecks: true

# Experimental Security Solution features

# This feature is disabled in Serverless until fully performance tested within a Serverless environment
xpack.securitySolution.enableExperimental: ['entityStoreDisabled']
# These features are disabled in Serverless until fully tested
xpack.securitySolution.enableExperimental:
- entityStoreDisabled
- siemMigrationsDisabled
61 changes: 2 additions & 59 deletions dev_docs/tutorials/advanced_settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,64 +204,7 @@ To change or remove a `uiSetting`, you must migrate the whole `config` Saved Obj

For example, in 7.9.0, `siem` as renamed to `securitySolution`, and in 8.0.0, `theme:version` was removed:

**src/core/server/ui_settings/saved_objects/migrations.ts**

```ts
import { SavedObjectUnsanitizedDoc, SavedObjectSanitizedDoc } from '@kbn/core/server';

export const migrations = {
'7.9.0': (doc: SavedObjectUnsanitizedDoc<any>): SavedObjectSanitizedDoc<any> => ({
...doc,
...(doc.attributes && {
attributes: Object.keys(doc.attributes).reduce(
(acc, key) =>
key.startsWith('siem:')
? {
...acc,
[key.replace('siem', 'securitySolution')]: doc.attributes[key],
}
: {
...acc,
[key]: doc.attributes[key],
},
{}
),
}),
references: doc.references || [],
}),
'7.12.0': (doc: SavedObjectUnsanitizedDoc<any>): SavedObjectSanitizedDoc<any> => ({...}),
'7.13.0': (doc: SavedObjectUnsanitizedDoc<any>): SavedObjectSanitizedDoc<any> => ({...}),
'8.0.0': (doc: SavedObjectUnsanitizedDoc<any>): SavedObjectSanitizedDoc<any> => ({
...doc,
...(doc.attributes && {
attributes: Object.keys(doc.attributes).reduce(
(acc, key) =>
[
// owner: Team:Geo [1]
'visualization:regionmap:showWarnings',
...
// owner: Team:Core
...
'theme:version',
// owner: Team:AppServices
...
].includes(key)
? {
...acc,
}
: {
...acc,
[key]: doc.attributes[key],
},
{}
),
}),
references: doc.references || [],
}),
'8.1.0': (doc: SavedObjectUnsanitizedDoc<any>): SavedObjectSanitizedDoc<any> => ({...}),
};
```
[1] Since all `uiSettings` migrations are added to the same migration function, while not required, grouping settings by team is good practice.
As of 8.17, the advanced settings migrations are defined in `src/core/packages/ui-settings/server-internal/src/saved_objects/migrations.ts`.

### Creating Transforms

Expand All @@ -271,4 +214,4 @@ first upgraded. Note that you might need to add an extra attribute to verify tha
applied again in the future.

For example, we needed to transform the `defaultIndex` attribute, and we added an extra `isDefaultIndexMigrated` attribute for this purpose.
See `src/core/server/ui_settings/saved_objects/transforms.ts` and [#13339](https://github.com/elastic/kibana/pull/133339) for an example.
Refer to `src/core/packages/ui-settings/server-internal/src/saved_objects/transforms.ts` and [#13339](https://github.com/elastic/kibana/pull/133339) for an example.
74 changes: 74 additions & 0 deletions oas_docs/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -40769,6 +40769,80 @@
]
}
},
"/api/security/role/_query": {
"post": {
"operationId": "post-security-role-query",
"parameters": [
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"filters": {
"additionalProperties": false,
"properties": {
"showReservedRoles": {
"type": "boolean"
}
},
"type": "object"
},
"from": {
"type": "number"
},
"query": {
"type": "string"
},
"size": {
"type": "number"
},
"sort": {
"additionalProperties": false,
"properties": {
"direction": {
"enum": [
"asc",
"desc"
],
"type": "string"
},
"field": {
"type": "string"
}
},
"required": [
"field",
"direction"
],
"type": "object"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Query roles",
"tags": []
}
},
"/api/security/role/{name}": {
"delete": {
"operationId": "delete-security-role-name",
Expand Down
74 changes: 74 additions & 0 deletions oas_docs/bundle.serverless.json
Original file line number Diff line number Diff line change
Expand Up @@ -40769,6 +40769,80 @@
]
}
},
"/api/security/role/_query": {
"post": {
"operationId": "post-security-role-query",
"parameters": [
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"filters": {
"additionalProperties": false,
"properties": {
"showReservedRoles": {
"type": "boolean"
}
},
"type": "object"
},
"from": {
"type": "number"
},
"query": {
"type": "string"
},
"size": {
"type": "number"
},
"sort": {
"additionalProperties": false,
"properties": {
"direction": {
"enum": [
"asc",
"desc"
],
"type": "string"
},
"field": {
"type": "string"
}
},
"required": [
"field",
"direction"
],
"type": "object"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Query roles",
"tags": []
}
},
"/api/security/role/{name}": {
"delete": {
"operationId": "delete-security-role-name",
Expand Down
50 changes: 50 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37827,6 +37827,56 @@ paths:
tags:
- roles
x-beta: true
/api/security/role/_query:
post:
operationId: post-security-role-query
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
schema:
additionalProperties: false
type: object
properties:
filters:
additionalProperties: false
type: object
properties:
showReservedRoles:
type: boolean
from:
type: number
query:
type: string
size:
type: number
sort:
additionalProperties: false
type: object
properties:
direction:
enum:
- asc
- desc
type: string
field:
type: string
required:
- field
- direction
responses:
'200':
description: Indicates a successful call.
summary: Query roles
tags: []
x-beta: true
/api/security/role/{name}:
delete:
operationId: delete-security-role-name
Expand Down
49 changes: 49 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40299,6 +40299,55 @@ paths:
summary: Get all roles
tags:
- roles
/api/security/role/_query:
post:
operationId: post-security-role-query
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
schema:
additionalProperties: false
type: object
properties:
filters:
additionalProperties: false
type: object
properties:
showReservedRoles:
type: boolean
from:
type: number
query:
type: string
size:
type: number
sort:
additionalProperties: false
type: object
properties:
direction:
enum:
- asc
- desc
type: string
field:
type: string
required:
- field
- direction
responses:
'200':
description: Indicates a successful call.
summary: Query roles
tags: []
/api/security/role/{name}:
delete:
operationId: delete-security-role-name
Expand Down
9 changes: 8 additions & 1 deletion packages/kbn-scout/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ export type {
ScoutParallelWorkerFixtures,
} from './src/playwright';

export type { Client, KbnClient, KibanaUrl, SamlSessionManager, ToolingLog } from './src/types';
export type {
EsClient,
KbnClient,
KibanaUrl,
ScoutLogger,
ScoutServerConfig,
ScoutTestConfig,
} from './src/types';
Loading

0 comments on commit c48ef09

Please sign in to comment.