Commit Graph

1165 Commits

Author SHA1 Message Date
Simon Willnauer 5c407cc526 Revert "Remove bwc layer for TimeUnit parsing"
This reverts commit elastic/x-pack@c6b2bd2c12.

Original commit: elastic/x-pack-elasticsearch@b4fbfb8afe
2016-09-08 22:03:46 +02:00
Jason Tedor 9baf88dfaa Handle node validation exception when starting
Node#start can now throw a checked NodeValidationException; this commit
adapts x-plugins for this new API.

Relates elastic/elasticsearch#3381

Original commit: elastic/x-pack-elasticsearch@660c5ab8c1
2016-09-08 10:56:54 -04:00
Simon Willnauer 20fce3280e Remove bwc layer for TimeUnit parsing
Original commit: elastic/x-pack-elasticsearch@79145f279b
2016-09-08 16:43:46 +02:00
Tanguy Leroux 97182fefb9 Clean up XContentBuilder in X-Pack
This commit cleans most of the methods of XContentBuilder so that:
    - Jackson's convenience methods are used instead of our custom ones (ie field(String,long) now uses Jackson's writeNumberField(String, long) instead of calling writeField(String) then writeNumber(long))
    - null checks are added for all field names and values
    - methods are grouped by type in the class source
    - methods have the same parameters names
    - duplicated methods like field(String, String...) and array(String, String...) are removed
    - varargs methods now have the "array" name to reflect that it builds arrays
    - unused methods like field(String,BigDecimal) are removed
    - all methods now follow the execution path: field(String,?) -> field(String) then value(?), and value(?) -> writeSomething() method. Methods to build arrays also follow the same execution path.

Original commit: elastic/x-pack-elasticsearch@d83f3aa6e2
2016-09-08 14:17:15 +02:00
jaymode 2257cc77f6 security: add reserved metadata to the ingest admin role
Closes elastic/elasticsearch#3376

