-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Add ability for users to release
an isolated host in serverless tiers where Response Actions are not available
#163616
Conversation
// of the response actions with exception of `release`. Sole access to `release` is something | ||
// that is supported for a user in a license downgrade scenario, and in that case we don't want | ||
// to allow access to Response Console. | ||
authz.canAccessResponseConsole = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enables Response Console access if the user has Authz to any response action with the exception of un-isolate
. Users that have only permission to unisolate
occurs when the Kibana license is downgraded or in serverless when running a non Endpoint Complete tier. It will allow users to continue to release
their isolated hosts if any.
Also - this change here will ensure that as we add more response actions, that access to Response console will continue to pick those up and enable this option.
] | ||
); | ||
return hostIsolationAction; | ||
return canIsolateHost || (isHostIsolated && canUnIsolateHost) ? menuItems : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug were before it was not showing release
in a downgrade scenario.
id: 'host_isolation_all', | ||
includeIn: 'none', | ||
name: 'All', | ||
savedObject: { | ||
all: [], | ||
read: [], | ||
}, | ||
// FYI: The current set of values below (`api`, `ui`) cover only `release` response action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hopping that tidbits of info like this can help along understanding how the framework around loading different privileges into existing Sub-Features
…ss PLI testing" This reverts commit 58d3121
….essentials (already in base tier)
…less-access-to-isolate-release # Conflicts: # x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/roles/complete_with_endpoint_roles.cy.ts # x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/roles/essentials_with_endpoint.roles.cy.ts
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well-commented. Thanks for that, there is a good amount of overlap with licenses and privileges and enabled things that make a complex situation here.
pointed out some typos that were in test names only. All the 'unisolate'
or 'release'
strings in the code were correct. Though maybe we should make them string constants more so there is no chance of typos
it(`should not allow access to Response Action: ${actionName}`, () => { | ||
ensureResponseActionAuthzAccess('none', actionName, username, password); | ||
}); | ||
} | ||
|
||
it('should have access to `unisoalte` api', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: unisolate
ensureResponseActionAuthzAccess('none', actionName, username, password); | ||
}); | ||
} | ||
|
||
it('should have access to `unisoalte` api', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy/paste typo
it(`should not allow access to Response Action: ${actionName}`, () => { | ||
ensureResponseActionAuthzAccess('none', actionName, username, password); | ||
}); | ||
} | ||
|
||
it('should have access to `unisoalte` api', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typ
…less-access-to-isolate-release
@@ -122,6 +124,20 @@ export const calculateEndpointAuthz = ( | |||
canWriteEventFilters, | |||
canReadEventFilters, | |||
}; | |||
|
|||
// Response console is only accessible when is license is Enterprise and user has access to any | |||
// of the response actions with exception of `release`. Sole access to `release` is something |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ... with the exception to ...
@@ -122,6 +124,20 @@ export const calculateEndpointAuthz = ( | |||
canWriteEventFilters, | |||
canReadEventFilters, | |||
}; | |||
|
|||
// Response console is only accessible when is license is Enterprise and user has access to any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ..when license is...
|
||
// Response console is only accessible when is license is Enterprise and user has access to any | ||
// of the response actions with exception of `release`. Sole access to `release` is something | ||
// that is supported for a user in a license downgrade scenario, and in that case we don't want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ...in that case, we...
Object.values(omit(RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ, 'release')).some( | ||
(responseActionAuthzKey) => { | ||
return authz[responseActionAuthzKey]; | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
agentStatus, | ||
capabilities, | ||
} = useHostIsolationStatus({ | ||
agentId, | ||
}); | ||
|
||
const isolationSupported = useMemo(() => { | ||
const doesHostSupportIsolation = useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
const isolateHostHandler = useCallback(() => { | ||
closePopover(); | ||
if (isolationStatus === false) { | ||
if (isHostIsolated === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: !isHostIsolated
…less-access-to-isolate-release
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…solated host in serverless tiers where Response Actions are not available (#163616) ## Summary - Fixes the loading of the Host Isolation sub-feature control into kibana - should always be loaded and includes only the `release` privilege in it - Fixes the "Take action" menu items for Host Isolation (displayed in alert details) to ensure `release` is displayed when host is isolated and user has `release` privilege only - Endpoint Response console will now NOT be available to users who only have `release` response action (this is a downgrade scenario where the user is still allowed to `release` isolated hosts)
Summary
release
privilege in itrelease
is displayed when host is isolated and user hasrelease
privilege onlyrelease
response action (this is a downgrade scenario where the user is still allowed torelease
isolated hosts)