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

[Fleet] Specify which variables should be configurable for an integration per policy #96319

Closed
ruflin opened this issue Apr 6, 2021 · 9 comments · Fixed by #97163
Closed
Assignees
Labels
Feature:Fleet Fleet team's agent central management project Team:Fleet Team label for Observability Data Collection Fleet team v7.13.0

Comments

@ruflin
Copy link
Member

ruflin commented Apr 6, 2021

With #94509 an API endpoint in Kibana was introduced to preconfigure packages and setup the stack. In the scenario that the stack is setup from an external call, it is likely that some of the variables preconfigured should not be modified. An example of this is the policy with Fleet Server in Elastic Cloud. Users should not be able to modify the host and port as it is constant and otherwise would break the setup. Same for the APM integration. At the same time, there might be second policy with APM inside where all these variables are available.

To make this possible, the preconfigure API should be extended to all to specify as part of the policy creation, which fields should be editable and which ones not.

@ruflin ruflin added the Team:Fleet Team label for Observability Data Collection Fleet team label Apr 6, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@Zacqary
Copy link
Contributor

Zacqary commented Apr 14, 2021

Is there any precedent in the UI for some fields on a policy being editable and some being disabled? Wondering if there's an existing system I can hook this into, or if I'll have to build that from scratch.

@ruflin
Copy link
Member Author

ruflin commented Apr 14, 2021

@jfsiii Recently worked on some parts with the managed policy which might contain something similar? @jen-huang Are you aware of anything here?

@jen-huang
Copy link
Contributor

Restrictions on a managed policy is not field-specific, rather the entire policy cannot be changed which is simple from a technical standpoint. This will be more complex and we don't have an existing system to do this yet, off the top of my head I wonder if we can add a new field to the vars we save on package policies called writable: true and read that in the UI.

In my head, by default all vars in a pre-configured policy are not writable, so this flag acts as an allowlist.

@jen-huang
Copy link
Contributor

@ruflin @ph I've heard that in some use cases an allowlist of fields makes more sense but in other cases a blocklist is better. Which one should we go with for implementation?

@ruflin
Copy link
Member Author

ruflin commented Apr 14, 2021

I would go with writable: true by default. In general a user should be able to use all configurations by default. Only very few fields should be restricted.

@Zacqary
Copy link
Contributor

Zacqary commented Apr 14, 2021

In the PR I've opened I've implemented a blocklist using a field of frozen: true. I can change the name of this field to writable instead if we prefer that.

@ph
Copy link
Contributor

ph commented Apr 14, 2021

@Zacqary @ruflin I am OK with that strategy and I do not see the need to change it.

@jen-huang
Copy link
Contributor

jen-huang commented Apr 14, 2021

Thanks, blocklist it is then. @Zacqary Personally I prefer writable: false but no strong opinion. Edit: checking truthy value > falsy, so nvm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Fleet Fleet team's agent central management project Team:Fleet Team label for Observability Data Collection Fleet team v7.13.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants