-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Fleet] Add support_agentless property in agent policy schema and preconfiguration #182709
[Fleet] Add support_agentless property in agent policy schema and preconfiguration #182709
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
/ci |
… src/core/server/integration_tests/ci_checks'
@elasticmachine merge upstream |
/ci |
Pinging @elastic/fleet (Team:Fleet) |
PR needed in preparation for #180375. I originally thought to group the changes in a single PR but the changeset would become too big. |
x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy.yaml
Outdated
Show resolved
Hide resolved
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.
LGTM for the docs part. 👍
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.
Code + tests LGTM. Thanks for splitting this up into separate PR's 🚀
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.
SO mapping changes LGTM
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.
LGTM!
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
History
To update your PR or re-run it, just comment with: cc @criamico |
Closes #180375 ## Summary Expand support for Agentless in Fleet UI. Implemented on this PR: - Agent policies created with `supports_agentless` (added in #182709) are now marked as `is_managed` - Added support for `deployment_modes.agentless.enabled` and `hide_in_deployment_modes` introduced with elastic/package-spec#684: - `hide_in_deployment_modes` shows/hides variables in agentless/default UI - `deployment_modes.agentless.enabled: true` determines an integration as enabled for agentless ## Notes - In this PR, an integration enabled for serverless is still added to the default `agentless` policy. - Integrations enabled for agentless don't display any specific "agentless" form yet. That part is TBD ### Testing - Run local env for [agentless](https://docs.elastic.dev/security-solution/cloud-security/agentless) ### Verify that new settings are honoured in integration policy - Use the compiled package with new properties defined in elastic/package-spec#738 `agentless_test_package-1.0.1-rc1.zip` (Packages in this [comment](#183045 (comment))) - Upload it to Kibana: ```sh curl -k -XPOST -H 'content-type: application/zip' -H 'kbn-xsrf: true' https://localhost:5601/api/fleet/epm/packages -u elastic_serverless:changeme --data-binary @agentless_test_package-0.0.1.zip ``` - Check that the variable marked with `hide_in_deployment_modes: "agentless"` are not visible - Check that the agent policies selector is not visible ![Screenshot 2024-05-22 at 10 37 42](https://github.com/elastic/kibana/assets/16084106/02f12ebf-f448-4cfa-b9e7-8cb1a1226e5e) ### Verify that agent policies with `supports_agentless` are marked as managed - Create a new policy with `supports_agentless` ``` POST kbn:/api/fleet/agent_policies { "name": "Test - Agentless policy", "namespace": "default", "supports_agentless": true } ``` - Check that the created policy has `is_managed = true` - Try to change the value to false - an error is thrown ``` PUT kbn:/api/fleet/agent_policies/<policy_id> { "name": "Test - Agentless policy", "namespace": "default", "supports_agentless": false } ``` ### Checklist - [ ] 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) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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>
Closes #180377
Summary
Add a new
support_agentless
property in agent policy and in preconfiguration; this property is only allowed when the environment has bothisServerless
set totrue
andagentless
feature flag enabled, otherwise policy creation/update will throw errorsupports_agentless is only allowed in serverless environments that support agentless feature
.No UI change is required for now as this property will be needed as part of a wider support to agentless policies.
Testing
Serverless
agentless
feature flag enabledsupport_agentless
property:GET kbn:/api/fleet/agent_policies
:agentless
feature flag is disabled, any of the above will throw an error.Stateful
Spin up a stateful env and verify that all of the previous commands fail with
400
and above error message.Checklist