Skip to content

Commit

Permalink
[EDR Workflows][Serverless] Fix Host Isolation Exceptions PLIs (#191954)
Browse files Browse the repository at this point in the history
This PR establishes appropriate privileges across Endpoint tiers. In
Endpoint Complete, users will be able to create, update, and delete Host
Isolation Exceptions. Upon downgrading to Endpoint Essentials, users
should still be able to view and remove items from the Blocklist but
will not have the ability to edit or create new entries.

Please see linked issue for more details on current behaviour.

Expected privileges:
Endpoint Essentials - User can read and delete HIE
Endpoint Complete - User can read, delete and write HIE


https://github.com/user-attachments/assets/69d14a51-6004-45b7-9c78-62066441f4ab
  • Loading branch information
szwarckonrad authored Sep 10, 2024
1 parent e356781 commit 66ab8ab
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export enum ProductFeatureSecurityKey {
* Host Isolation Exceptions, Blocklist.
*/
endpointArtifactManagement = 'endpoint_artifact_management',
/**
* Enables managing host isolation exceptions for serverless PLIs
* Allows user to create, read, update HIEs Endpoint Complete PLI
*/
endpointHostIsolationExceptions = 'endpoint_host_isolation_exceptions',
/**
* Enables all of endpoint's supported response actions - like host isolation, file operations,
* process operations, command execution, etc.
Expand Down Expand Up @@ -121,7 +126,7 @@ export enum SecuritySubFeatureId {
endpointList = 'endpointListSubFeature',
endpointExceptions = 'endpointExceptionsSubFeature',
trustedApplications = 'trustedApplicationsSubFeature',
hostIsolationExceptions = 'hostIsolationExceptionsSubFeature',
hostIsolationExceptionsBasic = 'hostIsolationExceptionsBasicSubFeature',
blocklist = 'blocklistSubFeature',
eventFilters = 'eventFiltersSubFeature',
policyManagement = 'policyManagementSubFeature',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const trustedApplicationsSubFeature: SubFeatureConfig = {
},
],
};
const hostIsolationExceptionsSubFeature: SubFeatureConfig = {
const hostIsolationExceptionsBasicSubFeature: SubFeatureConfig = {
requireAllSpaces: true,
privilegesTooltip: i18n.translate(
'securitySolutionPackages.features.featureRegistry.subFeatures.hostIsolationExceptions.privilegesTooltip',
Expand Down Expand Up @@ -664,7 +664,7 @@ export const getSecuritySubFeaturesMap = ({
[SecuritySubFeatureId.endpointList, endpointListSubFeature],
[SecuritySubFeatureId.endpointExceptions, endpointExceptionsSubFeature],
[SecuritySubFeatureId.trustedApplications, trustedApplicationsSubFeature],
[SecuritySubFeatureId.hostIsolationExceptions, hostIsolationExceptionsSubFeature],
[SecuritySubFeatureId.hostIsolationExceptionsBasic, hostIsolationExceptionsBasicSubFeature],
[SecuritySubFeatureId.blocklist, blocklistSubFeature],
[SecuritySubFeatureId.eventFilters, eventFiltersSubFeature],
[SecuritySubFeatureId.policyManagement, policyManagementSubFeature],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,16 @@ export const securityDefaultProductFeaturesConfig: DefaultSecurityProductFeature

[ProductFeatureSecurityKey.endpointArtifactManagement]: {
subFeatureIds: [
SecuritySubFeatureId.hostIsolationExceptionsBasic,
SecuritySubFeatureId.trustedApplications,
SecuritySubFeatureId.blocklist,
SecuritySubFeatureId.eventFilters,
],
},

// Endpoint Complete Tier:
// Allows access to create/update HIEs
[ProductFeatureSecurityKey.endpointHostIsolationExceptions]: {
subFeaturesPrivileges: [
{
id: 'host_isolation_exceptions_all',
Expand All @@ -99,7 +105,6 @@ export const securityDefaultProductFeaturesConfig: DefaultSecurityProductFeature

[ProductFeatureSecurityKey.endpointResponseActions]: {
subFeatureIds: [
SecuritySubFeatureId.hostIsolationExceptions,
SecuritySubFeatureId.responseActionsHistory,
SecuritySubFeatureId.hostIsolation,
SecuritySubFeatureId.processOperations,
Expand All @@ -117,10 +122,13 @@ export const securityDefaultProductFeaturesConfig: DefaultSecurityProductFeature
},

// Product features without RBAC
// Endpoint/Osquery PLIs
[ProductFeatureSecurityKey.osqueryAutomatedResponseActions]: {},
[ProductFeatureSecurityKey.endpointProtectionUpdates]: {},
[ProductFeatureSecurityKey.endpointAgentTamperProtection]: {},
[ProductFeatureSecurityKey.externalRuleActions]: {},
[ProductFeatureSecurityKey.cloudSecurityPosture]: {},

// Security PLIs
[ProductFeatureSecurityKey.integrationAssistant]: {},
};
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ describe('ManifestManager', () => {
}
});

test(`when it has endpoint artifact management and response actions app features it should generate all exceptions`, async () => {
test(`when it has endpoint artifact management and endpoint host isolation exceptions app features it should generate all exceptions`, async () => {
const exceptionListItem = getExceptionListItemSchemaMock({ os_types: ['macos'] });
const trustedAppListItem = getExceptionListItemSchemaMock({
os_types: ['linux'],
Expand All @@ -931,7 +931,7 @@ describe('ManifestManager', () => {
});
const context = buildManifestManagerContextMock({}, [
ProductFeatureSecurityKey.endpointArtifactManagement,
ProductFeatureSecurityKey.endpointResponseActions,
ProductFeatureSecurityKey.endpointHostIsolationExceptions,
]);
const manifestManager = new ManifestManager(context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,14 @@ export class ManifestManager {
}): Promise<WrappedTranslatedExceptionList> {
if (!this.cachedExceptionsListsByOs.has(`${listId}-${os}`)) {
let itemsByListId: ExceptionListItemSchema[] = [];
// endpointHostIsolationExceptions includes full CRUD support for Host Isolation Exceptions
// endpointArtifactManagement includes full CRUD support for all other exception lists + RD support for Host Isolation Exceptions
// If there are host isolation exceptions in place but there is a downgrade scenario, those shouldn't be taken into account when generating artifacts.
if (
(listId === ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.id &&
this.productFeaturesService.isEnabled(ProductFeatureKey.endpointResponseActions)) ||
this.productFeaturesService.isEnabled(
ProductFeatureKey.endpointHostIsolationExceptions
)) ||
(listId !== ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.id &&
this.productFeaturesService.isEnabled(ProductFeatureKey.endpointArtifactManagement))
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export const PLI_PRODUCT_FEATURES: PliProductFeatures = {
ProductFeatureKey.endpointExceptions,
],
complete: [
ProductFeatureKey.endpointHostIsolationExceptions,
ProductFeatureKey.endpointResponseActions,
ProductFeatureKey.osqueryAutomatedResponseActions,
ProductFeatureKey.endpointAgentTamperProtection,
ProductFeatureKey.endpointExceptions,
ProductFeatureKey.endpointProtectionUpdates,
],
},
Expand Down

0 comments on commit 66ab8ab

Please sign in to comment.