Original commit: elastic/x-pack-elasticsearch@1909da2fb0
2016-09-07 19:19:02 -04:00
Alexander Reelsen 0f571685b9 Watcher: Fix proxy xcontent serialization (elastic/elasticsearch#3364)
Calling to xcontent in a HttpRequest, with a proxy enabled, lead to
serialization exceptions, resulting in failing to write the watch
history.

Closes elastic/elasticsearch#3334

Original commit: elastic/x-pack-elasticsearch@a04dff686c
2016-09-07 16:29:15 +02:00
Alexander Reelsen a296e31a7c Watcher: Ensure triggered watch is deleted on thread pool rejection (elastic/elasticsearch#3049)
This fixes a bug I found with a customer when he updated from 1.x to 2.x.
Due to an BWC incompatible change in the watch history mapping and a thread
pool rejection during execution a watch was not removed from the triggered
watches and tried to be executed again.

While trying to fix it it turned out that the execution of the failure
test case was still done in the transport thread and thus required some
offloading to another thread pool.

Original commit: elastic/x-pack-elasticsearch@df04ce31f2
2016-09-07 15:55:33 +02:00
Alexander Reelsen bb033f1e00 Watcher: Clear out WatchStore on watch index deletion (elastic/elasticsearch#2807)
If someone deletes the watch index (i.e. by deleting all indices), the watcher
in memory store still contains all the watches and tries to execute watches -
which results in exceptions as the watch itself cannot be updated anymore.

In order to minimize this problem (it cant be get rid of completely), we should
act accordingly if the watch index goes missing (either deleted or closed) and
clear out the memory representation of watches in the watchstore as well as trying
to finish all the current executions.

Closes elastic/elasticsearch#2794

Original commit: elastic/x-pack-elasticsearch@12d98cd566
2016-09-07 15:06:03 +02:00
javanna ad5606d1f7 [TEST] don't use null script lang in WatcherUtilsTests
same as elastic/x-pack@9e1e0988c1 but for testSerializeSearchRequest this time.

Original commit: elastic/x-pack-elasticsearch@aa7e3814b6
2016-09-06 23:00:56 +02:00
Nik Everett edb8c12f75 Always use mustache language
Using a null language just defaults to painless which is wrong for
watcher.

Original commit: elastic/x-pack-elasticsearch@48bdc31695
2016-09-06 15:45:23 -04:00
Nik Everett 05222b0d3f Deal with ConcreteShardRequest
It exists now and the intercepters have to deal with it.

Original commit: elastic/x-pack-elasticsearch@fdef0578ed
2016-09-06 15:42:06 -04:00
Martijn van Groningen 36486a7993 Changes for PR: https://github.com/elastic/elasticsearch/pull/20310
Original commit: elastic/x-pack-elasticsearch@9db3d05274
2016-09-06 18:44:41 +02:00
jaymode 7965608add security: make control of logfile audit output consistent with index output
This change moves the logfile audit output from determining what to log based on the
logger level to a enum based configuration that is used by the index output.

A few notable changes were made:

* We alway log all the information we have except for the request body
* The request body is no longer logged by default for REST events; the user needs to
explicitly opt in as there could be sensitive data in the body
* Added a `realm_authentication_failed` event that separates overall authentication
failure from that of an individual realm

Original commit: elastic/x-pack-elasticsearch@343a2bcdd9
2016-09-06 10:50:33 -04:00
Nik Everett 89ce4ebb08 Fix remaining fractional TimeValue issues with watcher
Removes the remaining spots where watcher makes fractional TimeValues.

Closes elastic/elasticsearch#3231

Original commit: elastic/x-pack-elasticsearch@22b0d37ed3
2016-09-06 09:53:22 -04:00
jaymode cd9add5350 test: remove unnecessary verify check
Original commit: elastic/x-pack-elasticsearch@f748c0a565
2016-09-06 08:36:04 -04:00
jaymode 1e6a924e74 security: add support for disabling users
This change adds support for disabling users. Users can be disabled by setting the enabled
property to false and the AuthenticationService will check to make sure that the user is enabled.
If the user is not enabled, this will be audited as an authentication failure.

Also as part of this work, the AnonymousUser was cleaned up to remove having a static instance
that caused issues with tests.

Finally, the poller of users was removed to simplify the code in the NativeUsersStore. In our other
realms we rely on the clear cache APIs and the timeout of the user cache. We should have the
same semantics for the native realm.

Closes elastic/elasticsearch#2172

Original commit: elastic/x-pack-elasticsearch@0820e40183
2016-09-06 07:41:48 -04:00
Chris Earle ec008ec4a9 Looong lines
Original commit: elastic/x-pack-elasticsearch@8c7931c179
2016-09-05 19:05:28 -04:00
Chris Earle 5d5a9afb57 [Monitoring] Use Low Level REST Client for HTTP Exporter
This rewrites the HTTP Exporter to use the REST client underneath. Functionality is improved in resource blocking (templates and pipelines existing) and the majority of the code fundamentall simplified by removing direct HTTP calls.

This is blocked by the SSLService pull request. After that is merged, the I will update this PR to reflect those changes and it could possibly allow us to remove the security privileges required for monitoring.

Original commit: elastic/x-pack-elasticsearch@1ad25f17f8
2016-09-05 15:16:03 -04:00
Alexander Reelsen 41334abda0 Watcher: Reenabling HipChatServiceTests
The authentication token stopped working, deleted it and created a new one
on the hipchat web site. Tests are working now again.

Closes elastic/elasticsearch#3162

Original commit: elastic/x-pack-elasticsearch@a0623af799
2016-09-05 12:27:14 +02:00
Martijn van Groningen 09c7f534b3 added jdocs and rename
Original commit: elastic/x-pack-elasticsearch@8a97b420c1
2016-09-03 11:01:47 +02:00
Nik Everett 3c33879018 Mark OldWatchIndices test AwaitsFix
Is freaking out in CI.

Original commit: elastic/x-pack-elasticsearch@3ab43467ed
2016-09-02 18:31:19 -04:00
Martijn van Groningen 565f50dbe5 Remove custom parsing and toXContent logic from TextTemplate and delegate to the Script as much as possible
Original commit: elastic/x-pack-elasticsearch@6d23549dc1
2016-09-02 23:36:07 +02:00
Nik Everett 203faaf4f4 2.x backwards compatibility support for watcher
Basic backwards compatibility support for watcher.

Closes elastic/elasticsearch#3230

Relates to elastic/elasticsearch#3231 - this actually should fix all the failures caused
by fractional time values but it does so by being able to parse them.
Being able to parse them is important for 2.x compatibility but 5.0
watches shouldn't produce fractional time values. This fixes the
particular way of making fractional time values mentioned in elastic/elasticsearch#3231
but I expect there are a half dozen more places to fix. The actual
watcher tests are fairly basic.

Original commit: elastic/x-pack-elasticsearch@328717455c
2016-09-02 09:24:46 -04:00
javanna 119bb67967 adapt to elastic/elasticsearch#20288: More info classes to implement Writeable rather than Streamable
Original commit: elastic/x-pack-elasticsearch@22cadf604d
2016-09-02 10:24:15 +02:00
Jack Conradson de4c776f0f Merge pull request elastic/elasticsearch#3272 from jdconrad/deprecate
Deprecate Groovy, Python, and Javascript

Original commit: elastic/x-pack-elasticsearch@e5c1d5a112
2016-09-01 16:30:25 -07:00
Chris Earle bb5ff7ab36 Fix test on Linux; setting name missing 'total.'
Original commit: elastic/x-pack-elasticsearch@de0183b3ef
2016-09-01 18:12:00 -04:00
Jack Conradson 670a57274a Merge branch 'master' into deprecate
Original commit: elastic/x-pack-elasticsearch@c9636bd3f1
2016-09-01 14:53:42 -07:00
Chris Earle 6d40cb63d0 [Monitoring] Collect IO Stats
This ensures that the data exists in 5.0.

Original commit: elastic/x-pack-elasticsearch@bc6e7931d1
2016-09-01 15:45:51 -04:00
Chris Earle b60e8aebd2 [Monitoring] Publish X-Pack Usage with Cluster Info
This publishes X-Pack usage data to the cluster info from the elected master node. This allows phone home to retrieve this data from the index, rather than fetching it live from the connected cluster (thereby not getting it from any n - 1 clusers that are not connceted).

Original commit: elastic/x-pack-elasticsearch@79bfaaaf0b
2016-09-01 15:38:54 -04:00
jaymode 2e010d52e9 security: do not allow built-in user/role names to be defined in the file realm
This change restricts built-in user/role names from passing validation when we are reading or modifying
the files used by this realm.

Closes elastic/elasticsearch#2078

Original commit: elastic/x-pack-elasticsearch@9f6b34f39d
2016-09-01 14:46:38 -04:00
jaymode 74f55bf46e security: add option to specify the certificate validity period
This commit adds the option to specify the number of days that a certificate is valid for.

Closes elastic/elasticsearch#2877

Original commit: elastic/x-pack-elasticsearch@fcf0a28321
2016-09-01 14:21:30 -04:00
jaymode 5d5bd015c0 add a PreBuiltXPackTransportClient
This change adds a transport client that comes preconfigured with the same plugins as the
PreBuiltTransportClient and also adds x-pack.

Closes elastic/elasticsearch#2970

Original commit: elastic/x-pack-elasticsearch@bb60534bd4
2016-09-01 13:49:10 -04:00
Jack Conradson 1d6d20679d Merge branch 'master' into deprecate
Original commit: elastic/x-pack-elasticsearch@afdfa26dc0
2016-09-01 08:52:34 -07:00
Chris Earle 6f115a532d [Monitoring] Remove "agent" package
This removes the "agent" package from org.elasticsearch.xpack.monitoring.agent.*, so that now everything is simply org.elasticsearch.xpack.monitoring.*.

Follow-on work will be refactoring some of the other code, but this is a first step now that it's always the agent (in effect).

Original commit: elastic/x-pack-elasticsearch@14025cb17c
2016-09-01 10:56:27 -04:00
jaymode ad9a7c9b96 Migrate xpack to use the common ssl configuration
This change migrates xpack (security, watcher, and monitoring) to use the common ssl
configuration for the elastic stack. As part of this work, several aspects of how we deal
with SSL has been modified.

From a functionality perspective, an xpack wide configuration for SSL was added and
all of the code that needs SSL uses the SSLService now. The following is a list of all
of the aspects of xpack that can have their own SSL configuration, which are separate
from the xpack wide configuration:

* Transport
* Transport profiles
* HTTP Transport
* Realms
* Monitoring Exporters
* HTTP Client

In terms of the code, some cleanups were made with these changes. SSLConfiguration is
now a concrete class and SSLConfiguration.Custom and SSLConfiguration.Global have been
removed. The validate method on key and trust configurations has been removed and these
classes will now throw exceptions when they are constructed with bad values. The
OptionalSettings helper class has been removed as it was just a file with one line functions
that made the code harder to understand. The SSL configuration and service classes have
been moved from the security source directories to the main xpack source set. The SSLService
now handles more of the configuration of the SSLEngine it returns to prevent callers from
having to handle those aspects. The settings that get registered for SSL have been moved to
XPackSettings.

Also included in this PR is a update to the docs around SSL. This includes a large simplification to
the documentation in that the certificate authority configuration section has been removed and the
process that is documented for generating certificates only includes the CLI tool that we bundle.

Closes elastic/elasticsearch#3104
Closes elastic/elasticsearch#2971
Closes elastic/elasticsearch#3164

Original commit: elastic/x-pack-elasticsearch@5bd9e5ef38
2016-09-01 10:51:41 -04:00
jaymode 54103127d0 fix line length
Original commit: elastic/x-pack-elasticsearch@caca0fc0b7
2016-09-01 09:37:05 -04:00
jaymode c5cde120b7 test: add 2.4.0 bwc index
Original commit: elastic/x-pack-elasticsearch@58bcf3abaf
2016-09-01 09:09:48 -04:00
jaymode 836e1d3a28 security: add a reserved role for the ingest feature in Kibana
Closes elastic/elasticsearch#1667

Original commit: elastic/x-pack-elasticsearch@da2f6d9c4e
2016-09-01 08:09:36 -04:00
Simon Willnauer 3638c8639f [TEST] Don't set create=true if no ID is specified
Original commit: elastic/x-pack-elasticsearch@874def17e8
2016-09-01 10:35:44 +02:00
Jason Tedor b29cdc0877 Fix additional exception logging call
This commit modifies an exception logging calls to use a parameterized
message from Log4j.

Original commit: elastic/x-pack-elasticsearch@7b0df7d056
2016-08-31 23:16:07 -04:00
Jack Conradson 0ca243dc83 Merge branch 'master' into deprecate
Original commit: elastic/x-pack-elasticsearch@25985e9144
2016-08-31 15:57:44 -07:00
Jack Conradson 31c9d258c7 Made deprecation of Groovy, Javascript, and Python more explicit.
Original commit: elastic/x-pack-elasticsearch@04d725e9c1
2016-08-31 15:57:09 -07:00
Jason Tedor cd0f17c372 Merge branch 'master' into log4j2
* master:
  Changes tests to conform with new cluster health API, calling setWaitForNoRelocatingShards(true) instead of setWaitForRelocatingShards(0)

Original commit: elastic/x-pack-elasticsearch@bde6ad8c8a
2016-08-31 16:17:28 -04:00
Ali Beyad 8757c2f6e1 Changes tests to conform with new cluster health API, calling
setWaitForNoRelocatingShards(true) instead of setWaitForRelocatingShards(0)

Original commit: elastic/x-pack-elasticsearch@c7c12fe64c
2016-08-31 11:56:38 -04:00
Jason Tedor a89f0110f4 Merge branch 'master' into log4j2
* master:
  Use releasable locks in NativeRolesStore
  security: limit the size of the role store cache
  security: remove explicit handshake wait in netty4 transport
  test: smoke-test-plugins-ssl no longer relies on logging to start
  kibana monitoring/uuid config key reference update
  Docs: Updated release date for 2.4 in RNs.
  Update README.md
  Build: Add apijar task to assemble so it gets built with other artifacts
  monitoring ui/license: cluster listing status cell treatment for basic/unsupported cluster
  monitoring ui:fix cluster overview when cluster has no indices/shards
  monitoring ui/license: logic cleanup per feedback
  monitoring ui/license: primary cluster asterisk styling
  monitoring ui/license: allow clicking into primary cluster if all are basic
  monitoring ui: add isPrimary property to cluster listing response
  Security: throw exception if we cannot extract indices from an indices request
  Security: add tests for delete and update by query

Original commit: elastic/x-pack-elasticsearch@3cb41739ee
2016-08-31 10:26:30 -04:00
Jason Tedor 82079185c2 Use releasable locks in NativeRolesStore
This commit replaces the use of try/finally blocks to handle safe
locking/unlocking for role cache read/write lock with releasable locks
in try-with-resources blocks.

Relates elastic/elasticsearch#3278

Original commit: elastic/x-pack-elasticsearch@fbd659cd85
2016-08-31 10:18:09 -04:00
jaymode 7d78911082 security: limit the size of the role store cache
Previously the roles store cache was unbounded as it was a just using a ConcurrentHashMap,
which could lead to excessive memory usage in cases where there are a large number of roles
as we tried to eagerly load the roles into the cache if they were not present. The roles store now
loads roles on demand and caches them for a finite period of time.

Additionally, the background polling of roles has been removed to reduce complexity. A best effort
attempt is made to clear the roles cache upon modification and if necessary the cache can be
cleared manually.

See elastic/elasticsearch#1837

Original commit: elastic/x-pack-elasticsearch@450dd779c8
2016-08-31 09:22:25 -04:00
jaymode 06ff97f63d security: remove explicit handshake wait in netty4 transport
Netty 4's SslHandler does not require the application to wait for the handshake to
be completed before data is written. This change removes the explicit wait on each
handshake future.

Original commit: elastic/x-pack-elasticsearch@c19bcebb83
2016-08-31 08:23:51 -04:00
jaymode 942a70328c test: smoke-test-plugins-ssl no longer relies on logging to start
This change adds a HTTPS check for smoke-test-plugins-ssl so it no longer has to wait for
a debug level log message.

Closes elastic/elasticsearch#2303

Original commit: elastic/x-pack-elasticsearch@f3eaaad5d4
2016-08-31 08:08:41 -04:00
Luca Cavanna 82649355a0 Merge pull request elastic/elasticsearch#3091 from javanna/fix/reindex_repleaceable
Security: add tests for delete and update by query

Original commit: elastic/x-pack-elasticsearch@6f6786a26e
2016-08-31 09:48:34 +02:00
Jason Tedor b1f97ea5ed Remove unnecessary calls to Path#toString
This commit removes some unnecessary calls to Path#toString when logging
a path in OperationFileModeWatcher#onChage. The calls to Path#toString
are not necessary since the logging infrastructure will do this anyway.

Original commit: elastic/x-pack-elasticsearch@da1bc30d60
2016-08-30 21:08:20 -04:00
Jason Tedor 4cd3e02206 Remove empty Javadocs in ExecutableSearchTransform
This commit removes some inadvertent blank Javadocs for
ExecutableSearchTransform.

Original commit: elastic/x-pack-elasticsearch@b73a5860cb
2016-08-30 21:05:18 -04:00
Jason Tedor 71b7818ead Remove unnecessary logging of exception message
This commit removes an unnecessary logging of an exception message from
HttpEmailAttachementParser#toAttachment since the full exception is
logged anyway.

Original commit: elastic/x-pack-elasticsearch@55d4bada00
2016-08-30 21:03:46 -04:00
Jack Conradson 49779a1549 Fixed test case.
Original commit: elastic/x-pack-elasticsearch@6177c03d32
2016-08-30 16:52:00 -07:00
Jason Tedor 0a285a9a0c Avoid allocating log parameterized messages
This commit modifies the call sites that allocate a parameterized
message to use a supplier so that allocations are avoided unless the log
level is fine enough to emit the corresponding log message.

Original commit: elastic/x-pack-elasticsearch@955ab89b8b
2016-08-30 18:20:15 -04:00
Ryan Ernst 1bfef646b8 Build: Add apijar task to assemble so it gets built with other artifacts
Original commit: elastic/x-pack-elasticsearch@ab9ce9c8d6
2016-08-30 11:23:22 -07:00
Jason Tedor 702d55f0be Introduce Log4j 2
This commit introduces Log4j 2 to the stack.

Original commit: elastic/x-pack-elasticsearch@02b2bb1c89
2016-08-30 13:29:28 -04:00
Nik Everett da8540b10b Handle removing more ctors
Original commit: elastic/x-pack-elasticsearch@dd1b62ba71
2016-08-30 10:27:45 -04:00
Nik Everett 2049a45f52 Handle core chaning IndexRequest
Original commit: elastic/x-pack-elasticsearch@8cd311b3e8
2016-08-30 10:27:45 -04:00
javanna 603db388d7 Security: throw exception if we cannot extract indices from an indices request
This used to be an assertion but we move it to an exception to be able to catch this at all times without requiring assertion enabled

Original commit: elastic/x-pack-elasticsearch@fcb5fbe852
2016-08-30 15:23:02 +02:00
javanna fdfc66a8ba Security: add tests for delete and update by query
Original commit: elastic/x-pack-elasticsearch@e85877d03f
2016-08-30 15:22:55 +02:00
jaymode 88abfcfea9 security: fix audit logging.yml to have the correct prefix
When migrating the package and class names from shield to xpack.security, the logging.yml
file was updated incorrectly which resulted in audit entries going to the wrong file. This change
specifies the correct package name so audit logs go to the correct file.

Closes elastic/elasticsearch#3063

Original commit: elastic/x-pack-elasticsearch@5c07108392
2016-08-30 07:39:25 -04:00
jaymode bb4777b7d6 allow extensions to define settings filter
This change allows extensions to define their own filtered settings. This is used when there
may be sensitive credentials stored in a custom realm that should be filtered out of some
API calls.

Closes elastic/elasticsearch#2847

Original commit: elastic/x-pack-elasticsearch@952474daba
2016-08-30 07:20:00 -04:00
jaymode 473728afb4 security: extract indices from CompositeIndicesRequests and exclude duplicates
This change allows us to log the indices from a composite indices request by getting the indices
from all of the sub requests. Additionally, indices are no longer duplicated when auditing.

Closes elastic/elasticsearch#2623
Closes elastic/elasticsearch#2618

Original commit: elastic/x-pack-elasticsearch@f1d3d87bcf
2016-08-30 07:06:04 -04:00
Tanguy Leroux d3dff6659b Returns empty set of filters in MonitoringIndexNameResolver and fix tests
Original commit: elastic/x-pack-elasticsearch@e901347de9
2016-08-30 10:10:08 +02:00
Tanguy Leroux 203ad03d26 Use sets of String in XContentBuilders
With elastic/elasticsearchelastic/elasticsearch#19865 the XContentBuilder has changed to support both inclusive and exclusive filters and now uses Set<String> instead of arrays of Strings. This change updates the various places in x-plugins where string arrays were used.

Original commit: elastic/x-pack-elasticsearch@1f8d4485f4
2016-08-30 09:08:49 +02:00
Nik Everett 8f22eaf1b7 Security: Add tests for indexes created in 2.x (elastic/elasticsearch#3203)
The actual backwards compatibility support is handled by core's ability to downgrade `keyword` and `text` into `string` for indexes created in 2.x.

Original commit: elastic/x-pack-elasticsearch@6b615d9a45
2016-08-29 12:00:19 -04:00
Yannick Welsch cdc41f6082 Add recovery source to ShardRouting
Relates to elastic/elasticsearchelastic/elasticsearch#19516

Original commit: elastic/x-pack-elasticsearch@051fb25bfc
2016-08-27 15:19:49 +02:00
jaymode 40c2672f12 test: remove the version compatibility tests
The x-plugins version is now kept in sync with the elasticsearch version and the
VersionCompatibilityTests just adds noise when updating versions.

Closes elastic/elasticsearch#3079
See elastic/elasticsearch#3212

Original commit: elastic/x-pack-elasticsearch@5998aa2ec0
2016-08-26 13:52:35 -04:00
jaymode e07ae87cf4 security: do not allow security APIs to execute when unlicensed
Although most of the security functionality was disabled when a basic license was applied,
some of the functionality still could be executed such as using the authenticate API or using
a transport client. The issue here is the UI calls the authenticate API and this gives the impression
that security is really in use when it is not.

Original commit: elastic/x-pack-elasticsearch@881453fc4c
2016-08-26 13:46:56 -04:00
Nik Everett 9c2b3d79ad Fix bulk update tests
It was relying on fields extracting fields from the source but it
doesn't do that any more.

Original commit: elastic/x-pack-elasticsearch@23b534c068
2016-08-26 12:52:06 -04:00
Mike McCandless ab074da873 Don't illegally reuse scorer in this test
Closes elastic/elasticsearch#3216

Original commit: elastic/x-pack-elasticsearch@63654c5585
2016-08-25 11:42:48 -04:00
jaymode 098e61fbc1 security: remove the realtime request interceptor
The realtime request interceptor was added to stop realtime requests from bypassing DLS
or FLS as the request could read a document from the translog. After
elastic/elasticsearchelastic/elasticsearch#20102 we no longer read documents from the translog so we can
allow realtime requests even when DLS or FLS is enabled.

Original commit: elastic/x-pack-elasticsearch@069b501500
2016-08-25 10:22:46 -04:00
jaymode dfdf77c536 security: upgrade to bouncy castle 1.55
Bouncy castle 1.55 was released earlier today and this commit updates the version
we use to 1.55.

Original commit: elastic/x-pack-elasticsearch@95e002431b
2016-08-25 09:41:12 -04:00
jaymode 26c1da4230 security: roles.yml is empty and add built in monitoring users
This change removes all default roles from the roles.yml file that is distributed with xpack and
adds built in roles for monitoring users and remote monitoring agents.

Closes elastic/elasticsearch#3122

Original commit: elastic/x-pack-elasticsearch@b04508bd56
2016-08-23 15:11:28 -04:00
jaymode 334aa94946 security: simplify lookup of files inside the config dir
This commit simplifies the code used for resolving the files used for security to always
resolve against the `config` file. Elasticsearch no longer offers a way to disable the security
manager, so the files read by x-pack should not really be configurable and only exist in their
default locations since that is what can be read by the process.

As part of this, the documentation was updated to indicate that these files should always be in
the default location and the settings to change the locations have been removed. Also, a bug
was fixed in a few places where settings were still using `shield.` instead of `xpack.security.`.
Finally, some outdated and unused files were deleted from the repository.

Closes elastic/elasticsearch#305

Original commit: elastic/x-pack-elasticsearch@3884f080a0
2016-08-23 14:54:18 -04:00
Ryan Ernst 1aa72336a0 Merge pull request elastic/elasticsearch#3191 from rjernst/api_jar
Build: Add api jar and client jar for xpack

Original commit: elastic/x-pack-elasticsearch@7743f43e23
2016-08-23 11:51:05 -07:00
jaymode 7536acdc9f security: cleanup logging and other minor enhancements/fixes
This change cleans up some of the log messages and levels that could now be considered misleading.

While performing these cleanups, the following was done:

* remove creation of dummy user for gradle run as we have the `elastic` user
* Request interceptors are not bound if field and document level security is disabled
* FLS/DLS interceptors skip execution if document and field level security is disabled by the license state
* The roles store that loaded the role is logged at the TRACE level
* The TransportXPackUsageAction was using the incorrect action name when registering a handler

Closes elastic/elasticsearch#2096
Closes elastic/elasticsearch#1861
Closes elastic/elasticsearch#2229
See elastic/elasticsearch#1879

Original commit: elastic/x-pack-elasticsearch@ac16b21c0c
2016-08-23 14:35:23 -04:00
jaymode 507196dca5 security: allow superusers access to the security index
This change allows users with the superuser role to access the security index. We previously allowed
the XPackUser to access this with the intent that the XPackUser was also the `elastic` user. When the
`elastic` user was split out into the ElasticUser, we did not update the check to allow this user access
to the security index.

Original commit: elastic/x-pack-elasticsearch@fa556d9845
2016-08-23 14:24:43 -04:00
jaymode 9c76211393 security: do not use hidden filenames when generating certs
This commit changes how we get the file and directory name for certificates in the tool. The
tool now prompts the user for the filename. If the provided instance name will result in a
valid filename, this is provided as a default. Otherwise the user must provide a valid
filename.

Closes elastic/elasticsearch#2854

Original commit: elastic/x-pack-elasticsearch@3c923d736b
2016-08-23 14:11:04 -04:00
Jack Conradson feefd070ef Make Painless the default scripting language.
Closes elastic/elasticsearch#3124

Original commit: elastic/x-pack-elasticsearch@7e458c07a6
2016-08-22 17:41:18 -07:00
Ryan Ernst f28f77f73c Build: Add api jar and client jar for xpack
This adds back (again) building a transport client plugin jar for
x-pack, and also adds producing an "api" jar which extension authors can
build against. For now, both these jars are exactly the same, but
eventually they could differ, and be reduced to less than the real
x-pack jar.

see elastic/stackelastic/elasticsearch#7

Original commit: elastic/x-pack-elasticsearch@0a989de18b
2016-08-22 15:40:46 -07:00
Areek Zillur e28c2a8c94 Merge pull request elastic/elasticsearch#3178 from areek/fix/3177
Fix license expiry logging

Original commit: elastic/x-pack-elasticsearch@29d9f90af2
2016-08-22 13:16:05 -04:00
Areek Zillur 87eb69fdc6 Fix license expiry logging
Original commit: elastic/x-pack-elasticsearch@51580eaba7
2016-08-22 12:20:21 -04:00
Martijn van Groningen f10fbeeb70 watcher: remove WatchScript class
Original commit: elastic/x-pack-elasticsearch@fb2f9a28f1
2016-08-22 09:39:13 +02:00
Ryan Ernst 8ae939fec7 Remove client jar
This reverts building a separate client jar for xpack. It is not
necessary because we already build x-pack as a jar and publish to
elastic maven, since extension authors need that.

Original commit: elastic/x-pack-elasticsearch@2fab06b42c
2016-08-19 16:17:54 -07:00
Ryan Ernst 9586e68470 Merge pull request elastic/elasticsearch#3165 from rjernst/client_jar
Build: Enable x-pack to build a transport client plugin jar

Original commit: elastic/x-pack-elasticsearch@a36305d736
2016-08-19 09:29:47 -07:00
Ryan Ernst aa4fad9009 Build: Enable x-pack to build a transport client plugin jar
Original commit: elastic/x-pack-elasticsearch@f42f7a1cd2
2016-08-19 09:15:54 -07:00
Martijn van Groningen 64eec5afb3 security: Prohibit the use of `terms` query with lookup, `geo_shape` with indexed shapes, `has_child`, `has_parent` and `percolator` query inside DLS role query.
Closes elastic/elasticsearch#3145
Closes elastic/elasticsearch#613

Original commit: elastic/x-pack-elasticsearch@5962089b6c
2016-08-19 16:59:36 +02:00
Tanguy Leroux 30eab329a1 Muted HipChatServiceTests
These tests failed regularly. It seems that the user_account authentification token is not accepted anymore by the HipChat service that respond with a 401 HTTP code.

    See https://github.com/elastic/x-plugins/issues/3162

Original commit: elastic/x-pack-elasticsearch@793ad494d3
2016-08-19 16:48:44 +02:00
Tanguy Leroux 56be936ace Watcher: Use search template in Search Input/Transform REST tests
These tests would have caught the regression (introduced in elastic/x-pack@95a29c6a42 and fixed by elastic/x-pack@9b834b5f50) that cause search template to have "groovy" lang by default instead of "mustache"

Original commit: elastic/x-pack-elasticsearch@e27e5ae821
2016-08-19 09:30:24 +02:00
Ryan Ernst f92b576661 Merge pull request elastic/elasticsearch#3142 from rjernst/deguice20
Remove SecurityTransportModule

Original commit: elastic/x-pack-elasticsearch@e609503c7b
2016-08-18 08:03:31 -07:00
Ryan Ernst 9da4d827c1 Rename transport service method to clarify a user is always used, but
not necessarily the system user

Original commit: elastic/x-pack-elasticsearch@0357d3718d
2016-08-18 08:03:31 -07:00
Tanguy Leroux 5b2c7dd503 Fix watrcher script parsing tests
closes elastic/elasticsearch#3135, elastic/elasticsearch#3134, elastic/elasticsearch#3136

Original commit: elastic/x-pack-elasticsearch@a1b0402be4
2016-08-18 10:06:05 +02:00
Ryan Ernst 49ac29f2e3 Remove SecurityTransportModule
SecurityTransportModule handled binding two things in guice. First, IPFilter,
for which createComponents already had the necessary dependencies. The
second was ClientTransportFilter. For transport clients, this was a
noop and could be removed. For nodes, this just attaches the system
user, which could be done directly from SecurityServerTransportService.

Original commit: elastic/x-pack-elasticsearch@da327de476
2016-08-18 00:09:31 -07:00
Chris Earle 572869087d Change use of generics in test
Original commit: elastic/x-pack-elasticsearch@39473681b2
2016-08-17 15:50:20 -04:00
Chris Earle c16860e901 Fix Watcher REST test
Original commit: elastic/x-pack-elasticsearch@7cb5b08948
2016-08-17 15:35:18 -04:00
Jason Tedor 76319495b6 Mark failing Watcher REST test as awaits fix
This commit marks a failing Watcher REST test with seed 97AAFD9CA37864EE
as awaits fix.

Original commit: elastic/x-pack-elasticsearch@5e19f0169c
2016-08-17 15:13:26 -04:00
jaymode 934b69b0c6 test: use valid names to prevent false test failures
In some cases, the random ascii value could match a forbidden name, which will cause this
test to fail as it expects valid names. This changes ensures the names are valid.

Original commit: elastic/x-pack-elasticsearch@c79f8fc4cc
2016-08-17 14:31:17 -04:00
Jason Tedor de4851329d Mark WUT#testDeserializeSearchRequests awaits fix
This commit marks WatcherUtilsTests#testDeserializeSearchRequest which
is failing with seed 2203D3AD59DB5223 as awaits fix.

Original commit: elastic/x-pack-elasticsearch@4b6cbe544b
2016-08-17 13:43:12 -04:00