Commit Graph

3393 Commits

Author SHA1 Message Date
Chris Earle d1e08c5dd4 [Security] Log Deprecation Warnings for old API usage
This makes use of the registerAsDeprecatedHandler method to automatically warn users when they're using deprecated functionality.

This will also automatically provide a Warning header for anyone using HTTP clients (though they have to be looking for it...).

Security portion only

Original commit: elastic/x-pack-elasticsearch@ab1a50fe06
2016-07-07 12:10:35 -04:00
Robert Muir 0b52cedf60 Merge pull request elastic/elasticsearch#2736 from rmuir/fls_cache
support lucene query cache when using FLS

Original commit: elastic/x-pack-elasticsearch@5b7054b702
2016-07-07 12:06:31 -04:00
Robert Muir 3a0aa13127 support lucene query cache when using FLS
Original commit: elastic/x-pack-elasticsearch@d1e8b9605d
2016-07-07 10:28:10 -04:00
Alexander Reelsen a4fe1da401 Tests: Fix xpack usage stats rest test
Original commit: elastic/x-pack-elasticsearch@cc6d2b9a35
2016-07-07 15:50:51 +02:00
Tanguy Leroux f861bb1661 MockScriptEngine and associated plugin has changed in ES core
Original commit: elastic/x-pack-elasticsearch@bb31b7b7c9
2016-07-07 15:27:04 +02:00
Alexander Reelsen 2c31e343b0 Watcher: Add usage stats
This adds the following stats to the usage stats

* Across all active watches
  * Number of triggers per type
  * Number of inputs per type
  * Number of transforms per type
  * Number of conditions per type
  * Number of actions per type
* Total number of watches
* Total number of active watches
* Per action
  * Execution time total
  * Execution time mean
  * Invocation count
* Total use of watch metadata

Internally this uses a `Counters` helper class, so that creating counters does not require
you to decide about the map structure.

Relates elastic/elasticsearch#2210

Original commit: elastic/x-pack-elasticsearch@e6f95ba290
2016-07-07 14:45:00 +02:00
Robert Muir 5f52d74fb0 Merge pull request elastic/elasticsearch#2720 from rmuir/denied_fields
support negated set (denied fields) in FieldSubsetReader

Original commit: elastic/x-pack-elasticsearch@0544ff2bf7
2016-07-06 23:28:01 -04:00
Robert Muir 2583e9cd97 support negated set (denied fields) in FieldSubsetReader
Original commit: elastic/x-pack-elasticsearch@0a54417175
2016-07-06 16:58:03 -04:00
Chris Earle dbe189b064 [Monitoring] Decouple Kibana Stats Publishing from Application Version
This changes the way that Kibana (and future applications) send their monitoring stats to Elasticsearch.

Instead of sending their payloads with the System ID (e.g., "kibana") and System Version (e.g., "5.0.0-alpha4"), it now expects the System ID and System _API_ Version (e.g., "2"). This means a few things:

- Future releases are automatically compatible with previous releases as long as the API version doesn't change.
- Users don't have to update Kibana at the exact same time as their cluster (which technically means rolling updates were temporarily blockers of Kibana monitoring before).
- We can accept old API versions (if we need to make a breaking change) and automatically up-convert them to the latest API version. (We are in full control of how far back we choose to accept)

In general, this change implies that users should be updating their Monitoring cluster before their _monitored_ cluster(s) to get the best opportunity of monitoring backwards compatibility. That way if any API change does occur, then it can up-convert as needed. Then, any ES node should be updated, and only then should Kibana be updated. This is not required in any way, but it will give the smoothest experience.

Original commit: elastic/x-pack-elasticsearch@d3c24936e1
2016-07-06 11:24:22 -04:00
Chris Earle acaefe89fa [Security] Check CryptoService for null before using
While testing another PR, I noticed that when Security is disabled, the _xpack/usage API throws a NullPointerException.

This checks for null before using it, and adds tests to verify behavior.

