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

[SecuritySolution] Disable K8S link on serverless #204350

Closed
wants to merge 8 commits into from

Conversation

semd
Copy link
Contributor

@semd semd commented Dec 16, 2024

Summary

The approach uses offeringSettings config to disable that in serverless.

Approach

Make services.configSettings.defendForContainersEnabled flag available inside the getFilteredLinks function to remove the kubernetes link when disabled.
To do so I needed to change the parameters received by the getFilteredLinks function. Now it takes the whole StartServices object, instead of CoreStart and PluginsStart separately.

Side effects

  • Existing getManagementFilteredLinks has been refactored to take services, and the test has been updated.
  • The generateServices function now caches the generated StartServices, this was done to prevent services from being initialized multiple times.

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 16, 2024

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

): Promise<LinkItem> => {
const fleetAuthz = plugins.fleet?.authz;
const currentUser = await plugins.security.authc.getCurrentUser();
export const getManagementFilteredLinks = async (services: StartServices): Promise<LinkItem> => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed core: CoreStart, plugins: StartPlugins parameters by services: StartServices.

@semd
Copy link
Contributor Author

semd commented Dec 16, 2024

Files by Code Owner

elastic/kibana-cloud-security-posture

  • x-pack/plugins/security_solution/public/kubernetes/routes.tsx

elastic/kibana-core

  • config/serverless.security.yml

elastic/kibana-security

  • config/serverless.security.yml

elastic/security-defend-workflows

  • x-pack/plugins/security_solution/public/management/links.test.ts
  • x-pack/plugins/security_solution/public/management/links.ts

elastic/security-solution

  • x-pack/plugins/security_solution/common/config_settings.ts
  • x-pack/plugins/security_solution/common/experimental_features.ts
  • x-pack/plugins/security_solution/public/app_links.ts
  • x-pack/plugins/security_solution/public/dashboards/links.ts
  • x-pack/plugins/security_solution/public/kubernetes/routes.tsx
  • x-pack/plugins/security_solution/public/management/links.test.ts
  • x-pack/plugins/security_solution/public/management/links.ts
  • x-pack/plugins/security_solution/public/plugin.tsx
  • x-pack/plugins/security_solution/public/plugin_services.ts
  • x-pack/plugins/security_solution/public/types.ts

elastic/security-threat-hunting-explore

  • x-pack/plugins/security_solution/public/dashboards/links.ts

@semd
Copy link
Contributor Author

semd commented Dec 16, 2024

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 16, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #13 / AgentBasedPackagePoliciesTable renders the table with package policies
  • [job] [logs] FTR Configs #9 / console app console app tabs navigation tabs should be navigable through URL
  • [job] [logs] FTR Configs #9 / console app console app tabs navigation tabs should be navigable through URL

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 14.7MB 14.7MB +103.0B

Page load bundle

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

id before after diff
securitySolution 88.0KB 88.2KB +193.0B

History

@semd
Copy link
Contributor Author

semd commented Dec 16, 2024

@elasticmachine merge upstream

@semd semd closed this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants