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] Adding integration: List of strings does not allow value ['*'] #91401

Closed
simitt opened this issue Feb 15, 2021 · 3 comments · Fixed by #91418
Closed

[Fleet] Adding integration: List of strings does not allow value ['*'] #91401

simitt opened this issue Feb 15, 2021 · 3 comments · Fixed by #91418
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team v7.12.0 v8.0.0

Comments

@simitt
Copy link
Contributor

simitt commented Feb 15, 2021

Kibana version:
master

Describe the bug:
When defining a package spec with type: string and multi: true, defining a (default) value of ['*'] is forbidden.
This needs to be allowed, as e.g. it is required for APM allowed origins.

Steps to reproduce:
0. Check out elastic/apm-server#4690

  1. Run APM package defined in [apmpackage] Add config options supported in ESS apm-server#4690 (e.g. by running apm-integration-testing with command ./scripts/compose.py start master --no-apm-server --with-package-registry --package-registry-apm-path=<your-path-to-apm-server>/apmpackage/apm --with-elastic-agent)
  2. Try to Install APM integration with ['*'] as value for RUM - Allow Origins.

Expected behavior:
Any kind of string should be allowed.

Screenshots (if relevant):

Screenshot 2021-02-15 at 14 13 28

@simitt simitt added bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team labels Feb 15, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@skh
Copy link
Contributor

skh commented Feb 15, 2021

It seems we're running into the rarely-used YAML feature of aliases here, which start with a *, see

http://blogs.perl.org/users/tinita/2019/05/reusing-data-with-yaml-anchors-aliases-and-merge-keys.html

When the YAML parser encounters the single * it complains about the missing alias name which should come directly after it.

If we ever want to use & we'll run into a similar problem

I can prepare a fix where we escape * and &, but I'm not sure this is the correct behaviour -- what if we do want to use YAML aliases after all?

@nchaulet
Copy link
Member

I think we should probably escape the * we already do it for number string we could probably have a better escaping function here: https://github.com/elastic/kibana/blob/master/x-pack/plugins/fleet/server/services/epm/agent/agent.ts/#L93-L97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants