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

[UII] Support integration policies without agent policy references (aka orphaned integration policies) #190649

Merged
merged 23 commits into from
Aug 28, 2024

Conversation

jen-huang
Copy link
Contributor

@jen-huang jen-huang commented Aug 15, 2024

Summary

Resolves #182220.

This PR allows integration polices to be saved without being added to any agent policies. These integration policies can be considered "orphaned." Through the API, an empty policy_ids: [] array can be passed during create operations to add it to no agent policies. The same empty array can be passed during update operations to clear it from all previous agent policies. Clearing agent policies references this way will also set the deprecated policy_id field to null.

Clearing agent policy references requires the same licensing as the general reusable integration policies feature.

I spotted a bug where removing one or more agent policy references does not bump their revision. Revision was only bumped for only newly added references This has been fixed in this PR as well.

On the UI side, orphaned integration policies can only be discovered on the Integrations details > Policies table:

image

Agent policies can be unattached in the manage agent policies modal:

image

Integration policy create/edit form allows agent policies field to be cleared, with a confirmation modal as a heads up to the user. If the user previously had agent policies attached, and is now clearing it, the normal This action will update the selected agent policies will be shown:

image

Checklist

@jen-huang jen-huang added release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0 labels Aug 15, 2024
@jen-huang jen-huang self-assigned this Aug 15, 2024
@jen-huang jen-huang requested a review from a team as a code owner August 15, 2024 22:11
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@jen-huang
Copy link
Contributor Author

@kilfoyle I'm not sure what the overall state of docs for reusable integration policies is, but wanted to ping you about this change in case we should document this ability.

@kilfoyle
Copy link
Contributor

Thanks for the ping, @jen-huang! Docs issue is here and I should get to both this and the reusable integrations policies docs this week (or early next).

Btw, thanks a lot for providing the screencaps and so much detail in this and your other PRs! 🙏 It helps me so much not having to track this stuff down.

@jen-huang jen-huang requested review from a team as code owners August 21, 2024 21:24
Copy link
Contributor

@gergoabraham gergoabraham left a comment

Choose a reason for hiding this comment

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

played around with Elastic Defend integration, adding/removing integrations to agent policies and checked how the @elastic/security-defend-workflows related pages work.

thanks for the modifications, everything looks good! found some weird stuff on our onboarding page, but looks like it wasn't perfect before as well with multiple policy ids, so i created a follow up issue for @elastic/security-defend-workflows team: https://github.com/elastic/security-team/issues/10362

cc @dasansol92 @caitlinbetz

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #67 / Cloud Security Posture Test adding Cloud Security Posture Integrations CSPM AZURE Azure Single Manual Service Principle with Client Secret Azure Single Manual Service Principle with Client Secret Workflow
  • [job] [logs] Jest Tests #16 / useSetupTechnology should update new agent policy and selected policy tab when setup technology is agent-based

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
fleet 1.8MB 1.8MB +1.5KB
securitySolution 18.0MB 18.0MB +25.0B
total +1.5KB
Unknown metric groups

References to deprecated APIs

id before after diff
securitySolution 474 476 +2

History

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

cc @jen-huang

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kilfoyle kilfoyle left a comment

Choose a reason for hiding this comment

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

LGTM for the docs! 👍

@jen-huang jen-huang merged commit c9d8292 into elastic:main Aug 28, 2024
49 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Aug 28, 2024
@jen-huang jen-huang deleted the feat/orphaned-integration-policies branch August 28, 2024 16:54
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 release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support integration policies without agent policy references
8 participants