Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
5487e4c
[Read only dashboards] Store Saved object access control information …
SiddharthMantri Jun 19, 2025
b7becf2
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jun 19, 2025
99ebf49
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jun 20, 2025
8191c69
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jun 25, 2025
891ed82
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jun 26, 2025
429cee9
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jun 28, 2025
1a7c2d4
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jul 2, 2025
eb35121
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jul 10, 2025
05c241b
[Read only dashboards] Root level mapping for access control (#224837)
SiddharthMantri Jul 11, 2025
fb6c677
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jul 11, 2025
c66ccfb
Merge branch 'main' into security/read-only-dashboards
SiddharthMantri Jul 22, 2025
e9f97f5
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jul 22, 2025
c6f097e
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jul 24, 2025
0e14847
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jul 29, 2025
c42a477
Merge branch 'main' into security/read-only-dashboards
elasticmachine Jul 30, 2025
57a598b
Merge branch 'main' into security/read-only-dashboards
elasticmachine Aug 5, 2025
840e1b1
Merge branch 'main' into security/read-only-dashboards
elasticmachine Aug 8, 2025
7f34d44
Merge branch 'main' into security/read-only-dashboards
elasticmachine Aug 9, 2025
0e929a0
Merge branch 'main' into security/read-only-dashboards
elasticmachine Sep 1, 2025
810db4c
Merge branch 'main' into security/read-only-dashboards
elasticmachine Sep 2, 2025
e1c2679
Merge branch 'main' into security/read-only-dashboards
elasticmachine Sep 9, 2025
ea9f909
Merge branch 'main' into security/read-only-dashboards
elasticmachine Sep 12, 2025
1f188d0
Merge branch 'main' into security/read-only-dashboards
elasticmachine Sep 24, 2025
570c09d
Implements access control config feature flag (#235659)
jeramysoucy Sep 26, 2025
9744f08
Merge branch 'main' into security/read-only-dashboards
SiddharthMantri Sep 26, 2025
07c267f
Merge branch 'main' into security/read-only-dashboards
elasticmachine Oct 3, 2025
3bacb47
Merge branch 'main' into security/read-only-dashboards
elasticmachine Oct 7, 2025
27c9862
[Write restricted SOs] Allow creation, update, delete and transfer ow…
SiddharthMantri Oct 21, 2025
48765b8
Merge branch 'main' into security/read-only-dashboards
elasticmachine Oct 22, 2025
4d914e0
[Write restricted dashboards] Change AccessMode const (#239973)
SiddharthMantri Oct 23, 2025
7d0d88b
Merge branch 'main' into security/read-only-dashboards
SiddharthMantri Oct 28, 2025
65e673c
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Oct 28, 2025
e70f103
Merge branch 'main' into security/read-only-dashboards
SiddharthMantri Oct 28, 2025
b0f4c52
Merge branch 'main' into security/read-only-dashboards
elasticmachine Oct 28, 2025
a13cfa2
Merge branch 'main' into security/read-only-dashboards
elasticmachine Oct 29, 2025
3c5c01b
[Write restricted dashboards] Audit events (#241101)
SiddharthMantri Oct 29, 2025
52c7e97
[Write restricted dashboards] Implements object-granular processing i…
jeramysoucy Oct 30, 2025
c149cbf
Merge branch 'main' into security/read-only-dashboards
SiddharthMantri Oct 30, 2025
f1079bf
fix types
SiddharthMantri Oct 31, 2025
98587d4
Merge branch 'main' into security/read-only-dashboards
elasticmachine Nov 4, 2025
a997718
Merge branch 'main' into security/read-only-dashboards
elasticmachine Nov 7, 2025
71eabdd
Merge branch 'main' into security/read-only-dashboards
elasticmachine Nov 13, 2025
64b6801
[Dashboards] Write-restricted dashboards UI (#233552)
kowalczyk-krzysztof Nov 13, 2025
36f72b7
Merge branch 'main' into security/read-only-dashboards
elasticmachine Nov 13, 2025
5dcce41
Merge branch 'main' into security/read-only-dashboards
elasticmachine Nov 14, 2025
a74e038
[Write restricted dashboards] Implements import and export changes (#…
jeramysoucy Nov 17, 2025
bdcb248
Post-testing changes and fixes
kowalczyk-krzysztof Nov 24, 2025
754b0c6
[Write-restricted dashboards] Implements feature flag disabled test s…
jeramysoucy Nov 25, 2025
7d706ba
Merge remote-tracking branch 'upstream/main' into security/read-only-…
jeramysoucy Nov 25, 2025
044cae3
Merge branch 'main' into security/read-only-dashboards
jeramysoucy Nov 25, 2025
e990623
Changes from node scripts/lint_ts_projects --fix
kibanamachine Nov 25, 2025
63e22d5
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Nov 25, 2025
85ec194
Merge branch 'main' into security/read-only-dashboards
elasticmachine Nov 26, 2025
e8a0942
Updates change access control logic and tests
jeramysoucy Nov 26, 2025
77089c8
Updates APIs with access control meta
jeramysoucy Nov 26, 2025
177c1d5
Move editor flyout button to the right
kowalczyk-krzysztof Nov 27, 2025
6424058
Fix create dashboard
kowalczyk-krzysztof Nov 27, 2025
dda569d
Merge branch 'main' into security/read-only-dashboards
elasticmachine Nov 28, 2025
a9de73d
remove outdated tests
SiddharthMantri Nov 28, 2025
2830f70
Change accessControl to snake_case (#244830)
kowalczyk-krzysztof Dec 2, 2025
bf2e2a8
[Write-restricted dashboards] Add 'NEW' badge to access mode containe…
kowalczyk-krzysztof Dec 2, 2025
e3d1191
Move access_control to data (#244974)
kowalczyk-krzysztof Dec 2, 2025
399cb59
Merge branch 'main' into security/read-only-dashboards
kowalczyk-krzysztof Dec 2, 2025
c4700e8
Fix updateendpoint
kowalczyk-krzysztof Dec 2, 2025
9efa041
Merge branch 'main' into security/read-only-dashboards
kowalczyk-krzysztof Dec 3, 2025
09e3e28
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 3, 2025
ff76727
Merge branch 'main' into security/read-only-dashboards
kowalczyk-krzysztof Dec 4, 2025
4edea69
Fix types after resolving merge conflicts
kowalczyk-krzysztof Dec 5, 2025
19b52f7
[Write restricted dashboards] Correctly handle access control when se…
SiddharthMantri Dec 5, 2025
2866b6d
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 5, 2025
576f6fb
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 9, 2025
107ce6a
Merge branch 'main' into security/read-only-dashboards
SiddharthMantri Dec 10, 2025
99447a0
Do not expose accessControl setter and getter in the type registry in…
gsoldevila Dec 10, 2025
47516ec
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 11, 2025
e44ddaa
[Scout] Automated config manifest updates
kibanamachine Dec 11, 2025
04fe65e
fix CI type error
SiddharthMantri Dec 11, 2025
fd869ec
Merge branch 'main' into security/read-only-dashboards
SiddharthMantri Dec 11, 2025
129d110
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 11, 2025
a600049
Fix conflict post merge
SiddharthMantri Dec 11, 2025
b48a09a
Update standard.json
SiddharthMantri Dec 11, 2025
caf627d
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 11, 2025
cb56c02
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 11, 2025
ba9f0b3
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 12, 2025
20f9db0
Merge branch 'main' into security/read-only-dashboards
elasticmachine Dec 12, 2025
4465fe7
create `ISavedObjectTypeRegistryInternal` interface
gsoldevila Dec 12, 2025
e56b25a
fix types
SiddharthMantri Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buildkite/ftr_platform_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ enabled:
- x-pack/platform/test/spaces_api_integration/security_and_spaces/config_basic.ts
- x-pack/platform/test/spaces_api_integration/security_and_spaces/config_trial.ts
- x-pack/platform/test/spaces_api_integration/spaces_only/config.ts
- x-pack/platform/test/spaces_api_integration/access_control_objects/config.ts
- x-pack/platform/test/spaces_api_integration/access_control_objects/feature_disabled.config.ts
- x-pack/platform/test/task_manager_claimer_update_by_query/config.ts
- x-pack/platform/test/ui_capabilities/security_and_spaces/config.ts
- x-pack/platform/test/ui_capabilities/spaces_only/config.ts
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ src/platform/packages/private/shared-ux/storybook/config @elastic/appex-sharedux
src/platform/packages/shared/chart-expressions-common @elastic/kibana-visualizations
src/platform/packages/shared/chart-test-jest-helpers @elastic/kibana-visualizations
src/platform/packages/shared/cloud @elastic/kibana-core
src/platform/packages/shared/content-management/access_control/access_control_public @elastic/appex-sharedux
src/platform/packages/shared/content-management/access_control/access_control_server @elastic/appex-sharedux
src/platform/packages/shared/content-management/content_editor @elastic/appex-sharedux
src/platform/packages/shared/content-management/content_insights/content_insights_public @elastic/appex-sharedux
src/platform/packages/shared/content-management/content_insights/content_insights_server @elastic/appex-sharedux
Expand Down Expand Up @@ -1126,6 +1128,7 @@ x-pack/platform/test/security_api_integration/plugins/oidc_provider @elastic/kib
x-pack/platform/test/security_api_integration/plugins/saml_provider @elastic/kibana-security
x-pack/platform/test/security_api_integration/plugins/user_profiles_consumer @elastic/kibana-security
x-pack/platform/test/security_functional/plugins/test_endpoints @elastic/kibana-security
x-pack/platform/test/spaces_api_integration/common/plugins/access_control_test_plugin @elastic/kibana-security
x-pack/platform/test/spaces_api_integration/common/plugins/spaces_test_plugin @elastic/kibana-security
x-pack/platform/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget @elastic/response-ops
x-pack/platform/test/ui_capabilities/common/plugins/foo_plugin @elastic/kibana-security
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
"@hapi/wreck": "^18.1.0",
"@hello-pangea/dnd": "18.0.1",
"@kbn/aad-fixtures-plugin": "link:x-pack/platform/test/alerting_api_integration/common/plugins/aad",
"@kbn/access-control-test-plugin": "link:x-pack/platform/test/spaces_api_integration/common/plugins/access_control_test_plugin",
"@kbn/actions-plugin": "link:x-pack/platform/plugins/shared/actions",
"@kbn/actions-simulators-plugin": "link:x-pack/platform/test/alerting_api_integration/common/plugins/actions_simulators",
"@kbn/actions-types": "link:src/platform/packages/shared/kbn-actions-types",
Expand Down Expand Up @@ -261,6 +262,8 @@
"@kbn/connector-specs": "link:src/platform/packages/shared/kbn-connector-specs",
"@kbn/console-plugin": "link:src/platform/plugins/shared/console",
"@kbn/content-connectors-plugin": "link:x-pack/platform/plugins/shared/content_connectors",
"@kbn/content-management-access-control-public": "link:src/platform/packages/shared/content-management/access_control/access_control_public",
"@kbn/content-management-access-control-server": "link:src/platform/packages/shared/content-management/access_control/access_control_server",
"@kbn/content-management-content-editor": "link:src/platform/packages/shared/content-management/content_editor",
"@kbn/content-management-content-insights-public": "link:src/platform/packages/shared/content-management/content_insights/content_insights_public",
"@kbn/content-management-content-insights-server": "link:src/platform/packages/shared/content-management/content_insights/content_insights_server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ export function createPluginSetupContext<TPlugin, TPluginDependencies>({
setEncryptionExtension: deps.savedObjects.setEncryptionExtension,
setSecurityExtension: deps.savedObjects.setSecurityExtension,
setSpacesExtension: deps.savedObjects.setSpacesExtension,
setAccessControlTransforms: deps.savedObjects.setAccessControlTransforms,
registerType: deps.savedObjects.registerType,
getDefaultIndex: deps.savedObjects.getDefaultIndex,
isAccessControlEnabled: deps.savedObjects.isAccessControlEnabled,
},
status: {
core$: deps.status.core$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import {

import type { Payload } from '@hapi/boom';

import type { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server';
import type {
SavedObjectAccessControl,
SavedObjectsBulkCreateObject,
} from '@kbn/core-saved-objects-api-server';
import {
type SavedObjectsRawDoc,
type SavedObjectUnsanitizedDoc,
Expand Down Expand Up @@ -58,6 +61,7 @@ import {
} from '../../test_helpers/repository.test.common';
import type { ISavedObjectsSecurityExtension } from '@kbn/core-saved-objects-server';
import { savedObjectsExtensionsMock } from '../../mocks/saved_objects_extensions.mock';
import type { AuthenticatedUser } from '@kbn/core-security-common';

// so any breaking changes to this repository are considered breaking changes to the SavedObjectsClient.

Expand Down Expand Up @@ -1086,6 +1090,266 @@ describe('#bulkCreate', () => {
})
);
});

describe('access control', () => {
const CURRENT_USER_PROFILE_ID = 'current_user_profile_id';
const ACCESS_CONTROL_TYPE = 'access-control-type';

beforeEach(() => {
securityExtension.getCurrentUser.mockReturnValue({
authentication_realm: {
name: 'authentication_realm',
type: 'authentication_realm_type',
},
lookup_realm: {
name: 'lookup_realm',
type: 'lookup_realm_type',
},
authentication_provider: {
name: 'authentication_provider',
type: 'authentication_provider_type',
},
authentication_type: 'realm',
elastic_cloud_user: false,
profile_uid: CURRENT_USER_PROFILE_ID,
} as AuthenticatedUser);
});

registry.registerType({
name: ACCESS_CONTROL_TYPE,
hidden: false,
namespaceType: 'multiple-isolated',
supportsAccessControl: true,
mappings: {
dynamic: false,
properties: {
description: { type: 'text' },
},
},
management: {
importableAndExportable: true,
},
});

afterEach(() => {
securityExtension.getCurrentUser.mockClear();
});

it('applies access control options only to applicable types when using global access control options', async () => {
const obj1NoAccessControl = {
type: 'config',
id: '6.0.0-alpha1',
attributes: { title: 'Test One' },
references: [{ name: 'ref_0', type: 'test', id: '1' }],
};
const obj2AccessControl = {
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
attributes: { title: 'Test Two' },
references: [{ name: 'ref_0', type: 'test', id: '2' }],
};
await bulkCreateSuccess(client, repository, [obj1NoAccessControl, obj2AccessControl], {
accessControl: { accessMode: 'write_restricted' },
});

expect(securityExtension.authorizeBulkCreate).toHaveBeenCalledWith(
expect.objectContaining({
objects: expect.arrayContaining([
{
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
name: 'Test Two',
existingNamespaces: [],
initialNamespace: undefined,
accessControl: {
owner: CURRENT_USER_PROFILE_ID,
accessMode: 'write_restricted',
},
},
]),
})
);
});

it('applies access control options to supporting types when using per object access control options', async () => {
const obj1NoAccessControl = {
type: 'config',
id: '6.0.0-alpha1',
attributes: { title: 'Test One' },
references: [{ name: 'ref_0', type: 'test', id: '1' }],
};
const obj2AccessControl = {
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
attributes: { title: 'Test Two' },
references: [{ name: 'ref_0', type: 'test', id: '2' }],
accessControl: {
accessMode: 'write_restricted',
} as Pick<SavedObjectAccessControl, 'accessMode'>,
};
await bulkCreateSuccess(client, repository, [obj1NoAccessControl, obj2AccessControl]);

expect(securityExtension.authorizeBulkCreate).toHaveBeenCalledWith({
objects: [
{
type: 'config',
id: '6.0.0-alpha1',
name: 'Test One',
existingNamespaces: [],
initialNamespaces: undefined,
},
{
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
name: 'Test Two',
existingNamespaces: [],
initialNamespaces: undefined,
accessControl: {
owner: CURRENT_USER_PROFILE_ID,
accessMode: 'write_restricted',
},
},
],
});
});

it('overrides access control options with incoming object property only for applicable types', async () => {
const obj1NoAccessControl = {
type: 'config',
id: '6.0.0-alpha1',
attributes: { title: 'Test One' },
references: [{ name: 'ref_0', type: 'test', id: '1' }],
accessControl: {
accessMode: 'write_restricted',
} as Pick<SavedObjectAccessControl, 'accessMode'>,
};
const obj2AccessControl = {
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
attributes: { title: 'Test Two' },
references: [{ name: 'ref_0', type: 'test', id: '2' }],
accessControl: {
accessMode: 'default', // default === RBAC-only
} as Pick<SavedObjectAccessControl, 'accessMode'>,
};
const obj3AccessControl = {
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
attributes: { title: 'Test Three' },
references: [{ name: 'ref_0', type: 'test', id: '3' }],
};
const obj4NoAccessControl = {
type: 'config',
id: '6.0.0-alpha4',
attributes: { title: 'Test One' },
references: [{ name: 'ref_0', type: 'test', id: '1' }],
};

await bulkCreateSuccess(
client,
repository,
[obj1NoAccessControl, obj2AccessControl, obj3AccessControl, obj4NoAccessControl],
{
accessControl: { accessMode: 'write_restricted' },
}
);

expect(securityExtension.authorizeBulkCreate).toHaveBeenCalledWith({
objects: [
{
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
name: 'Test Two',
existingNamespaces: [],
initialNamespace: undefined,
accessControl: {
owner: CURRENT_USER_PROFILE_ID,
accessMode: 'default', // explicitly confirm the mode is overriden
},
},
{
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
name: 'Test Three',
existingNamespaces: [],
initialNamespace: undefined,
accessControl: {
owner: CURRENT_USER_PROFILE_ID,
accessMode: 'write_restricted', // explicitly confirm the mode is NOT overriden
},
},
],
});
});

it('does not create objects with access control when there is no active user profile', async () => {
securityExtension.getCurrentUser.mockReturnValueOnce(null);

const obj1NoAccessControl = {
type: 'config',
id: '6.0.0-alpha1',
attributes: { title: 'Test One' },
references: [{ name: 'ref_0', type: 'test', id: '1' }],
accessControl: {
accessMode: 'write_restricted',
} as Pick<SavedObjectAccessControl, 'accessMode'>,
};
const obj2AccessControl = {
type: ACCESS_CONTROL_TYPE,
id: 'has-read-only-metadata',
attributes: { title: 'Test Two' },
references: [{ name: 'ref_0', type: 'test', id: '2' }],
accessControl: {
accessMode: 'write_restricted',
} as Pick<SavedObjectAccessControl, 'accessMode'>,
};
await bulkCreateSuccess(client, repository, [obj1NoAccessControl, obj2AccessControl]);

expect(securityExtension.authorizeBulkCreate).not.toHaveBeenCalled();
});

// regression test
it('creates objects supporting access control with no access control metadata when there is no active user profile and no access mode is provided', async () => {
securityExtension.getCurrentUser.mockReturnValueOnce(null);

const obj1NoAccessControl = {
type: 'config',
id: '6.0.0-alpha1',
attributes: { title: 'Test One' },
references: [{ name: 'ref_0', type: 'test', id: '1' }],
};
const obj2AccessControl = {
type: ACCESS_CONTROL_TYPE,
id: 'could-have-read-only-metadata',
attributes: { title: 'Test Two' },
references: [{ name: 'ref_0', type: 'test', id: '2' }],
};
await bulkCreateSuccess(client, repository, [obj1NoAccessControl, obj2AccessControl]); // no accessControl options

expect(securityExtension.authorizeBulkCreate).toHaveBeenCalledWith(
expect.objectContaining({
objects: [
{
type: 'config',
id: '6.0.0-alpha1',
name: 'Test One',
existingNamespaces: [],
initialNamespace: undefined,
// explicitly confirm there is no accessControl for non-supporting type
},
{
type: ACCESS_CONTROL_TYPE,
id: 'could-have-read-only-metadata',
name: 'Test Two',
existingNamespaces: [],
initialNamespace: undefined,
// explicitly confirm there is no accessControl for supporting type
},
],
})
);
});
});
});
});
});
Loading