Skip to content
Closed
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 @@ -66,6 +66,10 @@ export const securityDefaultProductFeaturesConfig: DefaultSecurityProductFeature
},
},

[ProductFeatureSecurityKey.endpointExceptions]: {
subFeatureIds: [SecuritySubFeatureId.endpointExceptions],
},

[ProductFeatureSecurityKey.endpointHostManagement]: {
subFeatureIds: [SecuritySubFeatureId.endpointList],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export interface SecurityFeatureParams {
savedObjects: string[];
}

export type DefaultSecurityProductFeaturesConfig = Omit<
Record<ProductFeatureSecurityKey, ProductFeatureKibanaConfig<SecuritySubFeatureId>>,
ProductFeatureSecurityKey.endpointExceptions
// | add not generic security app features here
export type DefaultSecurityProductFeaturesConfig = Record<
ProductFeatureSecurityKey,
ProductFeatureKibanaConfig<SecuritySubFeatureId>
>;
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ export const getSecurityBaseKibanaFeature = ({
minimal: [
{ feature: TIMELINE_FEATURE_ID, privileges: ['all'] },
{ feature: NOTES_FEATURE_ID, privileges: ['all'] },
{ feature: SECURITY_FEATURE_ID_V2, privileges: ['minimal_all'] },
{
feature: SECURITY_FEATURE_ID_V2,
privileges: ['minimal_all', 'endpoint_exceptions_all'],
},
],
},
app: [APP_ID, CLOUD_POSTURE_APP_ID, CLOUD_DEFEND_APP_ID, 'kibana'],
Expand Down Expand Up @@ -146,7 +149,10 @@ export const getSecurityBaseKibanaFeature = ({
minimal: [
{ feature: TIMELINE_FEATURE_ID, privileges: ['read'] },
{ feature: NOTES_FEATURE_ID, privileges: ['read'] },
{ feature: SECURITY_FEATURE_ID_V2, privileges: ['minimal_read'] },
{
feature: SECURITY_FEATURE_ID_V2,
privileges: ['minimal_read', 'endpoint_exceptions_read'],
},
],
},
app: [APP_ID, CLOUD_POSTURE_APP_ID, CLOUD_DEFEND_APP_ID, 'kibana'],
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_V2 } from '../../constants';
Expand Down Expand Up @@ -645,7 +641,7 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
description: i18n.translate(
'securitySolutionPackages.features.featureRegistry.subFeatures.endpointExceptions.description',
{
defaultMessage: 'Use Endpoint Exceptions (this is a test sub-feature).',
defaultMessage: 'Use Endpoint Exceptions.',
}
),
privilegeGroups: [
Expand All @@ -663,7 +659,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].all,
api: [`${APP_ID}-showEndpointExceptions`, `${APP_ID}-crudEndpointExceptions`],
ui: ['showEndpointExceptions', 'crudEndpointExceptions'],
},
{
replacedBy: [
Expand All @@ -676,7 +673,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].read,
api: [`${APP_ID}-showEndpointExceptions`],
ui: ['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 @@ -665,7 +661,7 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
description: i18n.translate(
'securitySolutionPackages.features.featureRegistry.subFeatures.endpointExceptions.description',
{
defaultMessage: 'Use Endpoint Exceptions (this is a test sub-feature).',
defaultMessage: 'Use Endpoint Exceptions.',
}
),
privilegeGroups: [
Expand All @@ -680,7 +676,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].all,
api: [`${APP_ID}-showEndpointExceptions`, `${APP_ID}-crudEndpointExceptions`],
ui: ['showEndpointExceptions', 'crudEndpointExceptions'],
},
{
id: 'endpoint_exceptions_read',
Expand All @@ -690,7 +687,8 @@ const endpointExceptionsSubFeature = (): SubFeatureConfig => ({
all: [],
read: [],
},
...ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions].read,
api: [`${APP_ID}-showEndpointExceptions`],
ui: ['showEndpointExceptions'],
},
],
},
Expand Down Expand Up @@ -723,11 +721,11 @@ export const getSecurityV2SubFeaturesMap = ({
};

const securitySubFeaturesList: Array<[SecuritySubFeatureId, SubFeatureConfig]> = [
[SecuritySubFeatureId.endpointList, enableSpaceAwarenessIfNeeded(endpointListSubFeature())],
[
SecuritySubFeatureId.endpointExceptions,
enableSpaceAwarenessIfNeeded(endpointExceptionsSubFeature()),
],
[SecuritySubFeatureId.endpointList, enableSpaceAwarenessIfNeeded(endpointListSubFeature())],
[
SecuritySubFeatureId.trustedApplications,
enableSpaceAwarenessIfNeeded(trustedApplicationsSubFeature()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@ import type {
ProductFeatureKibanaConfig,
ProductFeaturesSecurityConfig,
} from '@kbn/security-solution-features';
import {
ProductFeatureSecurityKey,
type SecuritySubFeatureId,
} from '@kbn/security-solution-features/keys';
import type { ProductFeatureSecurityKey } from '@kbn/security-solution-features/keys';
import { type SecuritySubFeatureId } from '@kbn/security-solution-features/keys';
import {
securityDefaultProductFeaturesConfig,
createEnabledProductFeaturesConfigMap,
} from '@kbn/security-solution-features/config';
import {
ProductFeaturesPrivilegeId,
ProductFeaturesPrivileges,
} from '@kbn/security-solution-features/privileges';

export const getSecurityProductFeaturesConfigurator =
(enabledProductFeatureKeys: ProductFeatureKeys) => (): ProductFeaturesSecurityConfig => {
Expand All @@ -44,7 +38,4 @@ const securityProductFeaturesConfig: Record<
ProductFeatureKibanaConfig<SecuritySubFeatureId>
> = {
...securityDefaultProductFeaturesConfig,
[ProductFeatureSecurityKey.endpointExceptions]: {
privileges: ProductFeaturesPrivileges[ProductFeaturesPrivilegeId.endpointExceptions],
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
securityDefaultProductFeaturesConfig,
createEnabledProductFeaturesConfigMap,
} from '@kbn/security-solution-features/config';
import {
import type {
ProductFeatureSecurityKey,
SecuritySubFeatureId,
} from '@kbn/security-solution-features/keys';
Expand Down Expand Up @@ -45,7 +45,4 @@ const securityProductFeaturesConfig: Record<
ProductFeatureKibanaConfig<SecuritySubFeatureId>
> = {
...securityDefaultProductFeaturesConfig,
[ProductFeatureSecurityKey.endpointExceptions]: {
subFeatureIds: [SecuritySubFeatureId.endpointExceptions],
},
};