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 Threat Intelligence #162562

Merged
merged 7 commits into from
Aug 1, 2023

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Jul 26, 2023

Summary

Add PLI authorization checks for the Intelligence page.
This PR restricts access to the features and creates a simplified Upselling page.

  • Rename threat_intelligence-indicators page name to threat_intelligence to simplify the code

Not included

  • Final Upselling/PLG design

How to test it?

ESS yarn start

  • Run ESS with a basic license
    • It should not change
  • Run ESS with a platinum
    • It should not change

Serverless yarn serverless-security

  • Run Serverless with security essentials (serverless.security.yml)
    • It should show the new Threat Intelligence Upsell
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'essentials' }
  ]
  • Run Serverless with security complete (kibana/config/serverless.security.yml)
    • It should show the Therat Intelligence page
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
  ]
 
Screenshot 2023-07-26 at 15 59 52

Checklist

Delete any items that are not applicable to this PR.

@machadoum machadoum force-pushed the siem-explore-threat-intell-pli branch from 9f3b3cf to fe410d5 Compare July 26, 2023 14:22
@machadoum machadoum self-assigned this Jul 26, 2023
@machadoum machadoum added Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore v8.10.0 Project:Serverless Work as part of the Serverless project for its initial release labels Jul 26, 2023
@machadoum machadoum force-pushed the siem-explore-threat-intell-pli branch from fe410d5 to 13d9cf2 Compare July 26, 2023 15:02
@@ -85,10 +85,10 @@ const ThreatIntelligence = memo(() => {
};

return (
<TrackApplicationView viewId="threat_intelligence">
<SecurityRoutePageWrapper pageName={SecurityPageName.threatIntelligence}>
Copy link
Member Author

Choose a reason for hiding this comment

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

SecurityRoutePageWrapper is necessary for displaying the Upsell page.

@machadoum machadoum marked this pull request as ready for review July 27, 2023 08:01
@machadoum machadoum requested review from a team as code owners July 27, 2023 08:01
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@machadoum machadoum added the release_note:skip Skip the PR/issue when compiling release notes label Jul 27, 2023
@angorayc
Copy link
Contributor

Thank you Pablo, tested locally, LGTM!

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

tested LGTM, though I've got a couple of questions related to code consistency between ESS and Serverless

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not aware of how we're going to handle things for ESS and Serverless, but I'm wondering why do we duplicate this component here? We already have a paywal component in the Threat Intelligence plugin. Shouldn't we make that one smarter and handle both ESS and Serverless?
With the current approach, we basically make the paywall component within the Threat Intelligence plugin useless when loaded in serverless mode... but the component is still there.
It seems confusing to me that we'd have similar things in different places

Copy link
Member Author

Choose a reason for hiding this comment

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

The approaches to authorization for ESS and Serverless are fundamentally different. ESS has several "if platinum" checks throughout the app, whereas Serverless has a centralized, privilege-based system. We can utilize the security_solutions_serverless plugin to register Upselling pages or components and retrieve them with hooks when the page is unauthorized.

While it's possible to repurpose the paywal component (if it's accessible on the serverless plugin) and make it more intelligent, the UX team is still working on the final design for serverless Upselling. It's conceivable that there will be a generic Upselling component for all features, so I don't believe it's necessary to refactor the paywal component at this time. But we need to revisit this decision after the designs are ready.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand, thanks for explaining!

I think ultimately we should aim at having a similar way to manage these paywall between ESS and Servesless, but I guess this is a discussion for another time :D

Copy link
Member Author

Choose a reason for hiding this comment

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

I am currently implementing your suggestion at the following PR: #163406.

@machadoum machadoum enabled auto-merge (squash) July 28, 2023 13:26
@machadoum
Copy link
Member Author

@elasticmachine merge upstream

@machadoum machadoum merged commit b95241f into elastic:main Aug 1, 2023
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Investigations - Security Solution Cypress Tests #1 / Alert details expandable flyout right panel overview tab insights section should display threat intelligence section should display threat intelligence section
  • [job] [logs] Threat Intelligence Cypress Tests #1 / Empty Page should render the empty page with link to docs and integrations, and navigate to integrations page

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolutionServerless 230 232 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 15.6MB 15.6MB -32.0B
securitySolutionServerless 101.9KB 103.4KB +1.6KB
total +1.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 57.3KB 57.3KB +22.0B
securitySolutionServerless 23.1KB 23.5KB +360.0B
threatIntelligence 27.3KB 27.3KB -11.0B
total +371.0B
Unknown metric groups

async chunk count

id before after diff
securitySolutionServerless 19 20 +1

ESLint disabled line counts

id before after diff
securitySolutionServerless 19 20 +1

Total ESLint disabled count

id before after diff
securitySolutionServerless 19 20 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @machadoum

@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Aug 1, 2023
ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
…lastic#162562)

## Summary

Add PLI authorization checks for the Intelligence page.
*This PR restricts access to the features* and creates a simplified
Upselling page.
* Rename `threat_intelligence-indicators` page name to
`threat_intelligence` to simplify the code

### Not included
* Final Upselling/PLG design

### How to test it?
#### ESS `yarn start`
* Run ESS with a basic license
  * It should not change
* Run ESS with a platinum
  * It should not change
  
#### Serverless `yarn serverless-security`
* Run Serverless with security essentials (serverless.security.yml)
   * It should show the new Threat Intelligence Upsell
```
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'essentials' }
  ]
```
* Run Serverless with security complete
(kibana/config/serverless.security.yml)
  * It should show the Therat Intelligence page
```
xpack.serverless.security.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
  ]
 
 ```


<img width="1785" alt="Screenshot 2023-07-26 at 15 59 52" src="https://github.com/elastic/kibana/assets/1490444/e8fb1bb4-ec26-477d-80e0-aecd4c15e7a2">



### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ] [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
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 Project:Serverless Work as part of the Serverless project for its initial release release_note:skip Skip the PR/issue when compiling release notes 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.

6 participants