Search .kibana-devnull rather than -*

There are too many edge cases when using shield and searching against
the index pattern -*, some of which seem impractical to resolve in the
short term. Instead, we query against the non-existent index
.kibana-devnull, which the default kibana privileges in shield will
allow.

Note: This assumes that .kibana-devnull either does not exist or is
empty.

Fixes #5765
This commit is contained in:
Court Ewing 2015-12-23 10:29:44 -05:00 committed by Rashid Khan
parent dd04615dc0
commit 300482330d
2 changed files with 3 additions and 3 deletions

View file

@ -103,11 +103,11 @@ describe('ui/courier/fetch/strategy/search', () => {
context('when indexList is empty', () => {
beforeEach(() => reqsFetchParams[0].index = []);
it('explicitly negates any indexes', () => {
it('queries .kibana-devnull instead', () => {
let value;
search.reqsFetchParamsToBody(reqsFetchParams).then(val => value = val);
$rootScope.$apply();
expect(_.includes(value, '"index":["-*"]')).to.be(true);
expect(_.includes(value, '"index":[".kibana-devnull"]')).to.be(true);
});
});
});

View file

@ -57,7 +57,7 @@ define(function (require) {
// handle that request by querying *all* indexes, which is the
// opposite of what we want in this case.
if (_.isArray(indexList) && indexList.length === 0) {
indexList.push('-*');
indexList.push('.kibana-devnull');
}
return angular.toJson({
index: indexList,