Original commit: elastic/x-pack-elasticsearch@6474af6569
2016-07-06 11:20:03 -04:00
Ryan Ernst 5f1fca4070 Merge pull request elastic/elasticsearch#2693 from rjernst/less_drugs
Remove WatcherSettingsValidation service

Original commit: elastic/x-pack-elasticsearch@bed651ce6a
2016-07-05 20:48:28 -07:00
Ryan Ernst dec8319d77 Merge branch 'master' into less_drugs
Original commit: elastic/x-pack-elasticsearch@fde8483759
2016-07-05 20:48:12 -07:00
Jason Tedor 3577389f95 Rename writeThrowable to writeException
This commit is a response to upstream change
elastic/elasticsearch@96f283c195.

Original commit: elastic/x-pack-elasticsearch@2e485d4e76
2016-07-05 14:46:50 -04:00
Adrien Grand 5533470959 master is now 5.0.0-alpha5
Original commit: elastic/x-pack-elasticsearch@ce2a255cde
2016-07-05 15:27:27 +02:00
jaymode e861608c59 security: extend usage stats
This commit extends the usage stats to include the usage of ssl, ip filtering, auditing,
system key, field and document level security, and the number of roles.

See elastic/elasticsearch#2210

Original commit: elastic/x-pack-elasticsearch@e44c5748ba
2016-07-05 08:57:25 -04:00
Alexander Reelsen e8c1e7f9d8 Watcher: Dont hide exceptions during watch execution
When a painless exception is raised in the script condition, it was not bubbled up due to
catching exceptions on during execution. This removes the different catching of exceptions
and allows the watch record construct to contain an exception that is also serialized correctly
so that it can be stored in the watch history but also returned in the execute watch API.

This also updates the watch history template, so that exceptions are not indexed, but logged.

Relates elastic/elasticsearch#2587

Original commit: elastic/x-pack-elasticsearch@4dffb672bf
2016-07-05 09:33:44 +02:00
Jason Tedor f1670a3845 Rename UserError
The top-level class Throwable represents all errors and exceptions in
Java. This hierarchy is divided into Error and Exception, the former
being serious problems that applications should not try to catch and the
latter representing exceptional conditions that an application might
want to catch and handle. This commit renames
org.elasticsearch.cli.UserError to org.elasticsearch.UserException to
make its name consistent with where it falls in this hierarchy.

Relates elastic/elasticsearch#2701

