[Fleet] Validate asset files to match patterns from spec #115386
Labels
bug
Fixes for quality problems that affect the customer experience
Team:Fleet
Team label for Observability Data Collection Fleet team
While adding a new asset type
tag
to kibana assets here #114110, it turned out that there is no validation of asset file patterns according to the spec: https://github.com/elastic/package-spec/blob/1e17043c2cf746e7c0168594e51824c903c00e35/versions/1/kibana/spec.yml#L94Add a check when installing assets to only include files that match the pattern from the spec.
For example:
pattern:
'^{PACKAGE_NAME}-.+.json$'`Rationale, as @mtojek explained:
I can explain why there is the PACKAGE_NAME prefix. Two different packages install their assets and it may happen that they both refer to the same "magic-asset-1". In this case the first installed one will be overridden with the other one, so we want to prevent it using package name prefixes.
The text was updated successfully, but these errors were encountered: