Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 0 additions & 10 deletions x-pack/solutions/security/packages/features/privileges.ts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
import { i18n } from '@kbn/i18n';
import type { SubFeatureConfig } from '@kbn/features-plugin/common';
import { EXCEPTION_LIST_NAMESPACE_AGNOSTIC } from '@kbn/securitysolution-list-constants';
import {
ProductFeaturesPrivilegeId,
ProductFeaturesPrivileges,
} from '../../product_features_privileges';

import { SecuritySubFeatureId } from '../../product_features_keys';
import { APP_ID, SECURITY_FEATURE_ID_V3 } from '../../constants';
Expand Down Expand Up @@ -115,6 +111,7 @@ const trustedApplicationsSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-writeTrustedApplications`,
`${APP_ID}-readTrustedApplications`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'trusted_applications_all',
includeIn: 'none',
Expand Down Expand Up @@ -187,6 +184,7 @@ const hostIsolationExceptionsBasicSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-deleteHostIsolationExceptions`,
`${APP_ID}-readHostIsolationExceptions`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'host_isolation_exceptions_all',
includeIn: 'none',
Expand Down Expand Up @@ -256,6 +254,7 @@ const blocklistSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-writeBlocklist`,
`${APP_ID}-readBlocklist`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'blocklist_all',
includeIn: 'none',
Expand Down Expand Up @@ -326,6 +325,7 @@ const eventFiltersSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-writeEventFilters`,
`${APP_ID}-readEventFilters`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'event_filters_all',
includeIn: 'none',
Expand Down Expand Up @@ -713,7 +713,12 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].all,
ui: ['showEndpointExceptions', 'crudEndpointExceptions'],
api: [
`${APP_ID}-showEndpointExceptions`,
`${APP_ID}-crudEndpointExceptions`,
`${APP_ID}-writeGlobalArtifacts`,
],
},
{
replacedBy: [
Expand All @@ -726,7 +731,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].read,
ui: ['showEndpointExceptions'],
api: [`${APP_ID}-showEndpointExceptions`],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
import { i18n } from '@kbn/i18n';
import type { SubFeatureConfig } from '@kbn/features-plugin/common';
import { EXCEPTION_LIST_NAMESPACE_AGNOSTIC } from '@kbn/securitysolution-list-constants';
import {
ProductFeaturesPrivilegeId,
ProductFeaturesPrivileges,
} from '../../product_features_privileges';

import { SecuritySubFeatureId } from '../../product_features_keys';
import { APP_ID, SECURITY_FEATURE_ID_V3 } from '../../constants';
Expand Down Expand Up @@ -130,6 +126,7 @@ const trustedApplicationsSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-writeTrustedApplications`,
`${APP_ID}-readTrustedApplications`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'trusted_applications_all',
includeIn: 'none',
Expand Down Expand Up @@ -202,6 +199,7 @@ const hostIsolationExceptionsBasicSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-deleteHostIsolationExceptions`,
`${APP_ID}-readHostIsolationExceptions`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'host_isolation_exceptions_all',
includeIn: 'none',
Expand Down Expand Up @@ -271,6 +269,7 @@ const blocklistSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-writeBlocklist`,
`${APP_ID}-readBlocklist`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'blocklist_all',
includeIn: 'none',
Expand Down Expand Up @@ -341,6 +340,7 @@ const eventFiltersSubFeature = (): SubFeatureConfig => ({
'lists-summary',
`${APP_ID}-writeEventFilters`,
`${APP_ID}-readEventFilters`,
`${APP_ID}-writeGlobalArtifacts`,
],
id: 'event_filters_all',
includeIn: 'none',
Expand Down Expand Up @@ -781,7 +781,12 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].all,
ui: ['showEndpointExceptions', 'crudEndpointExceptions'],
api: [
`${APP_ID}-showEndpointExceptions`,
`${APP_ID}-crudEndpointExceptions`,
`${APP_ID}-writeGlobalArtifacts`,
],
},
{
replacedBy: [
Expand All @@ -794,7 +799,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].read,
ui: ['showEndpointExceptions'],
api: [`${APP_ID}-showEndpointExceptions`],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
import { i18n } from '@kbn/i18n';
import type { SubFeatureConfig } from '@kbn/features-plugin/common';
import { EXCEPTION_LIST_NAMESPACE_AGNOSTIC } from '@kbn/securitysolution-list-constants';
import {
ProductFeaturesPrivilegeId,
ProductFeaturesPrivileges,
} from '../../product_features_privileges';

import { SecuritySubFeatureId } from '../../product_features_keys';
import { APP_ID } from '../../constants';
Expand Down Expand Up @@ -695,7 +691,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].all,
ui: ['showEndpointExceptions', 'crudEndpointExceptions'],
api: [`${APP_ID}-showEndpointExceptions`, `${APP_ID}-crudEndpointExceptions`],
},
{
id: 'endpoint_exceptions_read',
Expand All @@ -705,7 +702,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].read,
ui: ['showEndpointExceptions'],
api: [`${APP_ID}-showEndpointExceptions`],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ import {
securityDefaultProductFeaturesConfig,
createEnabledProductFeaturesConfigMap,
} from '@kbn/security-solution-features/config';
import {
ProductFeaturesPrivilegeId,
ProductFeaturesPrivileges,
} from '@kbn/security-solution-features/privileges';
import { SECURITY_FEATURE_ID_V3 } from '@kbn/security-solution-features/constants';
import { APP_ID } from '@kbn/security-solution-plugin/common';

export const getSecurityProductFeaturesConfigurator =
(enabledProductFeatureKeys: ProductFeatureKeys) => (): ProductFeaturesSecurityConfig => {
Expand All @@ -46,7 +43,16 @@ const securityProductFeaturesConfig: Record<
> = {
...securityDefaultProductFeaturesConfig,
[ProductFeatureSecurityKey.endpointExceptions]: {
privileges: ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions],
privileges: {
all: {
ui: ['showEndpointExceptions', 'crudEndpointExceptions'],
api: [`${APP_ID}-showEndpointExceptions`, `${APP_ID}-crudEndpointExceptions`],
},
read: {
ui: ['showEndpointExceptions'],
api: [`${APP_ID}-showEndpointExceptions`],
},
},
},

[ProductFeatureSecurityKey.endpointArtifactManagement]: {
Expand Down Expand Up @@ -116,6 +122,12 @@ const securityProductFeaturesConfig: Record<
}
),
},
api: [
...(baseFeatureConfig.privileges.all.api ?? []),

// API access must be also added, as only UI privileges are copied when replacing a deprecated feature
`${APP_ID}-writeGlobalArtifacts`,
],
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
SecuritySubFeatureId,
} from '@kbn/security-solution-features/keys';
import { SECURITY_FEATURE_ID_V3 } from '@kbn/security-solution-features/constants';
import { APP_ID } from '@kbn/security-solution-plugin/common';
import type { ExperimentalFeatures } from '../../common/experimental_features';

export const getSecurityProductFeaturesConfigurator =
Expand Down Expand Up @@ -106,6 +107,13 @@ const securityProductFeaturesConfig: Record<
),
},

api: [
...(baseFeatureConfig.privileges.all.api ?? []),

// API access must be also added, as only UI privileges are copied when replacing a deprecated feature
`${APP_ID}-writeGlobalArtifacts`,
],

// minimal_all is not overwritten, as it does not includes Endpoint Exceptions ALL.
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function endpointAPIIntegrationTests(providerContext: FtrProvider

loadTestFile(require.resolve('./space_awareness'));
loadTestFile(require.resolve('./artifacts'));
loadTestFile(require.resolve('./role_backwards_compatibility'));
loadTestFile(require.resolve('./response_actions'));
});
}
Loading