-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] configure default policy for agent and fleet server from kibana config #96370
Comments
Pinging @elastic/fleet (Team:Fleet) |
Maybe we should have a prefix? What will happen if a user deletes a policy that was set up through the config. It it automatically be recreated? @nchaulet You mention it will replace the hardcoded policies. I assume we still have in the code some hardcoded policies but in the above format instead? |
Is this issue about enabling all functionality of the Preconfiguration API in
If we parse the config during plugin setup, then no, it won't be recreated. Is that okay, or do we want to recreate policies that get deleted? |
This issue is about using the |
Are there any cases when the initial plugin setup would run again, without a fresh reinstall of Kibana? If so then we might need to add some extra stuff to ensure a policy can't be recreated. |
In the Cloud case, the /setup call will be made every a fleet-server is spun up. But not sure if this is the same you mentioned with the initial plugin setup? |
I'm talking about the |
the |
All right so it turns out I was mistaken, the policy does get recreated when the user reloads the UI. Must have misremembered the way I tested it before. I'll find a way to make sure we can permanently delete a policy without changing the config. |
kibana/x-pack/plugins/fleet/server/services/setup.ts Lines 58 to 63 in e6e3b16
It's safe to call them repeatedly, but they don't need to do something each time. The |
It would be good to write down the expected behaviours in the different scenarios. For example in the upgrade case: We have a package |
@ruflin Should we only automatically update package policies for managed policies, or for all preconfigured policies? |
@Zacqary Good question, what would you recommend? |
What's the current behavior, for policies that aren't created through preconfiguration? Do managed policies automatically upgrade their integrations? Do non-managed policies ask the user to do it manually? I think we should replicate however policies are supposed to behave already. |
There is currently not difference between managed and not managed. @jen-huang @nchaulet Your view would be great here. |
what we currently have is kind of confusing we automatically update the defaults package, but we do not update the default policy. I think we can easily replicate that by adding a flag to the packages:
- name: system
auto_upgrade: true we could potentially add this to the agent policy too but it will be an additional feature different from what we currently have, should we add it to the policy level or per package? agentPolicies:
- name: Policy 1
auto_upgrade: true |
I can do the It feels like a bug that the user can go to the package on the Integrations page, see that an update is available, click Update, and have this not also automatically update all the agent policies. Whatever installed version the Integrations page says there is feels like it should be the universal source of truth. Is there a reason why a user would not want their agent policy to be auto-upgraded, is my thinking? |
Talked with @ph and it turns out functionality related to I don't think we need to do anything specific for preconfigured policies, as solving this issue would also apply to every other agent policy. Adding |
Description
For cloud we need to be able to configure how default policies are created, as the default policy for fleet server need to be hosted and to not allow all the modifications. This could be nice too as he allow end user to configure policy from kibana config.
For this we will configure policies in kibana config (see this reverted commit edc5cf7) than the policies will be created when the user visit the fleet plugin or call the existing
/api/fleet/setup
This will replace the hardcoded creation of the default agent and fleet server policy instead we will have a default config that create theses policies but in cloud different agent policies could be provided.
Kibana config
We could use the key
xpack.fleet.policies:
(open to suggestions)Existing default policy
we need to migrate the existing default policy to this we probably just have to add a
preconfiguration_id
I discussed this with @Zacqary and looks like the preconfigure service will work without problem here.
The text was updated successfully, but these errors were encountered: