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

Template can be created with wildcard * in the name #43737

Closed
nerophon opened this issue Jun 28, 2019 · 1 comment · Fixed by #56170
Closed

Template can be created with wildcard * in the name #43737

nerophon opened this issue Jun 28, 2019 · 1 comment · Fixed by #56170
Assignees
Labels
>enhancement Team:Data Management Meta label for data/management team

Comments

@nerophon
Copy link

nerophon commented Jun 28, 2019

Elasticsearch version (bin/elasticsearch --version): Affect all versions currently

Description of the problem including expected versus actual behavior:
It is possible to create a new template with a wildcard in the name. My expectation is that this should be prevented, because it leads to difficulty deleting the template individually.

Steps to reproduce:

  1. Run: DELETE _template/test-*
  2. Run GET _template/test-*
  3. Observe there is no template named "test-*"
  4. Run:
PUT _template/test-*
{ 
  "order" : 10, 
  "index_patterns" : ["test-*"]
}
  1. Run:
PUT _template/test-inner-*
{ 
  "order" : 10, 
  "index_patterns" : ["test-inner-*"]
}
  1. Run GET _template/test-*
  2. Observe that there is a template named "test-" and "test-inner-"
  3. Run DELETE _template/test-*
  4. Run GET _template/test-*
  5. Observe that both "test-" and "test-inner-" are no longer present

This behaviour is verified on 6.6.2 and 6.7.0 and 7.6.1

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@rjernst rjernst added the Team:Data Management Meta label for data/management team label May 4, 2020
@dakrone dakrone self-assigned this May 4, 2020
dakrone added a commit that referenced this issue May 5, 2020
This commit changes the validation for V2 index and component templates to re-use the same
validation that V1 templates used. This includes things like invalid template names, index patterns,
etc.

This also adds validation that template names do not contain `*` and index patterns do not contain 
`:` (index names can't contain this regardless).

Supercedes #53970
Relates to #53101
Resolves #43737
Resolves #46045
dakrone added a commit to dakrone/elasticsearch that referenced this issue May 5, 2020
This commit changes the validation for V2 index and component templates to re-use the same
validation that V1 templates used. This includes things like invalid template names, index patterns,
etc.

This also adds validation that template names do not contain `*` and index patterns do not contain
`:` (index names can't contain this regardless).

Supercedes elastic#53970
Relates to elastic#53101
Resolves elastic#43737
Resolves elastic#46045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Team:Data Management Meta label for data/management team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants