Commit Graph

322 Commits

Author SHA1 Message Date
Jason Tedor e8dc52857d Merge pull request elastic/elasticsearch#735 from jasontedor/straight-cache-homey
Remove use of com.google.common.cache.*

Original commit: elastic/x-pack-elasticsearch@c9551c65e6
2015-10-09 12:28:10 -04:00
Nik Everett 2bde3de3f0 Merge branch 'master' into immutable_map_be_gone
Original commit: elastic/x-pack-elasticsearch@62358ec345
2015-10-09 12:25:28 -04:00
Areek Zillur daf4a9765c [License] Feature agnostic licensing model
This commit changes the license plugin to work with license that are not tied to any specific feature in a bwc way. It refactors the license plugin api into a lighter weight API, enabling the license plugin to manage license expiration and acknowledgment triggers.

closes elastic/elasticsearch#683, elastic/elasticsearch#686, elastic/elasticsearch#687, elastic/elasticsearch#691

Original commit: elastic/x-pack-elasticsearch@537cd3933a
2015-10-09 00:32:15 -04:00
jaymode 7b0f2628cb updates to handle renamed RenderSearchTemplateAction
Original commit: elastic/x-pack-elasticsearch@03cb49ce52
2015-10-08 09:09:00 -04:00
Jason Tedor ee5f092eb5 Merge pull request elastic/elasticsearch#736 from jasontedor/replace-inet-addresses
Remove use of com.google.common.net.InetAddresses

Original commit: elastic/x-pack-elasticsearch@7fb80c9ff3
2015-10-07 20:29:58 -04:00
debadair 144d9e85df Shield Docs: Fixed GS verification step. Closes elastic/elasticsearch#760.
Original commit: elastic/x-pack-elasticsearch@9a2f810131
2015-10-07 13:46:27 -07:00
jaymode a876755fd5 fix compile error. SimilarityLookupService -> SimilarityService
Original commit: elastic/x-pack-elasticsearch@d2f7e6dcf4
2015-10-07 16:27:47 -04:00
jaymode 98095a5ca8 add shield 2.0.0-rc1 release notes
Original commit: elastic/x-pack-elasticsearch@22e6a1499f
2015-10-07 07:18:02 -04:00
Nik Everett dab504f6ba Remove ImmutableMap$Builder
Original commit: elastic/x-pack-elasticsearch@f0d3f71887
2015-10-05 17:11:33 -04:00
Nik Everett 1d61278b2d More ImmutableMap banning
Original commit: elastic/x-pack-elasticsearch@59fee6e288
2015-10-05 13:35:31 -04:00
Simon Willnauer b7ca362df5 Remove shard level injector usage
This commit catches up with master which removed the shard level injector
and changed the logic how the SearcherWrapper works and is installed.
The way we now install it is via a package private onModule(IndexModule) call.
There is no public API for this anymore.
The wrapper also doesn't need to watch the IndexShards state since now it will only
be used when the shard is STARTED or RECOVERED.

Original commit: elastic/x-pack-elasticsearch@42b9eeef3d
2015-10-05 14:43:45 +02:00
Jason Tedor 556e8ca401 Remove use of com.google.common.net.InetAddresses
This commit removes all uses of com.google.common.net.InetAddresses
across the codebase. This is one of the few remaining steps in the
eventual removal of Guava as a dependency.

Relates elastic/elasticsearchelastic/elasticsearch#13224

Original commit: elastic/x-pack-elasticsearch@f6a0ed1395
2015-10-02 15:28:19 +02:00
Jason Tedor 5c0b4b04ca Remove use of com.google.common.cache.*
This commit removes the use of com.google.common.cache.Cache,
com.google.common.cache.CacheBuilder and
com.google.common.cache.CacheLoader.

Relates elastic/elasticsearchelastic/elasticsearch#13224, elastic/elasticsearchelastic/elasticsearch#13717

Original commit: elastic/x-pack-elasticsearch@04c254ee95
2015-10-02 13:09:42 +02:00
Nik Everett bee764b9ee Merge pull request elastic/elasticsearch#713 from elastic/immutable_set_be_gone
Remove ImmutableSet

Original commit: elastic/x-pack-elasticsearch@fe06937bc7
2015-09-25 21:46:22 -04:00
jaymode 44cd14d5f1 test: cleanup usages of node builder where we actually need Shield loaded
Some tests are still using a node builder for nodes that need to load Shield, which is not currently
supported by elasticsearch. This changes some to use a MockNode and awaits fix a tribe test
that was previously testing nothing.

Original commit: elastic/x-pack-elasticsearch@57d0c902b6
2015-09-25 13:05:07 -04:00
Nik Everett c6e7c9c1d6 Merge branch 'master' into immutable_set_be_gone
Original commit: elastic/x-pack-elasticsearch@faa212ffbd
2015-09-25 10:47:16 -04:00
jaymode dd8ce6017b test: update certificates to have more localhost subject alternative names
This updates our test certificates to have more subject alternative names and adds a script
to make regeneration easier in the future. Also added are the private keys in PEM format and
a .p12 version of the keystore. In the future we may want to start supporting PKCS12 keystores
and this will be a starting point for that.

Original commit: elastic/x-pack-elasticsearch@92c94c9f28
2015-09-25 10:36:28 -04:00
Nik Everett 81970a564f Fix Set->String conversion
Original commit: elastic/x-pack-elasticsearch@c34f2d252d
2015-09-25 10:16:34 -04:00
javanna ffc359b91d [TEST] fix compile errors due to breaking java api changes to QueryBuilders
Original commit: elastic/x-pack-elasticsearch@4e2f6f89c7
2015-09-25 16:13:32 +02:00
Nik Everett 7fe90ba03c Switch from Set to String comparison
Original commit: elastic/x-pack-elasticsearch@385ae531ee
2015-09-25 09:00:26 -04:00
Nik Everett e3b3ef3ef2 Remove ImmutableSet
Yet another step in the de-guava-ification process.

Original commit: elastic/x-pack-elasticsearch@d8c597c7ba
2015-09-24 16:51:45 -04:00
Nik Everett 974ae21899 Remove eclipse configuration files
These files are generated automatically with eclipse:eclipse so they shouldn't
be tracked in the repository.

Original commit: elastic/x-pack-elasticsearch@3869ddebfa
2015-09-24 14:08:49 -04:00
jaymode 0d1602255b test: make the remote cluster a test cluster in the RemoteIndexAuditTrailStartingTests
This also stops the remote IndexAuditTrail services prior to wiping the cluster to prevent possible
writes after a template has been deleted.

Original commit: elastic/x-pack-elasticsearch@30ef226250
2015-09-24 08:33:58 -04:00
jaymode 6a7462be3e update the IPFilter to always allow traffic from a bound address
This change updates the IPFilter to always allow traffic from the bound addresses of the node
even if they have been explicitly disabled. This behavior can be disabled through a setting but
that could be dangerous if the blocking rule is added via a persistent setting stored in the cluster
state.

Closes elastic/elasticsearch#487

Original commit: elastic/x-pack-elasticsearch@4c1cf9455f
2015-09-23 10:30:43 -04:00
jaymode 2e0b87f6c6 audit tampered request when verifying the user header fails
When we receive a message and cannot decode the signed user header, we should audit
this as a tampered request. The request may not be tampered if nodes are configured
differently in terms of system keys, but this at least provides some evidence of the bad
request on the nodes that receives it.

Closes elastic/elasticsearch#647

Original commit: elastic/x-pack-elasticsearch@2f3411d9f9
2015-09-23 08:51:56 -04:00
Nik Everett 56bb508254 Merge pull request elastic/elasticsearch#694 from nik9000/immutable_map_entry_set_be_gone
Stop using ImmutableMap#entrySet

Original commit: elastic/x-pack-elasticsearch@43d6598d27
2015-09-23 08:29:17 -04:00
Nik Everett f5398a739a Stop using ImmutableMap#entrySet
This is the first in a series of changes that will support banning Guava's
ImmutableSet.

Original commit: elastic/x-pack-elasticsearch@7f95900186
2015-09-22 16:49:10 -04:00
jaymode 7c8bad6b53 create basic interface for a caching realm
This extracts an interface for methods that a caching realm must implement. The idea for this
interface is to allow for custom realms to integrate easily with the clear cache api. With this change
a custom realm can implement this API and the clear cache action can call the evict or evictAll
methods on the realm.

Closes elastic/elasticsearch#544

