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 Solutions] Add PLI authorisation for Cases Connector #161343

Merged
merged 21 commits into from
Aug 7, 2023

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Jul 6, 2023

Summary

  • Create a new capability called cases_connectors which will control the access to the cases connector feature. Note that for users to have access to this feature they also need to be authorized for cases feature and actions feature.
  • Create a new API tag casesGetConnectorsConfigure to restrict access to the Get Connectors APIs.

Authorization

For the authorization of users we use a) a new UI capability b) a new API access tag and c) the existing Cases RBAC. The Cases feature privilege in Security solution is constructed based on the configuration provided by the security serverless plugin. The UI capability, the API tag, and the cases operations will be added/removed depending on the configuration.

UI capability

We include the CASES_CONNECTORS_CAPABILITY which will be used by the UI to show/hide various UI components responsible for the case connectors feature.

APIs

There are two APIs that use connectors in Cases. The Get Connectors API which returns all supported connectors by Cases and the Push Case API that push a case to an external service.

Get Connectors API

The Get Connectors API does not interact with any of the cases' saved objects. It uses the actionsClient, provided by the actions plugin, to get all connectors and filter out the ones supported by cases. For that reason, an API tag called GET_CONNECTORS_CONFIGURE_API_TAG is added to the API to control access. If the user has access to any of the Cases kibana privilege features (Security, Observability, or Stack) it will have access to the API. This is an expected behavior and in the Security serverless project, only one Case feature will be available.

Push Case API

The Push Case API already authorizes users by using the Cases RBAC. The user should have the push operation set in the Cases Kibana feature privilege to be able to use the API.

Permissions

Cases Actions Case Connectors Outcome
read all all See the connector but cannot edit (current behavior)
read all none Hide the connectors in Cases
read read all See the connector but cannot edit (current behavior)
read read none Hide the connectors in Cases
all all all Full access
all all none Hide the connectors in Cases
all read all Full access
all read none Hide the connectors in Cases

When the Actions is set to none all connector features are hidden

How to test it?

ESS

  • Run ESS and check if it still works as expected for all combinations of cases and actions permissions.

Serverless

  • Run Serverless with security essentials (serverless.security.yml) and check if it works as expected for all combinations of cases and actions permissions.
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'essentials' }
  ]


  • Run Serverless with security complete (config/serverless.security.yml) and check if it works as expected for all combinations of cases and actions permissions.
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
  ]
 

Checklist

Delete any items that are not applicable to this PR.

@machadoum machadoum changed the title DRAFT cases PLI [Security Solutions] Add PLI authorisation for Cases Connectors Jul 24, 2023
@machadoum machadoum changed the title [Security Solutions] Add PLI authorisation for Cases Connectors [Security Solutions] Add PLI authorisation for Cases Connector Jul 24, 2023
@machadoum machadoum self-assigned this Jul 24, 2023
@machadoum machadoum added Team:Threat Hunting Security Solution Threat Hunting Team Feature:Cases Cases feature Team:Threat Hunting:Explore Project:Serverless Work as part of the Serverless project for its initial release Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.10.0 release_note:skip Skip the PR/issue when compiling release notes labels Jul 24, 2023
@machadoum machadoum force-pushed the siem-explore-cases-PLI branch 3 times, most recently from c333188 to 11fe904 Compare July 24, 2023 12:52
@machadoum machadoum marked this pull request as ready for review July 24, 2023 13:08
@machadoum machadoum requested review from a team as code owners July 24, 2023 13:08
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@machadoum machadoum force-pushed the siem-explore-cases-PLI branch 2 times, most recently from 6e0689c to 8b47175 Compare July 24, 2023 14:09
@machadoum machadoum requested a review from a team as a code owner July 24, 2023 14:09
@machadoum machadoum added the ci:cloud-deploy Create or update a Cloud deployment label Jul 24, 2023
@machadoum machadoum requested a review from a team as a code owner July 24, 2023 15:33
@cnasikas cnasikas added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Jul 25, 2023
@mistic
Copy link
Member

mistic commented Aug 7, 2023

This PR broke main and I had the need to revert it c4557dd

@mistic mistic added the reverted label Aug 7, 2023
machadoum added a commit to machadoum/kibana that referenced this pull request Aug 7, 2023
This was referenced Aug 7, 2023
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Aug 8, 2023
…ic#161343)

## Summary

* Create a new capability called `cases_connectors` which will control
the access to the cases connector feature. Note that for users to have
access to this feature they also need to be authorized for cases feature
and actions feature.
* Create a new API tag `casesGetConnectorsConfigure` to restrict access
to the Get Connectors APIs.

## Authorization

For the authorization of users we use a) a new UI capability b) a new
API access tag and c) the existing Cases RBAC. The Cases feature
privilege in Security solution is constructed based on the configuration
provided by the security serverless plugin. The UI capability, the API
tag, and the cases operations will be added/removed depending on the
configuration.

### UI capability

We include the `CASES_CONNECTORS_CAPABILITY` which will be used by the
UI to show/hide various UI components responsible for the case
connectors feature.

### APIs