Original commit: elastic/x-pack-elasticsearch@589e159ec0
2016-07-04 19:22:46 -04:00
Boaz Leskes 8cc49b5b30 Remove DummyTransportAddress (elastic/elasticsearch#2048)
this is a partner PR to elastic/elasticsearchelastic/elasticsearch#17811

Original commit: elastic/x-pack-elasticsearch@1db11e4340
2016-07-04 21:09:53 +02:00
Tanguy Leroux bd0cf521aa Enable Checkstyle RedundantModifier
Original commit: elastic/x-pack-elasticsearch@7455e88dce
2016-07-04 15:17:50 +02:00
Jason Tedor 1cd53c41e2 Do not catch throwable
Today throughout the codebase, catch throwable is used with reckless
abandon. This is dangerous because the throwable could be a fatal
virtual machine error resulting from an internal error in the JVM, or an
out of memory error or a stack overflow error that leaves the virtual
machine in an unstable and unpredictable state. This commit removes
catch throwable from the codebase and removes the temptation to use it
by modifying listener APIs to receive instances of Exception instead of
the top-level Throwable.

Relates elastic/elasticsearch#2694

Original commit: elastic/x-pack-elasticsearch@7ecdd7d978
2016-07-04 08:41:08 -04:00
Colin Goodheart-Smithe 29cf28bbde elastic/elasticsearch#2696 fixes package declarations in security tests
fixes package declarations in security tests

Original commit: elastic/x-pack-elasticsearch@b2aa606136
2016-07-04 10:31:46 +01:00
Colin Goodheart-Smithe b008a4de74 fixes package declarations in security tests
Original commit: elastic/x-pack-elasticsearch@09ed28aee3
2016-07-04 10:28:13 +01:00
Nik Everett 98f34c1120 Handle core removing addField
It is addStoredField now.

Original commit: elastic/x-pack-elasticsearch@c42c18894f
2016-07-04 09:36:36 +02:00
Ryan Ernst 03cbf82101 Remove WatcherSettingsValidation service
This looks like it predates settings validation in core, and only had a
single use inside the watcher ExecutionService. This change moves the
settings inside ExecutionService to be validated settings, and removes
the watcher specific validation.

Original commit: elastic/x-pack-elasticsearch@82843ce56c
2016-07-02 15:51:09 -07:00
Ryan Ernst d6ff6211eb Merge pull request elastic/elasticsearch#2685 from rjernst/uninject_htmlsanitizer
Uninject HtmlSanitizer

Original commit: elastic/x-pack-elasticsearch@4a6c8cdee6
2016-07-01 16:26:57 -07:00
Ryan Ernst 8bcfbcf0af Merge pull request elastic/elasticsearch#2689 from rjernst/we_dont_need_generics
Removed generics from LifecycleComponent

Original commit: elastic/x-pack-elasticsearch@d14b647bfd
2016-07-01 16:25:39 -07:00
Ryan Ernst 9f52066bdb Removed generics from LifecycleComponent
This is the xplugins side of elastic/elasticsearch#19225

Original commit: elastic/x-pack-elasticsearch@845a945552
2016-07-01 16:23:13 -07:00
Ryan Ernst 09c8418a50 Fix xpack tests with node info ctor changes
Original commit: elastic/x-pack-elasticsearch@c741a2d231
2016-07-01 14:15:19 -07:00
Ryan Ernst 36a8c24b6b Uninject HtmlSanitizer
This is just a utility used by the email action and does not need to be
injected.

Original commit: elastic/x-pack-elasticsearch@4555db634c
2016-07-01 13:45:16 -07:00
Joe Fleming e12b87059a Merge pull request elastic/elasticsearch#2559 from w33ble/reporting-controls
Reporting navmenu controls

Original commit: elastic/x-pack-elasticsearch@60a1d28c83
2016-07-01 11:39:05 -07:00
Tanguy Leroux 561fc86585 Fix checkstyle violations
Original commit: elastic/x-pack-elasticsearch@187f1cbd35
2016-07-01 17:13:08 +02:00
Tanguy Leroux 17684f1e76 Fix order of modifiers
Original commit: elastic/x-pack-elasticsearch@1f970e78ba
2016-07-01 16:54:53 +02:00
Simon Willnauer 158a6b5588 Cleanup BytesRefrence interface (elastic/elasticsearch#2670)
This is a followup of elastic/elasticsearchelastic/elasticsearch#19196

Original commit: elastic/x-pack-elasticsearch@1d0398e89a
2016-07-01 16:09:53 +02:00
Alexander Reelsen 6527683e48 Licensing: Return HTTP 403 forbidden instead of 401 in exception (elastic/elasticsearch#2673)
When a license exception is raised, we returned 401 as HTTP error code
in there. However this seems to have triggered some browsers to actually
ask for login credentials, which wont have any impact here.

Closes elastic/elasticsearch#1863

Original commit: elastic/x-pack-elasticsearch@cc63abdac8
2016-07-01 14:32:42 +02:00
Luca Cavanna de124baf8d Merge pull request elastic/elasticsearch#2616 from javanna/test/nuke_response_body_assertion
Consolidate docs snippets testing in our REST test infra

Original commit: elastic/x-pack-elasticsearch@983ab207bf
2016-07-01 12:09:05 +02:00
javanna 4eb21f4c01 [TEST] eagerly parse response body at ObjectPath initialization and read content type from response headers
We are going to parse the body anyways whenever it's in json format as it is going to be stashed. It is not useful to lazily parse it anymore. Also this allows us to not rely on automatic detection of the xcontent type based on the content of the response, but rather read the content type from the response headers.

Original commit: elastic/x-pack-elasticsearch@11be4684ae
2016-07-01 09:49:47 +02:00
javanna 579baa2bca [TEST] make JsonPath independent of data format, rename to ObjectPath
The internal representation of the object that JsonPath gives access to is a map. That is independent of the initial input format, which is json but could also be yaml etc.
This commit renames JsonPath to ObjectPath and adds a static method to create an ObjectPath from an XContent

Original commit: elastic/x-pack-elasticsearch@bc84c68161
2016-07-01 09:49:47 +02:00
Ryan Ernst 8d6d96d2f8 Merge pull request elastic/elasticsearch#2658 from rjernst/rest_handler_client
Change rest handler interface to use NodeClient

Original commit: elastic/x-pack-elasticsearch@82da58cc0c
2016-06-30 11:00:14 -07:00
Tim Sullivan 21020da149 Merge pull request elastic/elasticsearch#2593 from tsullivan/ui-exclude-browsertests
ui: exclude browser tests from build

Original commit: elastic/x-pack-elasticsearch@1ddaf4a9d3
2016-06-30 09:29:18 -07:00
Tim Sullivan 6c1d20cf95 Merge pull request elastic/elasticsearch#2586 from tsullivan/monitoring-ui-fix-fielddata-label
monitoring ui: label fix: Fielddata terminology

Original commit: elastic/x-pack-elasticsearch@3fa4e8705a
2016-06-30 09:29:00 -07:00
Tim Sullivan 4d93aa5bab Merge pull request elastic/elasticsearch#2582 from tsullivan/monitoring-ui-check-multicluster-mode
monitoring ui: check if current license is basic and multi-cluster monitoring should be restricted

Original commit: elastic/x-pack-elasticsearch@f445fcb621
2016-06-30 09:28:53 -07:00
Tim Sullivan f0126e3125 Merge pull request elastic/elasticsearch#2547 from tsullivan/monitoring-ui-calculateIndices-handle404
Monitoring ui calculate indices handle404

Original commit: elastic/x-pack-elasticsearch@c44c1c3e88
2016-06-30 09:28:39 -07:00
Jay Modi 060120b53d Merge pull request elastic/elasticsearch#2660 from jaymode/rest_test_teardown
test: move teardown logic into the rest tests

Original commit: elastic/x-pack-elasticsearch@81a273a4c7
2016-06-30 12:03:07 -04:00
Boaz Leskes 7c1bc0c8de adapt randomFrom to not use null as a first param, in preparation for https://github.com/elastic/elasticsearch/pull/19172
Original commit: elastic/x-pack-elasticsearch@50296d6cfc
2016-06-30 17:55:17 +02:00
Lee Hinman 8c54887ab8 Merge remote-tracking branch 'dakrone/migrate-tool-master'
Original commit: elastic/x-pack-elasticsearch@ce82529d4b
2016-06-30 09:53:52 -06:00
jaymode 4999f3a38c test: remove unnecessary teardown section in license test
Original commit: elastic/x-pack-elasticsearch@b457404452
2016-06-30 11:39:37 -04:00
Lee Hinman 238eed2075 Throw correct exception type, reduce boilerplate in boolean statement
Original commit: elastic/x-pack-elasticsearch@1e33c4d8f2
2016-06-30 09:34:08 -06:00
Ryan Ernst 82e4330e87 Merge branch 'master' into rest_handler_client
Original commit: elastic/x-pack-elasticsearch@7fcc120767
2016-06-30 08:16:50 -07:00
jaymode d1b945d1f2 security: remove user/role deletion logic in XPackRestTestCase
Original commit: elastic/x-pack-elasticsearch@d6064e520a
2016-06-30 11:15:05 -04:00
Karel Minarik 67706a9a19 [SECURITY] Changed the setup/teardown YAML structure in the integration test for roles
Related: 176fd6a

Original commit: elastic/x-pack-elasticsearch@90e210dbc2
2016-06-30 11:15:05 -04:00