Original commit: elastic/x-pack-elasticsearch@62b0029689
2015-09-22 13:28:39 -04:00
Robert Muir f610a347f0 Fix all doclint errors and warnings (so compile does not break with https://github.com/elastic/elasticsearch/pull/13702)
Original commit: elastic/x-pack-elasticsearch@6a05dcd6a2
2015-09-22 00:09:11 -04:00
Jason Tedor c91b5d9a5a Replace Integers.checkedCast with built-in method
Original commit: elastic/x-pack-elasticsearch@6c69849863
2015-09-18 08:55:08 -04:00
Jason Tedor 517b9eaa91 Remove use of com.google.common.primitives.Ints
This commit removes all uses of com.google.common.primitives.Ints
across the codebase.

Relates elastic/elasticsearchelastic/elasticsearch#13224

Original commit: elastic/x-pack-elasticsearch@9500282387
2015-09-18 08:55:08 -04:00
jaymode ba13e3bf1c test: add the index audit trail template to the excluded list when it is used
Closes elastic/elasticsearch#639

Original commit: elastic/x-pack-elasticsearch@111231b3b5
2015-09-17 09:21:58 -04:00
jaymode 04178cbc30 fix compilation errors caused by changes to wipe method
This commit keeps the behavior the same and does not exclude the index audit trail template from
being wiped, that will be done in a future commit.

Original commit: elastic/x-pack-elasticsearch@1ac9e22923
2015-09-17 08:02:45 -04:00
Jason Tedor 8942e1e559 Merge pull request elastic/elasticsearch#650 from jasontedor/joiner-be-gone
Remove use of com.google.common.base.Joiner

Original commit: elastic/x-pack-elasticsearch@fad27ff46b
2015-09-15 10:29:34 -04:00
Simon Willnauer d1c2698595 Fix forbidden API usage from upstream
Original commit: elastic/x-pack-elasticsearch@2bfcc83477
2015-09-15 15:51:22 +02:00
Jason Tedor f650e18045 Remove use of com.google.common.base.Joiner
This commit removes all uses of com.google.common.base.Joiner across
the codebase.

Relates elastic/elasticsearchelastic/elasticsearch#13224

Original commit: elastic/x-pack-elasticsearch@f69b2addca
2015-09-15 09:44:41 -04:00
jaymode a3ae0827fa fix the indexing of the request class for the IndexAuditTrail
The IndexAuditTrail was checking the logger level of the class before adding the request
class to the message, which was an error. The logger level should not control anything
about the IndexAuditTrail.

Closes elastic/elasticsearch#546

Original commit: elastic/x-pack-elasticsearch@35ee8ab453
2015-09-15 07:54:15 -04:00
Jason Tedor 52e58b8de0 Merge pull request elastic/elasticsearch#644 from jasontedor/iterables-be-gone
Remove use of com.google.common.collect.Iterables

Original commit: elastic/x-pack-elasticsearch@e24afb5c45
2015-09-15 07:52:37 -04:00
jaymode 8860364f72 update settings for tribes to fail if shield is not enabled or mandatory
In 2.0, plugins cannot specify mandatory settings, they can only specify a default additional
set of settings. For tribe nodes, we require shield to be enabled and be a mandatory plugin.
If the settings specified by the user conflict with this, we now throw an exception and fail
startup.

Closes elastic/elasticsearch#426

Original commit: elastic/x-pack-elasticsearch@db4d6d7923
2015-09-15 06:44:35 -04:00
debadair 8e343d21cc Shield Docs: Added links to the topics for the new features.
Original commit: elastic/x-pack-elasticsearch@1fcdecb940
2015-09-14 13:35:27 -07:00
debadair 019b63e5fb Shield Docs: Adding information about how to run as another user.
Original commit: elastic/x-pack-elasticsearch@7cc8fb28ad
2015-09-14 13:29:00 -07:00
debadair 326e55528c Shield Docs: New topic about using custom realms.
Original commit: elastic/x-pack-elasticsearch@e07d945d97
2015-09-14 13:21:28 -07:00
Jason Tedor 08de4a4ab1 Remove use of com.google.common.collect.Iterables
This commit removes all uses of com.google.common.collect.Iterables
across the codebase.

Relates elastic/elasticsearchelastic/elasticsearch#13224

Original commit: elastic/x-pack-elasticsearch@ca517de412
2015-09-14 13:26:04 -04:00
jaymode 3676d6e370 add 2.0.0-beta2 release notes for Shield
This adds the release notes to the documentation for Shield. Note, two new features do not
have links as the documentation for these are still pending.

Original commit: elastic/x-pack-elasticsearch@e66df5cf14
2015-09-14 11:09:56 -04:00
jaymode d5a44a6496 test: use test cluster scope for remote index audit trail tests
The SSL randomization can cause issues when running this test multiple times to look for an issue
since the suite cluster may have a different SSL value than the remote cluster during subsequent
runs.

Closes elastic/elasticsearch#607

Original commit: elastic/x-pack-elasticsearch@8ba3140c52
2015-09-14 09:34:19 -04:00
Simon Willnauer 2032c93da1 Catch up with core changes
This commit cuts over to StandardCharset vs. guavas Charsets, removes
obsolete uses of Collections2 / Function and replaces all LoadingCaches
with simple CHM#loadIfAbsent

Original commit: elastic/x-pack-elasticsearch@7d1d607e9e
2015-09-14 13:48:50 +02:00
Simon Willnauer 6fb4f7817c Use method references rather than Class instances to register transport handler.
This is caused by upstream changes in core.

Original commit: elastic/x-pack-elasticsearch@67f602abd1
2015-09-14 10:07:35 +02:00
Robert Muir 53cd14deda Remove remaining uses of setAccessible
This corresponds with https://github.com/elastic/elasticsearch/pull/13539

Original commit: elastic/x-pack-elasticsearch@29d235b8ed
2015-09-12 21:11:10 -04:00
Robert Muir 61c47634bd Fix wrong access modifiers for injected ctors, setAccessible is no longer used.
See https://github.com/elastic/elasticsearch/pull/13531

Original commit: elastic/x-pack-elasticsearch@658672b5fb
2015-09-12 03:30:33 -04:00
jaymode 29aac1c617 add missing PutMapping privilege for index audit trail user
Original commit: elastic/x-pack-elasticsearch@a2a107313d
2015-09-11 14:47:48 -04:00
jaymode ae66d4794a fix compile errors caused by cleanups in core
Original commit: elastic/x-pack-elasticsearch@a28d4b5ba0
2015-09-11 14:44:30 -04:00
Lee Hinman 3653bdc1b5 Merge remote-tracking branch 'dakrone/eclipse-jdk1.8'
Original commit: elastic/x-pack-elasticsearch@a1cdeff1d2
2015-09-11 10:00:49 -06:00
jaymode cb0f169655 update CLI tools to work with spaces in the home path
The CLI tools are launched by scripts and these scripts need to handle spaces in the
elasticsearch home path.

Closes elastic/elasticsearch#631

Original commit: elastic/x-pack-elasticsearch@6a4325d296
2015-09-11 11:15:19 -04:00
jaymode d3ee002180 set the user header on new requests in IndexAuditTrail
The IndexAuditTrail was not setting the appropriate user header on requests to see if the index exists and
the mapping is updated. This did not fail in tests because we set shield.user, but fails during a normal
installation.

Closes elastic/elasticsearch#626

Original commit: elastic/x-pack-elasticsearch@3771612b20
2015-09-11 08:29:48 -04:00
Lee Hinman 4a8df4f328 Update eclipse files for Java 1.8 move
Original commit: elastic/x-pack-elasticsearch@a2dd77ccf3
2015-09-10 10:04:31 -06:00
Jason Tedor 6b0bbd4c60 Remove use of com.google.common.collect.Sets
Remove use of com.google.common.collect.Sets.

This commit removes all uses of com.google.common.collect.Sets. This is
one of many steps in the eventual removal of Guava as a dependency.

Relates elastic/elasticsearchelastic/elasticsearch#13224

Original commit: elastic/x-pack-elasticsearch@5276ed9723
2015-09-10 10:30:38 -04:00
Martijn van Groningen 23c482ee80 test: enforce that no merging happens the test relies on document being in docid order.
Closes elastic/elasticsearch#619

Original commit: elastic/x-pack-elasticsearch@a85390430b
2015-09-10 14:43:10 +02:00
Martijn van Groningen 0ef1bfb9a2 test: use exist query directly, filtered query has been removed
Original commit: elastic/x-pack-elasticsearch@1c374adb97
2015-09-10 12:07:44 +02:00
Martijn van Groningen 427891191f test: fixed compile error due to https://github.com/elastic/elasticsearch/pull/13418
Original commit: elastic/x-pack-elasticsearch@24d22f2309
2015-09-10 11:23:47 +02:00
debadair ef4eb981b1 Added _shield to the verification step. Closes elastic/elasticsearch#312.
Original commit: elastic/x-pack-elasticsearch@e76fb45dfb
2015-09-09 16:36:47 -07:00
uboness 2004cb6ad8 fixed build - cleaned up the use of guava Maps
Original commit: elastic/x-pack-elasticsearch@05b2dc4c57
2015-09-09 16:35:51 -07:00
debadair cf439f09ce Edited role mapping info to address confusion. Closes elastic/elasticsearch#302.
Original commit: elastic/x-pack-elasticsearch@e8acfd9711
2015-09-09 16:18:17 -07:00
Jason Tedor 916ae387ac Merge pull request elastic/elasticsearch#616 from jasontedor/maps-be-gone
Remove use of com.google.common.collect.Maps

Original commit: elastic/x-pack-elasticsearch@75e5291a78
2015-09-09 17:58:35 -04:00
debadair 8d0ce80d0e Clarified note about needing to perform a full cluster restart. Closes elastic/elasticsearch#109.
Original commit: elastic/x-pack-elasticsearch@d4f62cc072
2015-09-09 14:00:08 -07:00
Jason Tedor 8d5a1bae58 Remove use of com.google.common.collect.Maps
This commit removes all uses of com.google.common.collect.Maps. This is
one of many steps in the eventual removal of Guava as a dependency.

Relates elastic/elasticsearchelastic/elasticsearch#13224

Original commit: elastic/x-pack-elasticsearch@3708fc0c60
2015-09-09 16:48:41 -04:00
debadair a82925b3bd Updated links to maven repo to use https. Closes elastic/elasticsearch#495.
Original commit: elastic/x-pack-elasticsearch@f95bdea57e
2015-09-09 13:14:24 -07:00
debadair ee6ac98565 Cleaned up realm topics, split off cache management. Closes elastic/elasticsearch#523, elastic/elasticsearch#451.
Original commit: elastic/x-pack-elasticsearch@99534117de
2015-09-09 12:58:07 -07:00
debadair 28f629da29 Updated actions list for 2.0. Closes elastic/elasticsearch#567.
Original commit: elastic/x-pack-elasticsearch@0ef9e834be
2015-09-09 12:52:59 -07:00
Ryan Ernst 7aa612b62e Merge pull request elastic/elasticsearch#615 from rjernst/warnings_cleanup2
Add warning suppressions

Original commit: elastic/x-pack-elasticsearch@a787f9c2a4
2015-09-09 12:51:51 -07:00
Ryan Ernst fbbd3f6c2d Add warning suppressions
I fixed a couple more warnings and added suppressions, so that when
 elastic/elasticsearchelastic/elasticsearch#13410 lands, x-plugins will not break.

Original commit: elastic/x-pack-elasticsearch@8a19b2b71b
2015-09-09 12:45:20 -07:00
jaymode 714460c2f0 remove path.home from TransportClients in code and docs
After changes in core and elastic/elasticsearch#578, we do not need to set path.home in the settings for a
TransportClient anymore. This cleans up the usages of it in our tests and in our documentation.

Closes elastic/elasticsearch#605

Original commit: elastic/x-pack-elasticsearch@d70875fe2b
2015-09-09 15:16:30 -04:00
jaymode 52c31d8c08 alway return reserved roles when parsing roles file
Today, if the roles.yml file does not exist the roles that are defined programmatically are not
available. This is incorrect because the reserved roles should always be available and not depend
on the parsing of the file. This change ensures that the reserved roles are made available even
when the roles.yml file is missing.

Closes elastic/elasticsearch#602

Original commit: elastic/x-pack-elasticsearch@ee2fd2ddbf
2015-09-09 14:11:04 -04:00
jaymode a5d9c45dd3 remove the override of finalize in SecuredString
This change removes the override of finalize in SecuredString to resolve a issue where
the char[] can be cleared by the call in the finalize method but the char array is still being used.

The specific issue that occurs is in the BCrypt usage of the SecuredString. A character is concatenated
and then the utf8Bytes method is called. In most cases, the proper bytes are returned but occasionally
the byte array is returned with only zeroes. This occurs under load and/or memory pressure and can be
provoked by running BCryptTests with a small heap (12 - 16 megabytes) and the SecuredString
implementation with the overridden finalize method.

Closes elastic/elasticsearch#589

Original commit: elastic/x-pack-elasticsearch@fb6430ea9d
2015-09-09 12:42:49 -04:00
jaymode 9e3bf47a87 update the transport client and add integration tests
Closes elastic/elasticsearch#477

Original commit: elastic/x-pack-elasticsearch@8926f6ca44
2015-09-09 12:30:41 -04:00
Martijn van Groningen 8511d56a83 test: Remove version randomization from the parent child test. The <= 1.x impl has been removed, so no need to test it any more in master.
Original commit: elastic/x-pack-elasticsearch@2633349d02
2015-09-09 17:50:54 +02:00
jaymode 154b10e901 add the ability to run as another user
This change adds a new permission that allows authorized users to execute a request as
another user. The flow is as follows:

1. The user making the request is authenticated
2. The user that is being impersonated is looked up
3. The requesting user is authorized for the privilege to run as the specified user
4. The impersonated user is then authorized for the given request

Additionally, the auditing has been updated to support this capability and indicates when a
user has been granted the ability to run as another user and then also indicates both the user
who is being impersonated and the requesting user when actions are granted/denied.

Closes elastic/elasticsearch#17

Original commit: elastic/x-pack-elasticsearch@00e5a6169b
2015-09-09 11:25:02 -04:00
Martijn van Groningen fd4058f921 Use the more verbose format in the default roles.yml and docs.
Closes elastic/elasticsearch#529

Original commit: elastic/x-pack-elasticsearch@9bde530a9c
2015-09-09 15:44:35 +02:00
jaymode 14c21786ee Test: add back the stop of the local audit trails
If also indexing locally, we need to stop the audit trail indexing otherwise the test cluster checks
will fail. See elastic/elasticsearch#598

Original commit: elastic/x-pack-elasticsearch@6767ab2edb
2015-09-09 08:39:51 -04:00
jaymode 0de73ec330 Test: don't check shard counters for RemoteIndexAuditTrailStartingTests
For the RemoteIndexAuditTrailStartingTests we start a remote cluster and index into the test cluster and after
the test we stop the remote cluster but indexing operations can still be ongoing in the test cluster and thus cause
locked shards causing lots of noise in CI. We simply skip this check for these tests.

Closes elastic/elasticsearch#598

Original commit: elastic/x-pack-elasticsearch@e678f82f29
2015-09-09 07:51:38 -04:00
jaymode 94dbf3f2a7 allow for the Environment to be optional in the ClientSSLService
This change makes the environment optional for the ClientSSLService, which is used for
Transport Clients and also used for LDAP client connections. Since we use the ClientSSLService
for LDAP connections, we still need the environment when running as a node under the
security manager to resolve paths from the configuration directory.

Closes elastic/elasticsearch#573

Original commit: elastic/x-pack-elasticsearch@862fafffe3
2015-09-09 06:43:34 -04:00
Ryan Ernst 5dd5f525b5 Remove some warnings caught by -Xlint
Original commit: elastic/x-pack-elasticsearch@50bea927cf
2015-09-09 00:16:13 -07:00
Ryan Ernst 2ab0db4373 Fix compile issues after removal of loadConfigSettings from transport
client

Original commit: elastic/x-pack-elasticsearch@2efe4f2980
2015-09-08 17:22:54 -07:00
Martijn van Groningen e7b338a077 test: added smoke test for the shield tribe node integration
Original commit: elastic/x-pack-elasticsearch@f7ab8b9044
2015-09-08 12:37:36 +02:00
Martijn van Groningen 547b6346f6 Changed the underlying DLS implementation
Instead of wrapping the IndexSearcher and applying the role query during the rewrite, the role query gets applied in a custom filtered reader that applies the query via the live docs.

The big advantage is that DLS is being applied in all document based APIs instead of just the _search and _percolate APIs.

In order to better deal with the cost of converting the role query to a bitset, the bitsets are cached in the bitset filter cache
and if the role query bitset is sparse the role query and main query will execute in a leapfrog manner to make executing queries faster.
 If the role query bitset isn't sparse, we fallback to livedocs.

Closes elastic/elasticsearch#537

Original commit: elastic/x-pack-elasticsearch@330b96e1f2
2015-09-08 11:04:10 +02:00
Adrien Grand 06ec935a08 Fix x-plugins following count/scan removal from elasticsearch-core.
Original commit: elastic/x-pack-elasticsearch@ee43991a0a
2015-09-07 17:44:01 +02:00
Jason Tedor 9a729638da Remove and forbid use of com.google.common.base.Strings
This commit removes and now forbids all uses of
com.google.common.base.Strings across the codebase.

For uses of com.google.common.base.Strings.isNullOrEmpty, use
org.elasticsearch.common.Strings.isNullOrEmpty.

For uses of com.google.common.base.Strings.padStart use
org.elasticsearch.common.Strings.padStart.

For uses of com.google.common.base.Strings.nullToEmpty use
org.elasticsearch.common.Strings.coalesceToEmpty.

Relates elastic/elasticsearchelastic/elasticsearch#13224

Original commit: elastic/x-pack-elasticsearch@d6e349e654
2015-09-07 09:37:30 -04:00
Jason Tedor 74cdc2f4ce Remove and forbid the use of com.google.common.base.Predicate(s)?
This commit removes and now forbids all uses of
com.google.common.base.Predicate and com.google.common.base.Predicates
across the codebase. This is one of the many steps in the eventual
removal of Guava as a dependency. This was enabled by
elastic/elasticsearchelastic/elasticsearch#13314.

Relates elastic/elasticsearchelastic/elasticsearch#13224, elastic/elasticsearchelastic/elasticsearch#13349

Original commit: elastic/x-pack-elasticsearch@968b81849f
2015-09-04 13:33:31 -04:00
uboness 533c14242f Bumped the version to 3.0.0-SNAPSHOT
Original commit: elastic/x-pack-elasticsearch@0771b3e589
2015-09-04 16:30:11 +02:00
jaymode 2f93428f22 test: poll for the index audit trail template
The template may not get recreated immediately due to other pending cluster state updates.

Original commit: elastic/x-pack-elasticsearch@810d77b397
2015-09-03 17:43:14 -04:00
jaymode 480406ebc7 Test: stop the IndexAuditTrail if running to prevent locked shards
The InternalTestCluster checks after the tests run if there are any locked shards, which is still
possible because the IndexAuditTrail is running and auditing events. This change makes the
test stop the IndexAuditTrail if they are running in the local cluster.

Original commit: elastic/x-pack-elasticsearch@f7fb564525
2015-09-03 13:00:42 -04:00
jaymode 1dbdf2ea1f add note on extended key usage
Closes elastic/elasticsearch#362

Original commit: elastic/x-pack-elasticsearch@0a2e0ab6d1
2015-09-03 11:53:39 -04:00
jaymode 892d9774f5 update limitations around more like this query
This updates the limitations section to indicate that the MLT query only works with Elasticsearch
1.6.2+ and 1.7.1+.

Closes elastic/elasticsearch#331

Original commit: elastic/x-pack-elasticsearch@70f2bb484e
2015-09-03 11:45:50 -04:00
jaymode afacb47828 make IndexAuditTrail recreate template and remove ShieldWrappingCluster
The ShieldWrappingCluster was added to prevent deletion of the IndexAuditTrail template when
running tests since the wipe() method will delete all templates. However, the cluster wrapping
is problematic with indexRandom() and causes noise in CI. This change removes the
ShieldWrappingCluster and changes the IndexAuditTrail to recreate the index template if it is
removed.

Closes elastic/elasticsearch#562

Original commit: elastic/x-pack-elasticsearch@0403ea7cef
2015-09-03 11:32:24 -04:00
Adrien Grand b4d5ef5904 Fix query rewriting for document-level security to be stable.
Original commit: elastic/x-pack-elasticsearch@3ad7eb4ded
2015-09-03 12:46:20 +02:00
Martijn van Groningen f270e585f4 dls: compare the rewritten query
Original commit: elastic/x-pack-elasticsearch@b84d661f33
2015-09-03 10:57:24 +02:00
Martijn van Groningen 99d91b7a9c Added wildcard support to the FLS `fields` option.
Closes elastic/elasticsearch#452

Original commit: elastic/x-pack-elasticsearch@4e82ce0472
2015-09-03 10:37:34 +02:00
Martijn van Groningen 1a84daab2a DLS: don't wrap twice
Original commit: elastic/x-pack-elasticsearch@86f6f7ac17
2015-09-03 10:31:23 +02:00
Areek Zillur dc471bc0a9 Fix naming for abstract test cases
Original commit: elastic/x-pack-elasticsearch@546ac98077
2015-09-02 16:58:06 -04:00
Britta Weber f90afd72d2 Update handler list for change in refresh and flush action
renamed actions back to admin/* and add suffix [s] instead

Original commit: elastic/x-pack-elasticsearch@32d3365941
2015-09-01 12:56:27 +02:00
Britta Weber 6cafd41d4f Update handler list for change in refresh and flush action
https://github.com/elastic/elasticsearch/pull/13068

Original commit: elastic/x-pack-elasticsearch@5e3e512481
2015-09-01 09:34:44 +02:00
debadair 75d8d12c37 Docs: Updated kibana.yml settings to match 4.2 changes. Closes elastic/elasticsearch#524.
Original commit: elastic/x-pack-elasticsearch@e305153fe5
2015-08-31 14:35:59 -07:00
Martijn van Groningen 39b7092185 test: removed the 'plugin.types' usages from the source code
Original commit: elastic/x-pack-elasticsearch@a94cdee31f
2015-08-31 22:45:56 +02:00
jaymode 2de31460c8 remove use of ImmutableList in shield
Original commit: elastic/x-pack-elasticsearch@83be549a11
2015-08-31 15:59:28 -04:00
Martijn van Groningen 5900a65085 fixed compile error due to upstream change
Original commit: elastic/x-pack-elasticsearch@70a16e125c
2015-08-31 21:28:35 +02:00
Martijn van Groningen 90d0cb22ac unmuted test
Original commit: elastic/x-pack-elasticsearch@8bd95e427e
2015-08-31 21:28:18 +02:00
Martijn van Groningen 896ee0447c test: properly delegate the ShieldIntegTestCase#transportClientPlugins() and ShieldIntegTestCase#nodePlugins() methods to the settings source.
Original commit: elastic/x-pack-elasticsearch@7d55833917
2015-08-31 17:54:48 +02:00
jaymode a63f4d3678 suppress the LocalTransport for all Shield tests
Original commit: elastic/x-pack-elasticsearch@6c0b840643
2015-08-31 09:50:22 -04:00
Martijn van Groningen bd6111e9a7 updated await fix url
Original commit: elastic/x-pack-elasticsearch@e1646af2cd
2015-08-31 15:40:38 +02:00
Jason Tedor 36b5eaf09b Add test to ensure that ShieldServerTransportService wraps all handlers
This commit adds a test to ensure that all request handlers are wrapped
by ProfileSecuredRequestHandler.

Original commit: elastic/x-pack-elasticsearch@26473d0ddc
2015-08-31 08:30:35 -04:00
jaymode fb11827f78 mute TribeTests and remove license plugin from transportClientPlugins
See elastic/elasticsearch#551

Original commit: elastic/x-pack-elasticsearch@1d2ba3fc0e
2015-08-31 08:24:05 -04:00
Martijn van Groningen 1786e8eb10 test: use mock node to supply the plugins
Original commit: elastic/x-pack-elasticsearch@3f1aa333e8
2015-08-31 13:37:37 +02:00
David Pilato 13d5619d4e Merge branch 'pr/typo'
Original commit: elastic/x-pack-elasticsearch@73d7f06605
2015-08-31 13:15:14 +02:00
Boaz Leskes d75a8b8d6c Update handler list for change in Upgrade action
See https://github.com/elastic/elasticsearch/pull/13205

Original commit: elastic/x-pack-elasticsearch@8759f59eb5
2015-08-31 13:05:05 +02:00
Martijn van Groningen fd84ea7e90 test: make sure plugins are loaded in transport client
Original commit: elastic/x-pack-elasticsearch@81dd18d8b8
2015-08-31 13:01:39 +02:00
Martijn van Groningen b79be0db42 muted test
Original commit: elastic/x-pack-elasticsearch@112546cad9
2015-08-31 12:58:10 +02:00
Martijn van Groningen 677cf7e573 delegate
Original commit: elastic/x-pack-elasticsearch@5999c5d17b
2015-08-31 12:58:03 +02:00
Martijn van Groningen c81af81cd3 test: more fixes due to upstream changes
Original commit: elastic/x-pack-elasticsearch@92119d102c
2015-08-31 12:30:05 +02:00
Martijn van Groningen 98f5f489d0 test: more fixes due to upstream test infrastructure changes
Original commit: elastic/x-pack-elasticsearch@ab2dcca86d
2015-08-31 11:45:33 +02:00
David Pilato 88e389dd2e [typo] LICESE_EXPIRATION_ACTION_MATCHER should be LICENSE_...
Original commit: elastic/x-pack-elasticsearch@1e91087de7
2015-08-31 11:19:11 +02:00
Martijn van Groningen af4af34e2b fix compile errors
Original commit: elastic/x-pack-elasticsearch@38feef1376
2015-08-31 10:47:49 +02:00
Jason Tedor c09c5611b8 Add override of handler registration method to wrap handler
Original commit: elastic/x-pack-elasticsearch@4dcfb637c2
2015-08-30 17:49:56 -04:00
Boaz Leskes add8dd4cc4 Update handler list for changes made in https://github.com/elastic/elasticsearch/pull/12944
Original commit: elastic/x-pack-elasticsearch@2dcbf8bc99
2015-08-30 09:16:34 +02:00
jaymode d6eb2c8261 do not copy the authorization header from rest requests
Currently we copy the authorization header from every rest request to the action request. This is not
necessary because the user associated with each request is copied into the context and then if the
request leaves the node, the user will be serialized into a string and attached as a header.

This commit removes the copying of the authorization header as it is not necessary and by not copying
it, we limit the amount of copies we make of this sensitive information.

Original commit: elastic/x-pack-elasticsearch@4e5ba4b4aa
2015-08-28 09:04:39 -04:00
Martijn van Groningen fc9aff30bc fixed forbidden api failures:
Arrays.newArrayList() -> new ArrayList<>()
ImmutableSet.of() -> Collections.emptyList()

Original commit: elastic/x-pack-elasticsearch@a36a4eaa16
2015-08-28 10:18:48 +02:00
Martijn van Groningen 5f01f793d5 Added document and field level security
This commit adds document and field level security to Shield.

Field level security can be enabled by adding the `fields` option to a role in the `role.yml` file.

For example:

```yaml
customer_care:
  indices:
    '*':
      privileges: read
      fields:
        - issue_id
        - description
        - customer_handle
        - customer_email
        - customer_address
        - customer_phone
```

The `fields` list is an inclusive list of fields that controls what fields should be accessible for that role. By default all meta fields (_uid, _type, _source, _ttl etc) are also included, otherwise ES or specific features stop working. The `_all` field if configured, isn't included by default, since that actually contains data from all the other fields. If the `_all` field is required then this needs to be added to the `fields` list in a role. In the case of the content of the `_source` field and `_field_names` there is special filtering in place so that only the content relevant for the role are being returned.

If no `fields` is specified then field level security is disabled for that role and all fields in an index are accessible.

Field level security can be setup per index group.

Field level security is implemented at the Lucene level by wrapping a directory index reader and hides fields away that aren't in the `field` list defined with the role of the current user. It as if the other fields never existed.

* Any `realtime` read operation from the translog is disabled. Instead this operations fall back to the Lucene index, which makes these operations compatible with field level security, but there aren't realtime.
*  If user with role A executes first and the result gets cached and then a user with role B executes the same query results from the query executed with role A would be returned. This is bad and therefore the query cache is disabled.
* For the same reason the request cache is also disabled.
* The update API is blocked. An update request needs to be executed via a role that doesn't have field level security enabled.

Document level security can be enabled by adding the `query` option to a role in the `role.yml` file:
```yaml
customer_care:
  indices:
    '*':
      privileges: read
      query:
        term:
         department_id: 12
```

Document level security is implemented as a filter that filters out documents there don't match with the query. This is like index aliases, but better, because the role query is embedded on the lowest level possible in ES (Engine level) and on all places the acquire an IndexSearcher the role query will always be included. While alias filters are applied at a higher level (after the searcher has been acquired)

Document level security can be setup per index group.

Right now like alias filters the document level security isn't applied on all APIs. Like for example the get api, term vector api, which ignore the alias filter. These apis do acquire an IndexSearcher, but don't use the IndexSearcher itself and directly use the index reader to access the inverted index and there for bypassing the role query. If it is required to these apis need document level security too the the implementation for document level security needs to change.

Closes elastic/elasticsearch#341

Original commit: elastic/x-pack-elasticsearch@fac085dca6
2015-08-27 17:54:50 +02:00
jaymode 693d16777c correct the shield offline download links
Closes elastic/elasticsearch#499

Original commit: elastic/x-pack-elasticsearch@86a8015132
2015-08-25 10:00:58 -04:00
Areek Zillur ef7d4e2579 stub out acknowledge callbacks for commercial plugins
Original commit: elastic/x-pack-elasticsearch@d16f9dc1df
2015-08-24 18:25:40 -04:00
Areek Zillur 0b9021ee87 Add license acknowledgment mechanism for consumer plugins to notify users when they attempt to install a new license
closes elastic/elasticsearch#461

Original commit: elastic/x-pack-elasticsearch@bc30ac2871
2015-08-24 18:25:29 -04:00
jaymode f879ccf426 update version numbers in shield documentation to 2.1.0
Cherry-pick of commit to 2.0 and updated to change version to 2.1.0

Original commit: elastic/x-pack-elasticsearch@8672bbf1b1
2015-08-24 11:23:20 -04:00
Simon Willnauer e723c355d8 Remove unused imports - SpawnModules.java is removed
Original commit: elastic/x-pack-elasticsearch@717d38694d
2015-08-23 13:03:50 +02:00
Ryan Ernst 670b9b5ce8 Remove use of PreProcessModule
PreProcessModule was an alternate way to customize another module's
behavior inside plugins. The preferred (and only in the future) way to
do this is with onModule in the plugin itself. This change moves the
only two remaining users of PreProcessModule to do so in their
respective plugins. The use case was adding roles for shield
authorization, but these roles were really static, so there was no
reason they could not be configured up front.

Original commit: elastic/x-pack-elasticsearch@e67ac2dcb6
2015-08-21 14:23:23 -07:00
jaymode 70a37440cf fix IndexAuditTrail test failure
Failure was caused by using NetworkAddress.format instead of NetworkAddress.formatAddress

Original commit: elastic/x-pack-elasticsearch@48c5c34f57
2015-08-21 12:00:57 -04:00
jaymode 8fd5fe7ed8 add the ability to register a custom authentication realms
This adds the extension points necessary to enable a user to write a elasticsearch plugin
that can integrate with Shield and add a custom authentication realm. For the most part,
the work here just exposes the existing interfaces we have been using for Realms and
factories to create realms. An additional interface was added to allow for a custom
authentication failure handler to be used. This was needed to support use cases like SSO
and Kerberos where additional headers may need to be sent to the user or a different
HTTP response code would need to be sent.

Relates to elastic/elasticsearch#24

Original commit: elastic/x-pack-elasticsearch@13442e5919
2015-08-21 10:39:05 -04:00
jaymode 7e552f393b fix all InetAddress forbidden apis and compile errors
This commit also fixes test shard routing compilation error and disables local address check in
the Shield IPFilter. This will be addressed in a followup, see elastic/elasticsearch#487

Original commit: elastic/x-pack-elasticsearch@984df0b131
2015-08-21 09:22:57 -04:00
jaymode 8bb35cd6c3 fix transport client documentation for 2.0 and add notes about file locations
This also change ES_HOME/config -> CONFIG_DIR in the documentation to more accurately reflect the
location of configuration files as they are not always in ES_HOME/config.

Closes elastic/elasticsearch#455
Closes elastic/elasticsearch#432

Original commit: elastic/x-pack-elasticsearch@63ce35450c
2015-08-20 06:29:13 -04:00
debadair dffd30d591 Updated package installation information. Closes elastic/elasticsearch#376.
Original commit: elastic/x-pack-elasticsearch@59be16531c
2015-08-19 14:10:51 -07:00
debadair 3d5fef9d8f Updated the SSL config & CA topics to make the procedures clearer.
Original commit: elastic/x-pack-elasticsearch@9a08da7703
2015-08-19 13:51:54 -07:00
Ryan Ernst 804cf68031 Merge pull request elastic/elasticsearch#472 from rjernst/despawn
Remove uses of SpawnModules

Original commit: elastic/x-pack-elasticsearch@09b719e9c0
2015-08-19 08:56:43 -07:00
jaymode de02fd3c9c remove AwaitsFix from IPHostnameVerification tests now that it is fixed in core
Closes elastic/elasticsearch#468

Original commit: elastic/x-pack-elasticsearch@e2623762a3
2015-08-19 10:01:31 -04:00
Ryan Ernst e0128daf9a Remove uses of SpawnModules
SpawnModules will be going away very soon as part of
elastic/elasticsearchelastic/elasticsearch#12783. This change removes its use from all
x-plugins.

Most spawnmodules uses here were to either collect a number of modules
into one (so the modules were just moved up into the plugin itself), or
to spawn a module which interacted with an extension point from ES. This
change moves those, as well as most uses of PreProcessModule, to use
onModule.

Original commit: elastic/x-pack-elasticsearch@6430e35379
2015-08-18 18:41:44 -07:00
Ryan Ernst 2b5cb6b9f2 Fix compile after removal of apache commons and refactoring of plugin api
Original commit: elastic/x-pack-elasticsearch@5171192d16
2015-08-18 15:35:01 -07:00
jaymode 152aeaa776 remove NetworkUtils and InetAddress getLocalHost usage in shield
Original commit: elastic/x-pack-elasticsearch@460ef63824
2015-08-18 13:31:03 -04:00
David Pilato 29f8362bce [maven] fix build issues with artifactId renaming
Related to elastic/elasticsearch#450

Original commit: elastic/x-pack-elasticsearch@780002a9de
2015-08-18 18:03:40 +02:00
David Pilato 5899dc5f46 [maven] fix build issues with artifactId renaming
Related to elastic/elasticsearch#450

Original commit: elastic/x-pack-elasticsearch@d84fc8e85f
2015-08-18 17:29:09 +02:00
David Pilato 7b10f36775 [maven] rename artifactIds from `elasticsearch-something` to `something`
When https://github.com/elastic/elasticsearch/pull/12879 will be merged, this commit should be merged as well.

```
[INFO] Reactor Summary:
[INFO]
[INFO] Elasticsearch Commercial Plugin Build Resources .... SUCCESS [  0.228 s]
[INFO] Elasticsearch X-Plugins - Parent POM ............... SUCCESS [  0.282 s]
[INFO] X-Plugins: License: Parent POM ..................... SUCCESS [  0.089 s]
[INFO] X-Plugins: License: Core ........................... SUCCESS [  0.118 s]
[INFO] X-Plugins: License: Licensor ....................... SUCCESS [  0.150 s]
[INFO] X-Plugins: License: Plugin API ..................... SUCCESS [  0.106 s]
[INFO] X-Plugins: License: Plugin ......................... SUCCESS [  0.112 s]
[INFO] X-Plugins: Shield .................................. SUCCESS [  0.234 s]
[INFO] X-Plugins: Watcher ................................. SUCCESS [  0.264 s]
[INFO] X-Plugins: Marvel .................................. SUCCESS [  0.113 s]
[INFO] QA: Parent POM ..................................... SUCCESS [  0.097 s]
[INFO] QA: Smoke Test X-Plugins ........................... SUCCESS [  0.107 s]
[INFO] QA: Shield core REST tests ......................... SUCCESS [  0.093 s]
[INFO] QA: Smoke Test Watcher's Shield integration ........ SUCCESS [  0.109 s]
```

Original commit: elastic/x-pack-elasticsearch@e9871261cf
2015-08-18 13:55:11 +02:00
Ryan Ernst dbaf3166ef Fix compile, NetworkUtils get hostname and address methods changed
Original commit: elastic/x-pack-elasticsearch@64a94930dd
2015-08-18 00:13:23 -07:00
Martijn van Groningen 59fdd54dbc Fixed compile error due to upstream change.
Original commit: elastic/x-pack-elasticsearch@a07877571c
2015-08-17 13:44:59 +02:00
Martijn van Groningen d7665293cb Changed pom version to 2.1.0-SNAPSHOT
as ES core does in its master branch

Original commit: elastic/x-pack-elasticsearch@fc9b1a7327
2015-08-17 13:44:33 +02:00
Adrien Grand b8666f0bca Merge pull request elastic/elasticsearch#441 from jpountz/fix/shield_core_rest_tests_to_qa
Tests: Move Shield "run core REST tests" to qa.

Original commit: elastic/x-pack-elasticsearch@4040a1766a
2015-08-14 11:23:40 +02:00
Adrien Grand 06d84f00e4 Tests: Move Shield "run core REST tests" to qa.
Close elastic/elasticsearch#404

Original commit: elastic/x-pack-elasticsearch@1250e1449e
2015-08-14 11:18:11 +02:00