[RAC][Rule Registry] Namespaces that are prefixes of other namespaces can cause unexpected behaviors #107704
Labels
Team:Detections and Resp
Security Detection Response Team
Team: SecuritySolution
Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
Theme: rac
label obsolete
Background
Currently the RAC index naming scheme is
.alerts-{registrationContext}.{datasetSuffix}-{namespace}
, where {namespace} is a user defined string that allows admins to arbitrarily segment alerts by index. The security solution will store space IDs in {namespace} to provide continuity with the existing.siem-signals-<space id>
index naming scheme.After we update the rule registry to add the necessary index template per namespace (draft PR) the index pattern defined in the index template generated for a particular index alias will be
.alerts-{registrationContext}.{datasetSuffix}-{namespace}-*
so that the index template will be applied to all concrete indices that are created for the alias, e.g..alerts-{registrationContext}.{datasetSuffix}-{namespace}-000001
.Namespace conflicts
The problem is that the trailing
*
on the index pattern means namespace pairs where one is a prefix of the other will both match the same pattern. For example, if 2 namespaces weremanagers
andmanagers-usa
, then the index patterns would be.alerts-security.alerts-managers-*
and.alerts-security.alerts-managers-usa-*
. Concrete indices for themanagers-usa
namespace would match both patterns and without setting a priority on the index templates there's no way to pick which template to apply. Elasticsearch disallows even creating index templates with the same priority where the patterns overlap like this.There are a number of ways we could choose to address this problem:
We should keep an eye out for other areas where we use a trailing
-*
on index patterns, since with the user defined {namespace} on the end of the index it's very possible for this sort of pattern to lead to unexpected behaviors.The text was updated successfully, but these errors were encountered: