Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Endpoint RBAC integration with AppFeatures architecture #158646

Merged
merged 147 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from 144 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
1b8797c
Create App Features server
machadoum May 22, 2023
2f483d4
Use create App features server
machadoum May 22, 2023
058ef8e
Create ess_security plugin
machadoum May 22, 2023
66f1af7
Create upsellings service
machadoum May 22, 2023
a42d97f
Delete server/features.ts file
machadoum May 22, 2023
4a845ac
Add upselling component to serverless_security
machadoum May 22, 2023
700e427
Add serverless_security new types
machadoum May 22, 2023
875618a
Last missing changes
machadoum May 22, 2023
6f3a8c0
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 22, 2023
03e0144
Fix types
machadoum May 22, 2023
fbac01c
Fix tests
machadoum May 23, 2023
951a94e
Improve useAppLinks tests
machadoum May 23, 2023
35e63f9
Add missing cases config
machadoum May 23, 2023
09859b1
Add essSecurity plugin to limits.yml
machadoum May 23, 2023
7d1bd5a
Add unit tests to AppFeaturesConfigMerger
machadoum May 23, 2023
c45fced
Rename SKU -> PLI (Product Line Item)
machadoum May 22, 2023
9d19cd7
Fix skus renames and more types
machadoum May 24, 2023
6f2a978
Rollback upselling renaming
machadoum May 24, 2023
1d24002
Fix writeHostIsolation rename to writeIsolateHost
machadoum May 24, 2023
6752f40
Refactor AppFeaturesSecurityKeys to enum
machadoum May 24, 2023
b1e52a4
Remove all isolate host changes
machadoum May 25, 2023
60f524b
Revert "Fix writeHostIsolation rename to writeIsolateHost"
machadoum May 25, 2023
62274b6
Fix host isolation removal
machadoum May 25, 2023
928e06e
Remove all serverless features
machadoum May 25, 2023
2670bfe
Remove 'isUpsell' traces
machadoum May 25, 2023
92e2792
Fix ess and serverless double registration issue
machadoum May 25, 2023
0332959
Add entity analytics page upselling
machadoum May 26, 2023
416deac
Rename PLI to product line id
machadoum May 26, 2023
f4c8038
Create SecurityPage component to handle upsell pages
machadoum May 26, 2023
c8d1cde
Raname SecurityRoutePageWrapper
machadoum May 26, 2023
71e7c7e
Improve entity analytics upsell
machadoum May 26, 2023
b9a190f
Add risk score upsell section
machadoum May 26, 2023
dd180f4
Update upsell components to be lazily loaded
machadoum May 26, 2023
81b146a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 26, 2023
69d0fc1
Remove cases feature sample code
machadoum May 26, 2023
1333c03
working version
semd May 30, 2023
96a655d
remove unnecessary parameter
semd May 30, 2023
546e77c
Create App Features server
machadoum May 22, 2023
0c6f185
Use create App features server
machadoum May 22, 2023
af07bef
Create ess_security plugin
machadoum May 22, 2023
5502257
Create upsellings service
machadoum May 22, 2023
e79bd69
Delete server/features.ts file
machadoum May 22, 2023
30e6791
Add upselling component to serverless_security
machadoum May 22, 2023
0469bd3
Add serverless_security new types
machadoum May 22, 2023
312c905
Last missing changes
machadoum May 22, 2023
84a1a1b
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 22, 2023
fb074cc
Fix types
machadoum May 22, 2023
080eebf
Fix tests
machadoum May 23, 2023
ec1a537
Improve useAppLinks tests
machadoum May 23, 2023
5f67ce3
Add missing cases config
machadoum May 23, 2023
6b501ad
Add essSecurity plugin to limits.yml
machadoum May 23, 2023
475fec2
Add unit tests to AppFeaturesConfigMerger
machadoum May 23, 2023
9d20adb
Rename SKU -> PLI (Product Line Item)
machadoum May 22, 2023
fa2bf70
Fix skus renames and more types
machadoum May 24, 2023
405cb33
Rollback upselling renaming
machadoum May 24, 2023
743c53c
Fix writeHostIsolation rename to writeIsolateHost
machadoum May 24, 2023
44cf1f2
Refactor AppFeaturesSecurityKeys to enum
machadoum May 24, 2023
89125b1
Remove all isolate host changes
machadoum May 25, 2023
506d969
Revert "Fix writeHostIsolation rename to writeIsolateHost"
machadoum May 25, 2023
224339f
Fix host isolation removal
machadoum May 25, 2023
736a9fe
Remove all serverless features
machadoum May 25, 2023
de1f10b
Remove 'isUpsell' traces
machadoum May 25, 2023
b45cd2e
Fix ess and serverless double registration issue
machadoum May 25, 2023
a2e0409
Add entity analytics page upselling
machadoum May 26, 2023
8a54490
Rename PLI to product line id
machadoum May 26, 2023
186a0d0
Create SecurityPage component to handle upsell pages
machadoum May 26, 2023
873a9e0
Raname SecurityRoutePageWrapper
machadoum May 26, 2023
4a7fde9
Improve entity analytics upsell
machadoum May 26, 2023
2bcf98c
Add risk score upsell section
machadoum May 26, 2023
5e29b2a
Update upsell components to be lazily loaded
machadoum May 26, 2023
ce77cef
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 26, 2023
bf6a101
Remove cases feature sample code
machadoum May 26, 2023
b2016b6
Add unit tests
machadoum May 30, 2023
bdfff4f
Make pli_features a ts file
machadoum May 30, 2023
58739a3
Add APP_ID to entity analytics API privileges
machadoum May 31, 2023
73be171
Rollback ENTITY_ANALYTICS_CAPABILITY const
machadoum May 31, 2023
cf3287a
Rename product line ids
machadoum May 31, 2023
7ad6814
Make AppFeatureKeys partial inside PLI_APP_FEATURES
machadoum May 31, 2023
6119282
merge main pli features branch
semd May 31, 2023
54a553f
Create App Features server
machadoum May 22, 2023
89a8789
Use create App features server
machadoum May 22, 2023
b01fe23
Create ess_security plugin
machadoum May 22, 2023
d08e788
Create upsellings service
machadoum May 22, 2023
dd8921c
Delete server/features.ts file
machadoum May 22, 2023
7923438
Add upselling component to serverless_security
machadoum May 22, 2023
9421ba5
Add serverless_security new types
machadoum May 22, 2023
fb1abc4
Last missing changes
machadoum May 22, 2023
110edee
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 22, 2023
2510d5d
Fix types
machadoum May 22, 2023
945dfae
Fix tests
machadoum May 23, 2023
a66b7d5
Improve useAppLinks tests
machadoum May 23, 2023
d042e6f
Add missing cases config
machadoum May 23, 2023
c3700f7
Add essSecurity plugin to limits.yml
machadoum May 23, 2023
f5682e9
Add unit tests to AppFeaturesConfigMerger
machadoum May 23, 2023
8a81b1d
Rename SKU -> PLI (Product Line Item)
machadoum May 22, 2023
64a9c08
Fix skus renames and more types
machadoum May 24, 2023
de0d016
Rollback upselling renaming
machadoum May 24, 2023
782d0be
Fix writeHostIsolation rename to writeIsolateHost
machadoum May 24, 2023
3443c94
Refactor AppFeaturesSecurityKeys to enum
machadoum May 24, 2023
affadf4
Remove all isolate host changes
machadoum May 25, 2023
dc71fcb
Revert "Fix writeHostIsolation rename to writeIsolateHost"
machadoum May 25, 2023
fdb1bb4
Fix host isolation removal
machadoum May 25, 2023
7b19bfb
Remove all serverless features
machadoum May 25, 2023
0dac524
Remove 'isUpsell' traces
machadoum May 25, 2023
89d91c5
Fix ess and serverless double registration issue
machadoum May 25, 2023
246629a
Add entity analytics page upselling
machadoum May 26, 2023
9cf5e9d
Rename PLI to product line id
machadoum May 26, 2023
b691fac
Create SecurityPage component to handle upsell pages
machadoum May 26, 2023
39842e0
Raname SecurityRoutePageWrapper
machadoum May 26, 2023
e5073a6
Improve entity analytics upsell
machadoum May 26, 2023
edf01ae
Add risk score upsell section
machadoum May 26, 2023
21a4ea7
Update upsell components to be lazily loaded
machadoum May 26, 2023
a02f6d3
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 26, 2023
70af547
Remove cases feature sample code
machadoum May 26, 2023
d58adb7
Add unit tests
machadoum May 30, 2023
2072c57
Make pli_features a ts file
machadoum May 30, 2023
d9eb3f9
Add APP_ID to entity analytics API privileges
machadoum May 31, 2023
f583879
Rollback ENTITY_ANALYTICS_CAPABILITY const
machadoum May 31, 2023
df04ccf
Rename product line ids
machadoum May 31, 2023
60b9fd8
Make AppFeatureKeys partial inside PLI_APP_FEATURES
machadoum May 31, 2023
df53a36
Update PLI_APP_FEATURES type
machadoum May 31, 2023
47c0473
Update yarn.lock
machadoum May 31, 2023
34c4061
endpoint app features
semd May 31, 2023
c433187
conflicts solved
semd May 31, 2023
b117535
solve more conflicts
semd May 31, 2023
5d74bb2
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine May 31, 2023
0e55eba
tests added
semd May 31, 2023
2bee539
Merge branch '6491_serverless-pli-endpoint-poc' of https://github.com…
semd May 31, 2023
7759f9b
missing import
semd May 31, 2023
11d820d
especial case comment
semd May 31, 2023
3ddc502
default all product types config
semd Jun 1, 2023
24330f2
merging main
semd Jun 1, 2023
2e3f284
fix test
semd Jun 1, 2023
e70e96d
fix test
semd Jun 1, 2023
d22c72d
fix unit test
semd Jun 2, 2023
686bc2e
merge main
semd Jun 5, 2023
7d3b521
add missing subFeature
semd Jun 5, 2023
3d82e8e
fix test
semd Jun 5, 2023
d7c3b40
access HIE privilege to manage links access
semd Jun 5, 2023
4d9f0c3
fix links test
semd Jun 5, 2023
6a8f13e
review suggestions
semd Jun 7, 2023
ce0bec1
clean test
semd Jun 7, 2023
5068316
fix unrelated redirect issue in serverless
semd Jun 8, 2023
c67ba35
Merge branch 'main' into 6491_serverless-pli-endpoint-poc
kibanamachine Jun 8, 2023
5fae537
merge main
semd Jun 8, 2023
57b5a5d
endpoint PLI subFeatures reorganization
semd Jun 9, 2023
44257e0
Merge remote-tracking branch 'upstream/main' into 6491_serverless-pli…
semd Jun 9, 2023
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
6 changes: 5 additions & 1 deletion config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ xpack.uptime.enabled: false

## Enable the Serverless Security plugin
xpack.serverless.security.enabled: true
xpack.serverless.security.productTypes: [{ product_line: 'security', product_tier: 'complete' }]
xpack.serverless.security.productTypes:
[
{ product_line: 'security', product_tier: 'complete' },
{ product_line: 'endpoint', product_tier: 'complete' },
]

## Set the home route
uiSettings.overrides.defaultRoute: /app/security/get_started
Expand Down
18 changes: 18 additions & 0 deletions x-pack/plugins/fleet/common/constants/authz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ export const ENDPOINT_PRIVILEGES: Record<string, PrivilegeMapObject> = deepFreez
privilegeType: 'api',
privilegeName: 'readHostIsolationExceptions',
},
accessHostIsolationExceptions: {
appId: DEFAULT_APP_CATEGORIES.security.id,
privilegeSplit: '-',
privilegeType: 'api',
privilegeName: 'accessHostIsolationExceptions',
},
deleteHostIsolationExceptions: {
appId: DEFAULT_APP_CATEGORIES.security.id,
privilegeSplit: '-',
privilegeType: 'api',
privilegeName: 'deleteHostIsolationExceptions',
},
writeBlocklist: {
appId: DEFAULT_APP_CATEGORIES.security.id,
privilegeSplit: '-',
Expand Down Expand Up @@ -126,6 +138,12 @@ export const ENDPOINT_PRIVILEGES: Record<string, PrivilegeMapObject> = deepFreez
privilegeType: 'api',
privilegeName: 'writeHostIsolation',
},
writeHostIsolationRelease: {
appId: DEFAULT_APP_CATEGORIES.security.id,
privilegeSplit: '-',
privilegeType: 'api',
privilegeName: 'writeHostIsolationRelease',
},
writeProcessOperations: {
appId: DEFAULT_APP_CATEGORIES.security.id,
privilegeSplit: '-',
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,12 @@ import type { MaybeImmutable } from '../../types';
* level, use `calculateEndpointAuthz()`
*
* @param fleetAuthz
* @param isEndpointRbacEnabled
* @param isSuperuser
* @param privilege
*/
export function hasKibanaPrivilege(
fleetAuthz: FleetAuthz,
isEndpointRbacEnabled: boolean,
isSuperuser: boolean = false,
privilege: keyof typeof ENDPOINT_PRIVILEGES
): boolean {
// user is superuser, always return true
if (isSuperuser) {
return true;
}

// not superuser and FF not enabled, no access
if (!isEndpointRbacEnabled) {
return false;
}

// FF enabled, access based on privileges
return fleetAuthz.packagePrivileges?.endpoint?.actions[privilege].executePackageAction ?? false;
}

Expand All @@ -50,181 +35,58 @@ export function hasKibanaPrivilege(
* @param licenseService
* @param fleetAuthz
* @param userRoles
* @param isEndpointRbacEnabled
* @param permissions
* @param hasHostIsolationExceptionsItems if set to `true`, then Host Isolation Exceptions related authz properties
* may be adjusted to account for a license downgrade scenario
*/

// eslint-disable-next-line complexity
export const calculateEndpointAuthz = (
licenseService: LicenseService,
fleetAuthz: FleetAuthz,
userRoles: MaybeImmutable<string[]> = [],
isEndpointRbacEnabled: boolean = false,
hasHostIsolationExceptionsItems: boolean = false
semd marked this conversation as resolved.
Show resolved Hide resolved
userRoles: MaybeImmutable<string[]> = []
): EndpointAuthz => {
const isPlatinumPlusLicense = licenseService.isPlatinumPlus();
const isEnterpriseLicense = licenseService.isEnterprise();
const hasEndpointManagementAccess = userRoles.includes('superuser');

const canWriteSecuritySolution = hasKibanaPrivilege(
fleetAuthz,
true,
hasEndpointManagementAccess,
'writeSecuritySolution'
);
const canReadSecuritySolution =
canWriteSecuritySolution ||
hasKibanaPrivilege(fleetAuthz, true, hasEndpointManagementAccess, 'readSecuritySolution');
const canWriteEndpointList = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeEndpointList'
);
const canReadEndpointList =
canWriteEndpointList ||
hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'readEndpointList'
);
const canWritePolicyManagement = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writePolicyManagement'
);
const canReadPolicyManagement =
canWritePolicyManagement ||
hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'readPolicyManagement'
);
const canWriteActionsLogManagement = hasKibanaPrivilege(
const canWriteSecuritySolution = hasKibanaPrivilege(fleetAuthz, 'writeSecuritySolution');
const canReadSecuritySolution = hasKibanaPrivilege(fleetAuthz, 'readSecuritySolution');
const canWriteEndpointList = hasKibanaPrivilege(fleetAuthz, 'writeEndpointList');
const canReadEndpointList = hasKibanaPrivilege(fleetAuthz, 'readEndpointList');
const canWritePolicyManagement = hasKibanaPrivilege(fleetAuthz, 'writePolicyManagement');
const canReadPolicyManagement = hasKibanaPrivilege(fleetAuthz, 'readPolicyManagement');
const canWriteActionsLogManagement = hasKibanaPrivilege(fleetAuthz, 'writeActionsLogManagement');
const canReadActionsLogManagement = hasKibanaPrivilege(fleetAuthz, 'readActionsLogManagement');
const canIsolateHost = hasKibanaPrivilege(fleetAuthz, 'writeHostIsolation');
const canUnIsolateHost = hasKibanaPrivilege(fleetAuthz, 'writeHostIsolationRelease');
const canWriteProcessOperations = hasKibanaPrivilege(fleetAuthz, 'writeProcessOperations');
const canWriteTrustedApplications = hasKibanaPrivilege(fleetAuthz, 'writeTrustedApplications');
const canReadTrustedApplications = hasKibanaPrivilege(fleetAuthz, 'readTrustedApplications');
const canWriteHostIsolationExceptions = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeActionsLogManagement'
);
const canReadActionsLogManagement =
canWriteActionsLogManagement ||
hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'readActionsLogManagement'
);
const canIsolateHost = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeHostIsolation'
);
const canWriteProcessOperations = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeProcessOperations'
);
const canWriteTrustedApplications = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeTrustedApplications'
);
const canReadTrustedApplications =
canWriteTrustedApplications ||
hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'readTrustedApplications'
);

const hasWriteHostIsolationExceptionsPermission = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeHostIsolationExceptions'
);
const canWriteHostIsolationExceptions =
hasWriteHostIsolationExceptionsPermission && isPlatinumPlusLicense;

const hasReadHostIsolationExceptionsPermission =
hasWriteHostIsolationExceptionsPermission ||
hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'readHostIsolationExceptions'
);
// Calculate the Host Isolation Exceptions Authz. Some of these authz properties could be
// set to `true` in cases where license was downgraded, but entries still exist.
const canReadHostIsolationExceptions =
canWriteHostIsolationExceptions ||
(hasReadHostIsolationExceptionsPermission &&
// We still allow `read` if not Platinum license, but entries exists for HIE
(isPlatinumPlusLicense || hasHostIsolationExceptionsItems));

const canDeleteHostIsolationExceptions =
canWriteHostIsolationExceptions ||
// Should be able to delete if host isolation exceptions exists and license is not platinum+
(hasWriteHostIsolationExceptionsPermission &&
!isPlatinumPlusLicense &&
hasHostIsolationExceptionsItems);

const canWriteBlocklist = hasKibanaPrivilege(
const canReadHostIsolationExceptions = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeBlocklist'
'readHostIsolationExceptions'
);
const canReadBlocklist =
canWriteBlocklist ||
hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'readBlocklist'
);
const canWriteEventFilters = hasKibanaPrivilege(
const canAccessHostIsolationExceptions = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeEventFilters'
'accessHostIsolationExceptions'
);
const canReadEventFilters =
canWriteEventFilters ||
hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'readEventFilters'
);
const canWriteFileOperations = hasKibanaPrivilege(
const canDeleteHostIsolationExceptions = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeFileOperations'
'deleteHostIsolationExceptions'
);
const canWriteBlocklist = hasKibanaPrivilege(fleetAuthz, 'writeBlocklist');
const canReadBlocklist = hasKibanaPrivilege(fleetAuthz, 'readBlocklist');
const canWriteEventFilters = hasKibanaPrivilege(fleetAuthz, 'writeEventFilters');
const canReadEventFilters = hasKibanaPrivilege(fleetAuthz, 'readEventFilters');
const canWriteFileOperations = hasKibanaPrivilege(fleetAuthz, 'writeFileOperations');

const canWriteExecuteOperations = hasKibanaPrivilege(
fleetAuthz,
isEndpointRbacEnabled,
hasEndpointManagementAccess,
'writeExecuteOperations'
);
const canWriteExecuteOperations = hasKibanaPrivilege(fleetAuthz, 'writeExecuteOperations');

return {
canWriteSecuritySolution,
canReadSecuritySolution,
canAccessFleet: fleetAuthz?.fleet.all ?? userRoles.includes('superuser'),
canAccessEndpointManagement: hasEndpointManagementAccess,
canAccessFleet: fleetAuthz?.fleet.all ?? false,
canAccessEndpointManagement: hasEndpointManagementAccess, // TODO: is this one deprecated? it is the only place we need to check for superuser.
canCreateArtifactsByPolicy: isPlatinumPlusLicense,
canWriteEndpointList,
canReadEndpointList,
Expand All @@ -235,13 +97,14 @@ export const calculateEndpointAuthz = (
canAccessEndpointActionsLogManagement: canReadActionsLogManagement && isPlatinumPlusLicense,
// Response Actions
canIsolateHost: canIsolateHost && isPlatinumPlusLicense,
canUnIsolateHost: canIsolateHost,
canUnIsolateHost,
canKillProcess: canWriteProcessOperations && isEnterpriseLicense,
canSuspendProcess: canWriteProcessOperations && isEnterpriseLicense,
canGetRunningProcesses: canWriteProcessOperations && isEnterpriseLicense,
canAccessResponseConsole:
isEnterpriseLicense &&
(canIsolateHost ||
canUnIsolateHost ||
canWriteProcessOperations ||
canWriteFileOperations ||
canWriteExecuteOperations),
Expand All @@ -250,7 +113,8 @@ export const calculateEndpointAuthz = (
// artifacts
canWriteTrustedApplications,
canReadTrustedApplications,
canWriteHostIsolationExceptions,
canWriteHostIsolationExceptions: canWriteHostIsolationExceptions && isPlatinumPlusLicense,
canAccessHostIsolationExceptions: canAccessHostIsolationExceptions && isPlatinumPlusLicense,
canReadHostIsolationExceptions,
canDeleteHostIsolationExceptions,
canWriteBlocklist,
Expand All @@ -275,7 +139,7 @@ export const getEndpointAuthzInitialState = (): EndpointAuthz => {
canWriteActionsLogManagement: false,
canReadActionsLogManagement: false,
canIsolateHost: false,
canUnIsolateHost: true,
canUnIsolateHost: false,
canKillProcess: false,
canSuspendProcess: false,
canGetRunningProcesses: false,
Expand All @@ -285,6 +149,7 @@ export const getEndpointAuthzInitialState = (): EndpointAuthz => {
canWriteTrustedApplications: false,
canReadTrustedApplications: false,
canWriteHostIsolationExceptions: false,
canAccessHostIsolationExceptions: false,
canReadHostIsolationExceptions: false,
canDeleteHostIsolationExceptions: false,
canWriteBlocklist: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export const getEndpointAuthzInitialStateMock = (

return mockPrivileges;
}, {} as EndpointAuthz),
// this one is currently treated special in that everyone can un-isolate
canUnIsolateHost: true,
...overrides,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export type ConsoleResponseActionCommands = typeof CONSOLE_RESPONSE_ACTION_COMMA

export type ResponseConsoleRbacControls =
| 'writeHostIsolation'
| 'writeHostIsolationRelease'
| 'writeProcessOperations'
| 'writeFileOperations'
| 'writeExecuteOperations';
Expand All @@ -75,7 +76,7 @@ export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_RBAC_FEATURE_CONTROL: Record<
ResponseConsoleRbacControls
> = Object.freeze({
isolate: 'writeHostIsolation',
release: 'writeHostIsolation',
release: 'writeHostIsolationRelease',
'kill-process': 'writeProcessOperations',
'suspend-process': 'writeProcessOperations',
processes: 'writeProcessOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ export interface EndpointAuthz {
canWriteHostIsolationExceptions: boolean;
/** if user has read permissions for host isolation exceptions */
canReadHostIsolationExceptions: boolean;
/**
* if user has permissions to access host isolation exceptions. This could be set to false, while
* `canReadHostIsolationExceptions` is true in cases where the license might have been downgraded.
* It is used to show the UI elements that allow users to navigate to the host isolation exceptions.
*/
canAccessHostIsolationExceptions: boolean;
/**
* if user has permissions to delete host isolation exceptions. This could be set to true, while
* `canWriteHostIsolationExceptions` is false in cases where the license might have been downgraded.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export enum AppFeatureSecurityKey {
* Enables Advanced Insights (Entity Risk, GenAI)
*/
advancedInsights = 'advanced_insights',
/**
* Enables Endpoint Response Actions like isolate host, trusted apps, blocklist, etc.
*/
endpointResponseActions = 'endpoint_response_actions',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these values final? or just preliminary until we get around to creating them in accordance to the PLI spreadsheet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These appFeatures represent the PLI in the spreadsheet, they are final. However, I am not familiar enough with the endpoint logic to be 100% sure I implemented the correct scope, if you guys think we should include something else, or something less, or change the names of the flags, I'll be happy to adapt it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We'll likely adjust it. I'm thinking we create an individual item for each response action rather than combine them all into one. that gives us the freedom to ensure that future Response actions can be used in different PLI's if any new ones come up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be only one AppFeatureKey for each PLI in the spreadsheet, the granularity should be configured at the Kibana feature level here:

[AppFeatureSecurityKey.endpointResponseActions]: {
subFeatureIds: endpointResponseActionsSubFeatureIds,
subFeaturesPrivileges: [
{
id: 'host_isolation_all',
api: [`${APP_ID}-writeHostIsolation`],
ui: ['writeHostIsolation'],
},
],
},
[AppFeatureSecurityKey.endpointExceptions]: {
subFeatureIds: [SecuritySubFeatureId.trustedApplications, SecuritySubFeatureId.blocklist],
subFeaturesPrivileges: [
{
id: 'host_isolation_exceptions_all',
api: [
`${APP_ID}-accessHostIsolationExceptions`,
`${APP_ID}-writeHostIsolationExceptions`,
],
ui: ['accessHostIsolationExceptions', 'writeHostIsolationExceptions'],
},
{
id: 'host_isolation_exceptions_read',
api: [`${APP_ID}-accessHostIsolationExceptions`],
ui: ['accessHostIsolationExceptions'],
},
],
},

/**
* Enables Endpoint Exceptions like isolate host, trusted apps, blocklist, etc.
*/
endpointExceptions = 'endpoint_exceptions',
}

export enum AppFeatureCasesKey {
Expand Down
Loading