Commit Graph

6234 Commits

Author SHA1 Message Date
Jay Modi f5cd833af4 Use epoch millis for token expiration instead of ZonedDateTime (elastic/x-pack-elasticsearch#1417)
For user tokens, we were storing the expiration time as a date with the date time format in the
mappings. Occasionally, we would get CI failures due to parsing the date and having an invalid
format. This change simplifies the user tokens to simply use an Instant and convert it to the epoch
millis when we index the document. This eliminates the need for a date formatter and should ensure
we no longer have issues with parsing the dates.

Additionally, the TokenAuthIntegTests#testExpireMultipleTimes could fail if the token was expired
but the approximation for the expiration time was after the current time. In order to resolve this
we get the exact expiration time from the token and use that in the test.

relates elastic/x-pack-elasticsearch#1255

Original commit: elastic/x-pack-elasticsearch@d4bf53e7bc
2017-05-15 14:20:12 -06:00
Igor Motov 53753311f3 Move ReindexAction class to core (elastic/x-pack-elasticsearch#1426)
X-Pack counterpart of elastic/elasticsearch#24684

Relates to elastic/x-pack-elasticsearch#24578

Original commit: elastic/x-pack-elasticsearch@e5cd09cf4b
2017-05-15 14:29:17 -04:00
Lisa Cawley 4e8c7ad094 [DOCS] Add script_fields to ML data feed documentation (elastic/x-pack-elasticsearch#1372)
* [DOCS] Add script_fields to ML datafeed APIs

* [DOCS] Add datafeedresource.asciidoc to build.gradle

* [DOCS] Addressed feedback in PR 1372

Original commit: elastic/x-pack-elasticsearch@3404ca7850
2017-05-15 09:30:30 -07:00
Tanguy Leroux ffcee524c5 Make SignificantTerms.Bucket an interface rather than an abstract class
Related to elastic/elasticsearch#24670

Original commit: elastic/x-pack-elasticsearch@e5b0123fbc
2017-05-15 15:19:19 +02:00
Dimitris Athanasiou e36e2c604d [ML] Write updated model snapshot to its original index (elastic/x-pack-elasticsearch#1415)
When we update a model snapshot we need to write it back to
the exact index where we read it from. This is necessary
for rollover as otherwise we would end up with two different
versions of the same snapshot.

Relates elastic/x-pack-elasticsearch#827

Original commit: elastic/x-pack-elasticsearch@b5d1ab38a7
2017-05-15 12:00:15 +01:00
Tim Vernum 463133b7de [Security] Cross cluster wildcard security (elastic/x-pack-elasticsearch#1290)
Support the resolution of remote index names, including those that contain wildcards in the cluster name or index part)

Specifically these work:
- `GET /remote*:foo/_search`
- `GET /*:foo/_search`
- `GET /*:foo,*/_search`
- `GET /remote:*/_search`
- `GET /*:*/_search`

This change assumes that every user is allowed to attempt a cross-cluster search against any remote index, and the actual authorisation of indices happens on the remote nodes. Thus ` GET /*:foo/_search` will expand to search the `foo` index on every registered remote without consideration of the roles and privileges that the user has on the source cluster.

Original commit: elastic/x-pack-elasticsearch@b45041aaa3
2017-05-15 15:02:13 +10:00
Andrew Cholakian 6413dcd759 [Logstash] New mapping for pipeline viewer (elastic/x-pack-elasticsearch#573)
Add `logstash-states` + other mapping fields for logstash pipeline viewer
This is part of https://github.com/elastic/x-pack-logstash/pull/25

Original commit: elastic/x-pack-elasticsearch@1940d79d13
2017-05-12 18:31:59 -05:00
Jason Tedor 879b4457f3 Update Netty to 4.1.11.Final
This commit upgrades the Netty dependency from 4.1.10.Final to
4.1.11.Final.

Relates elastic/x-pack-elasticsearch#1418

Original commit: elastic/x-pack-elasticsearch@1944a6f5f9
2017-05-12 15:54:05 -04:00
Dimitrios Athanasiou 7293bcdc1c [TEST] Set data_description in MlTransportClientIT
Original commit: elastic/x-pack-elasticsearch@0d392d26d8
2017-05-12 18:51:38 +01:00
Dimitris Athanasiou 0ac38b05e4 [ML] Require job to have explicit data_description (elastic/x-pack-elasticsearch#1411)
relates elastic/x-pack-elasticsearch#1187

Original commit: elastic/x-pack-elasticsearch@aa2051f959
2017-05-12 17:24:27 +01:00
Alexander Reelsen 50e9e413da Watcher: Make watch history use doc type instead of watch_record (elastic/x-pack-elasticsearch#1311)
As this does not require any reindexing this is easy to fix by just
changing the watch history template.

In addition the old templates are deleted on start up and the new ones
are instantiated.

Original commit: elastic/x-pack-elasticsearch@7e1ad495ad
2017-05-12 16:52:57 +02:00
Jim Ferenczi de1d98b135 Adapt x-pack after the parent/child modularisation (elastic/x-pack-elasticsearch#1407)
This is the x-pack side of elastic/elasticsearch#24634
The hasChild, hasParent queries and the children agg are now in a module.

Original commit: elastic/x-pack-elasticsearch@e9b1296fc3
2017-05-12 15:59:40 +02:00
javanna 4f073cd4bd fix typo in AuthorizationService comment
Original commit: elastic/x-pack-elasticsearch@f747df0311
2017-05-12 11:18:01 +02:00
Simon Willnauer 0215356f12 Remove XPackDeleteByQueryAction BWC (elastic/x-pack-elasticsearch#1400)
5.5 will use delete by query from the module directly and has the
BWC layer in-place. This change therefore removes the BWC layer from 6.0

Relates to elastic/x-pack-elasticsearch#1378

Original commit: elastic/x-pack-elasticsearch@d4d4d6bc61
2017-05-12 10:19:21 +02:00
Tim Vernum 9f7f8ffb4d Outstanding docs for 5.4 changes (elastic/x-pack-elasticsearch#1280)
Docs for security features in 5.4

- `has_privileges` API
-  ldap metadata.

Original commit: elastic/x-pack-elasticsearch@22c733c814
2017-05-12 16:51:47 +10:00
Tim Vernum 441589e21f [DOCS] Clarify built-in and internal uses/roles (elastic/x-pack-elasticsearch#1269)
- Describe internal users (_system, _xpack)
- Explain that built-in users are not the same as native users
- More clarification around logstash_system role and kibana_system role.

Closes: elastic/x-pack-elasticsearch#734
Closes: elastic/x-pack-elasticsearch#268
Closes: elastic/x-pack-elasticsearch#1116

Original commit: elastic/x-pack-elasticsearch@2ecbd3419f
2017-05-12 15:41:44 +10:00
Simon Willnauer 2e34f160ff [TEST] Add ReindexPlugin to AutodetectResultProcessorIT
Original commit: elastic/x-pack-elasticsearch@acd19bf25c
2017-05-11 21:51:02 +02:00
Lee Hinman 8fe2ba02f2 [TEST] Use non-deprecated _key instead of _term for aggregation ordering
Otherwise the console doc tests fail due to the unexpected warning header

Original commit: elastic/x-pack-elasticsearch@598a191784
2017-05-11 12:26:31 -06:00
Simon Willnauer 891c2a6c3f Replace XPacks delete_by_query impl with the core impl (elastic/x-pack-elasticsearch#1378)
This can now be shared with core once elastic/elasticsearch#24578

Original commit: elastic/x-pack-elasticsearch@42bbd75aee
2017-05-11 20:23:55 +02:00
Nik Everett 3ad2da0d87 Fix ordering
Core changed how you specify bucket ordering so we need to change
too.

Original commit: elastic/x-pack-elasticsearch@73d09f64c7
2017-05-11 13:44:17 -04:00
Nik Everett 16aa600830 Fix http request round trip tests
I broke this by adding more randomization to core's randomTimeValue
method. Now it produces valid time values that don't round trip
properly over the XContent API. This change causes the test to skip
trying to round trip time these sorts of time values.

Original commit: elastic/x-pack-elasticsearch@dcdd588bdb
2017-05-11 13:29:33 -04:00
Lisa Cawley 711ee1e8d4 [DOCS] Add FAQ for ML rolling upgrade issue (elastic/x-pack-elasticsearch#1390)
* [DOCS] Add FAQ for ML rolling upgrade issue

* [DOCS] More info for ML rolling upgrade issue

Original commit: elastic/x-pack-elasticsearch@be195477b0
2017-05-11 09:24:59 -07:00
Dimitrios Athanasiou 9ccf617a95 [TEST] Add explanation for custom random time value in ChunkingConfigTests
Original commit: elastic/x-pack-elasticsearch@9e03fb833f
2017-05-11 16:26:00 +01:00
Dimitrios Athanasiou 2e1ac420d7 [TEST] Fix ChunkingConfigTests due to time value randomization
Original commit: elastic/x-pack-elasticsearch@c145b399b6
2017-05-11 16:04:38 +01:00
Dimitris Athanasiou ba40994b1f [ML] Separate read from write index for results (elastic/x-pack-elasticsearch#1397)
This is in preparation of introducing a write alias.
It adjusts all requests to persist results to do so
using a method that returns the write alias (even though
it currently returns the same as the read alias).

Relates elastic/x-pack-elasticsearch#827

Original commit: elastic/x-pack-elasticsearch@1358dd8dcf
2017-05-11 14:44:40 +01:00
jaymode 4d3bc71327 Test: randomly assign the superuser role in RunAsIntegTests
This commit updates the RunAsIntegTests to randomly assign the superuser role to the user that
is authenticating with the cluster but the request is being run as a different user. This provides
additional validation that the authorization errors are actually coming from the user the request
is running as and not due to the authenticating user's privileges.

Original commit: elastic/x-pack-elasticsearch@c6360d13e6
2017-05-11 09:18:57 -04:00
Dimitris Athanasiou 69f9fa8ae9 [ML] Map new fields as keywords in results index (elastic/x-pack-elasticsearch#1387)
Each job introduces new fields to the results index matching
the analysis terms. When the job is created, mappings for those
are added explicitly. However, when rollover is introduced, that
will not be the case. This commit prepares for that by adding
dynamic mapping of new fields as keyword.

Relates elastic/x-pack-elasticsearch#827

Original commit: elastic/x-pack-elasticsearch@8f6cd09a71
2017-05-11 13:47:31 +01:00
David Roberts c4c57e6497 [TEST] Unit test that ML handles configs with brackets in field names (elastic/x-pack-elasticsearch#1395)
Original commit: elastic/x-pack-elasticsearch@a1d12bc254
2017-05-11 10:54:39 +01:00
Tim Vernum f3d5cf229b Change user cache TTL to be based on write not access time (elastic/x-pack-elasticsearch#1373)
This was the behaviour in Shield 2.x, but it was accidentally changed during migration to X-Pack 5.x

Original commit: elastic/x-pack-elasticsearch@de0bf5e688
2017-05-11 14:02:57 +10:00
Ryan Ernst f59b71629a Fix user copied in SecurityContext.executeAfterRewritingAuthentication (elastic/x-pack-elasticsearch#1391)
Also added a unit test for this method

Original commit: elastic/x-pack-elasticsearch@637a865119
2017-05-10 18:00:04 -07:00
Dimitrios Athanasiou 25505fad95 [TEST] Add missing verification in AutoDetectResultProcessorTests
Original commit: elastic/x-pack-elasticsearch@22b620a947
2017-05-10 17:59:54 +01:00
Dimitris Athanasiou 49eb5ea136 [ML] Retrieve model snapshot via search (elastic/x-pack-elasticsearch#1376)
This removes the last remaining GET in JobProvider.

Relates elastic/x-pack-elasticsearch#827

Original commit: elastic/x-pack-elasticsearch@820344be67
2017-05-10 17:26:37 +01:00
Lisa Cawley 4e321cc409 [DOCS] Add ML high_median and low_median functions (elastic/x-pack-elasticsearch#1370)
Original commit: elastic/x-pack-elasticsearch@561f233f20
2017-05-10 08:46:14 -07:00
David Kyle 0c0961134d Fix compilation
Original commit: elastic/x-pack-elasticsearch@f4dc2c5ce7
2017-05-10 16:16:49 +01:00
David Kyle fdf86967ce [ML] Fix bug initialising ML MetaData (elastic/x-pack-elasticsearch#1386)
Slightly different to the commit I just reverted (elastic/x-pack-elasticsearch#1352)

Original commit: elastic/x-pack-elasticsearch@46339418ae
2017-05-10 16:06:13 +01:00
David Roberts 7a32304f2c [ML] Don't try to gracefully shut down the controller on unsupported platforms (elastic/x-pack-elasticsearch#1384)
It just wastes 20 seconds while we timeout trying to open named pipes that cannot
possibly have been created.

Original commit: elastic/x-pack-elasticsearch@4e447874f6
2017-05-10 16:03:16 +01:00
David Kyle 1994b42cd5 Revert "[ML] Fix bug initialising ML Metadata (elastic/x-pack-elasticsearch#1377)"
This reverts commit elastic/x-pack-elasticsearch@4e4923634a.

Original commit: elastic/x-pack-elasticsearch@3de80a1577
2017-05-10 15:56:49 +01:00
Hendrik Muhs c43ae014b4 Replace timestamp initialization 'now' to an explicit timestamp. (elastic/x-pack-elasticsearch#1383)
fixes build errors. Still ensures that the timestamp is set to 'now' if the parsed logfile misses it.

Original commit: elastic/x-pack-elasticsearch@cf60e8d76b
2017-05-10 16:17:30 +02:00
David Kyle d34192ff6f [ML] Fix bug initialising ML Metadata (elastic/x-pack-elasticsearch#1377)
* Fix bug initialising ML MetaData


Original commit: elastic/x-pack-elasticsearch@4e4923634a
2017-05-10 15:01:37 +01:00
Dimitris Athanasiou a5a44a2e2e [ML] Also revert quantiles and model_size_stats (elastic/x-pack-elasticsearch#1369)
When a model snapshot is reverted, we should also revert
quantiles and model_size_stats to the ones of the reverted
snapshot.

relates elastic/x-pack-elasticsearch#1342

Original commit: elastic/x-pack-elasticsearch@ddabe40470
2017-05-10 12:04:22 +01:00
David Roberts cd99024599 [ML] Validate job configs before transport (elastic/x-pack-elasticsearch#1375)
If invalid job configs are transported to the master node then the root
cause of the validation exception gets reported as a remote_transport_exception,
which is extremely confusing.

This commit moves the validation of job configurations to the first node that
handles the action.

Fixes elastic/x-pack-kibana#1172

Original commit: elastic/x-pack-elasticsearch@5ed59d2a6f
2017-05-10 10:55:16 +01:00
Tanguy Leroux f3b3df0911 [Test] Ensure monitoring indices are yellow in LocalExporterTests
Before searching for documents in monitoring indices, we need to ensure
that they exist and are available.

Original commit: elastic/x-pack-elasticsearch@29db55a1fe
2017-05-10 09:53:59 +02:00
Ryan Ernst 85deb1f8f7 Rename ScriptEngineService to ScriptEngine (elastic/x-pack-elasticsearch#1374)
This is the xpack side of elastic/elasticsearch#24574

Original commit: elastic/x-pack-elasticsearch@4d37021f6d
2017-05-10 00:47:39 -07:00
Hendrik Muhs c1016f3c3d [ML] simple log throttler for autodetect logging (elastic/x-pack-elasticsearch#1323)
Adds a simple log throttler for autodetect logging, summarizes log messages if
they repeat often in a short time period. Throttler gets disabled for debug logging.

relates to: https://github.com/elastic/machine-learning-cpp/issues/111

Original commit: elastic/x-pack-elasticsearch@6729b1fd7c
2017-05-10 09:25:05 +02:00
Ryan Ernst 940ca229aa Fix xpack test using deprecated setting
Original commit: elastic/x-pack-elasticsearch@f98d24782b
2017-05-09 17:32:50 -07:00
Ryan Ernst 1c3d907748 Reverse runAs user setup to store authenticated user inside runAs user (elastic/x-pack-elasticsearch#1371)
Original commit: elastic/x-pack-elasticsearch@8276662298
2017-05-09 13:49:14 -07:00
Jay Modi 590eea57ac Add a base security rest handler (elastic/x-pack-elasticsearch#1239)
This commit adds a base rest handler for security that handles the license checking in the security
apis. This was done previously in some rest handlers but not all and actually had issues where a
value would be returned but we may not have consumed all of the request parameters, which could
lead to a different response being returned than what we would have expected.

relates elastic/x-pack-elasticsearch#1236

Original commit: elastic/x-pack-elasticsearch@2f1100b64a
2017-05-09 14:47:11 -04:00
Lisa Cawley 2d8eb8fbf7 [DOCS] Add ML metric functions (elastic/x-pack-elasticsearch#1349)
* [DOCS] Add ML metric functions

* [DOCS] Remove beta note from ML metrics function

Original commit: elastic/x-pack-elasticsearch@0bd2e359ac
2017-05-09 08:58:42 -07:00
Chris Earle 7965def49c [TEST] Mark test with AwaitsFix for elastic/x-pack-elasticsearch#1353
Original commit: elastic/x-pack-elasticsearch@a9705d3816
2017-05-09 11:29:39 -04:00
Lisa Cawley b415d7b17e [DOCS] Add ML time functions (elastic/x-pack-elasticsearch#1355)
Original commit: elastic/x-pack-elasticsearch@fead652966
2017-05-09 08:23:08 -07:00