There are two APIs that use connectors in Cases. The [Get Connectors
API](https://www.elastic.co/guide/en/kibana/current/case-apis.html#findCaseConnectors)
which returns all supported connectors by Cases and the [Push Case
API](https://www.elastic.co/guide/en/kibana/current/case-apis.html#pushCaseDefaultSpace)
that push a case to an external service.

#### Get Connectors API

The Get Connectors API does not interact with any of the cases' saved
objects. It uses the `actionsClient`, provided by the actions plugin, to
get all connectors and filter out the ones supported by cases. For that
reason, an API tag called `GET_CONNECTORS_CONFIGURE_API_TAG` is added to
the API to control access. If the user has access to any of the Cases
kibana privilege features (Security, Observability, or Stack) it will
have access to the API. This is an expected behavior and in the Security
serverless project, only one Case feature will be available.

#### Push Case API

The Push Case API already authorizes users by using the Cases RBAC. The
user should have the `push` operation set in the Cases Kibana feature
privilege to be able to use the API.

## Permissions

<meta charset="utf-8"><b style="font-weight:normal;"
id="docs-internal-guid-d1fea174-7fff-4f03-ed2e-9fc3ad3ed789"><div
dir="ltr" style="margin-left:0pt;" align="left">

Cases | Actions | Case Connectors | Outcome
-- | -- | -- | --
read | all | all | See the connector but cannot edit (current behavior)
read | all | none | Hide the connectors in Cases
read | read | all | See the connector but cannot edit (current behavior)
read | read | none | Hide the connectors in Cases
all | all | all | Full access
all | all | none | Hide the connectors in Cases
all | read | all | See the connector but cannot edit (current behavior)
all | read | none | Hide the connectors in Cases

</div><br /></b>

When the Actions is set to `none` all connector features are hidden

### How to test it?
#### ESS
* Run ESS and check if it still works as expected for all combinations
of cases and actions permissions.

#### Serverless
* Run Serverless with security essentials (serverless.security.yml) and
check if it works as expected for all combinations of cases and actions
permissions.

```
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'essentials' }
  ]


```
* Run Serverless with security complete (config/serverless.security.yml)
and check if it works as expected for all combinations of cases and
actions permissions.
```
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
  ]
 
 ```



### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Aug 8, 2023
bryce-b pushed a commit to bryce-b/kibana that referenced this pull request Aug 9, 2023
…ic#161343)

## Summary

* Create a new capability called `cases_connectors` which will control
the access to the cases connector feature. Note that for users to have
access to this feature they also need to be authorized for cases feature
and actions feature.
* Create a new API tag `casesGetConnectorsConfigure` to restrict access
to the Get Connectors APIs.

## Authorization

For the authorization of users we use a) a new UI capability b) a new
API access tag and c) the existing Cases RBAC. The Cases feature
privilege in Security solution is constructed based on the configuration
provided by the security serverless plugin. The UI capability, the API
tag, and the cases operations will be added/removed depending on the
configuration.

### UI capability

We include the `CASES_CONNECTORS_CAPABILITY` which will be used by the
UI to show/hide various UI components responsible for the case
connectors feature.

### APIs

There are two APIs that use connectors in Cases. The [Get Connectors
API](https://www.elastic.co/guide/en/kibana/current/case-apis.html#findCaseConnectors)
which returns all supported connectors by Cases and the [Push Case
API](https://www.elastic.co/guide/en/kibana/current/case-apis.html#pushCaseDefaultSpace)
that push a case to an external service.

#### Get Connectors API

The Get Connectors API does not interact with any of the cases' saved
objects. It uses the `actionsClient`, provided by the actions plugin, to
get all connectors and filter out the ones supported by cases. For that
reason, an API tag called `GET_CONNECTORS_CONFIGURE_API_TAG` is added to
the API to control access. If the user has access to any of the Cases
kibana privilege features (Security, Observability, or Stack) it will
have access to the API. This is an expected behavior and in the Security
serverless project, only one Case feature will be available.

#### Push Case API

The Push Case API already authorizes users by using the Cases RBAC. The
user should have the `push` operation set in the Cases Kibana feature
privilege to be able to use the API.

## Permissions

<meta charset="utf-8"><b style="font-weight:normal;"
id="docs-internal-guid-d1fea174-7fff-4f03-ed2e-9fc3ad3ed789"><div
dir="ltr" style="margin-left:0pt;" align="left">

Cases | Actions | Case Connectors | Outcome
-- | -- | -- | --
read | all | all | See the connector but cannot edit (current behavior)
read | all | none | Hide the connectors in Cases
read | read | all | See the connector but cannot edit (current behavior)
read | read | none | Hide the connectors in Cases
all | all | all | Full access
all | all | none | Hide the connectors in Cases
all | read | all | See the connector but cannot edit (current behavior)
all | read | none | Hide the connectors in Cases

</div><br /></b>

When the Actions is set to `none` all connector features are hidden

### How to test it?
#### ESS
* Run ESS and check if it still works as expected for all combinations
of cases and actions permissions.

#### Serverless
* Run Serverless with security essentials (serverless.security.yml) and
check if it works as expected for all combinations of cases and actions
permissions.

```
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'essentials' }
  ]


```
* Run Serverless with security complete (config/serverless.security.yml)
and check if it works as expected for all combinations of cases and
actions permissions.
```
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
  ]
 
 ```



### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
bryce-b pushed a commit to bryce-b/kibana that referenced this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:cloud-deploy Create or update a Cloud deployment Feature:Cases Cases feature Project:Serverless Work as part of the Serverless project for its initial release release_note:skip Skip the PR/issue when compiling release notes reverted Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.