We allow characters in the ID of an ILM policy that will result in an invalid snapshot name.

For example, an ILM policy with the name `mypolicy-*` can be created, however, the generation of the snapshot name in this line:

https://github.com/elastic/elasticsearch/blob/befb6faafc9fca327fd3cea2d0ab328a521c4e65/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java#L81

Results in the `mypolicy-*` being part of the snapshot name, which the snapshot service then disallows. We should strip these invalid characters from the snapshot name.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java
}
    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), snapshotRepository);
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        GenerateSnapshotNameStep other = (GenerateSnapshotNameStep) obj;
        return super.equals(obj) && Objects.equals(snapshotRepository, other.snapshotRepository);
    }
    /**
     * Since snapshots need to be uniquely named, this method will resolve any date math used in
     * the provided name, as well as appending a unique identifier so expressions that may overlap
     * still result in unique snapshot names.
     */
    public static String generateSnapshotName(String name) {
        return generateSnapshotName(name, new IndexNameExpressionResolver.ResolverContext());
    }
    public static String generateSnapshotName(String name, IndexNameExpressionResolver.Context context) {
        String candidate = IndexNameExpressionResolver.resolveDateMathExpression(name, context.getStartTime());
        
        return candidate + "-" + UUIDs.randomBase64UUID().toLowerCase(Locale.ROOT);
    }
    @Nullable