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.
server/src/main/java/org/elasticsearch/common/Strings.java
public static boolean isAllOrWildcard(String[] data) {
        return CollectionUtils.isEmpty(data) || data.length == 1 && isAllOrWildcard(data[0]);
    }
    /**
     * Returns `true` if the string is `_all` or `*`.
     */
    public static boolean isAllOrWildcard(String data) {
        return "_all".equals(data) || "*".equals(data);
    }
    /**
     * Return a {@link String} that is the json representation of the provided {@link ToXContent}.
     * Wraps the output into an anonymous object if needed. The content is not pretty-printed
     * nor human readable.
     */
    public static String toString(ToXContent toXContent) {
        return toString(toXContent, false, false);
    }
    /**
     * Return a {@link String} that is the json representation of the provided {@link ChunkedToXContent}.
     * @deprecated don't add usages of this method, it will be removed eventually
     * TODO: remove this method, it makes no sense to turn potentially very large chunked xcontent instances into a string
     */
    @Deprecated
    public static String toString(ChunkedToXContent chunkedToXContent) {
        return toString(chunkedToXContent, false, false);
    }
    /**
     * Return a {@link String} that is the json representation of the provided {@link ToXContent}.
     * Wraps the output into an anonymous object if needed.
     * Allows to configure the params.