Commit Graph

386 Commits

Author SHA1 Message Date
jaymode f2b493fa96 Upgrade elasticsearch dependency to 1.5.0-SNAPSHOT
This upgrades the elasticsearch dependency to 1.5.0-SNAPSHOT and removes
classes/functionality that were incorporated back into elasticsearch.

Closes elastic/elasticsearch#669

Original commit: elastic/x-pack-elasticsearch@65b76c41fb
2015-03-19 09:56:19 -04:00
uboness 43a5fe07f4 fixed Introduced settings filtering for active directory
Filtering out the `hostname_verification` setting for active directory realms

Original commit: elastic/x-pack-elasticsearch@27b931c5c6
2015-03-17 16:30:50 -07:00
uboness 3015ebccdb Introduced settings filtering
Enables filtering out sensitive settings from the nodes info API rest endpoint. Also provide a mechanism to filter out additional settings via a new `shield.hide_settings` setting.

Original commit: elastic/x-pack-elasticsearch@9bab5049e7
2015-03-17 14:25:33 -07:00
jaymode 5ba1bdb816 [Test] increase logging for allocation related timeouts
On Windows, ensureGreen times out due to some shards not being initialized so
this increases allocation logging.

Original commit: elastic/x-pack-elasticsearch@e3777a8e89
2015-03-15 22:18:46 -07:00
jaymode 0cc784cbfd [Test] mute connect timeout tests that fail intermittently
Original commit: elastic/x-pack-elasticsearch@0b1d936d5b
2015-03-15 13:22:55 -07:00
jaymode 8704693888 Test: switch to using OpenLDAP url for connect timeout
After the switch from elasticsearch.com to elastic.co, these tests started failing
due to socket connect errors. Now we will just connect to the OpenLDAP server
which should be a different machines than the ones running tests.

Original commit: elastic/x-pack-elasticsearch@7bf713a313
2015-03-11 07:48:00 -07:00
Alexander Reelsen 15e0af9c9a Dynamic IP filtering: Disabling does not work in certain cases
Due to a bug in how old settings were stored, disabling dynamic
ip filtering did not work, when it had not been changed before.

Closes elastic/elasticsearch#762

Original commit: elastic/x-pack-elasticsearch@0868e1b6f2
2015-03-06 19:08:49 +01:00
uboness a977bb404f Fixed a bug in anonymous user via REST
The resolved anonymous user was not added to the REST request context. This resulted in that when the request was "translated" to a transport request, the fallback was the `system user`. The commit fixes that.

Original commit: elastic/x-pack-elasticsearch@acea6becf1
2015-03-05 21:05:15 +01:00
jaymode f0f4973ac3 [ldap] improve logging of exceptions during authentication
Any exception caught during authentication is only logged if DEBUG is enabled.
This changes the behavior to log these exceptions are WARN with the exception
message only or at DEBUG with the full exception.

The user template ldap implementation could potentially cause a lot of
logging to be generated because it always prints the full exception at WARN
level. This changes it to print the message at WARN level and the exception
at DEBUG.

Original commit: elastic/x-pack-elasticsearch@c607567d88
2015-03-05 11:02:02 -05:00
uboness 3829d8e7a3 Added unboundID free use license to NOTICE.txt
Original commit: elastic/x-pack-elasticsearch@9ddb39bdc6
2015-03-04 10:34:55 +01:00
Alexander Reelsen 9a3488304e Testing: Ensure http.enabled is set consistently for all nodes in test
Make sure that IpFilteringUpdateTests set http.enabled for all nodes same.

Closes elastic/elasticsearch#748

Original commit: elastic/x-pack-elasticsearch@a26521afb1
2015-03-03 09:10:57 +01:00
jaymode 7cfdf521c3 [SSL/TLS] filter out unsupported ciphers before setting the cipher list
This change filters out unsupported ciphers before setting the ciphers on the
SSLEngine. The unsupported ciphers are logged in a message at the error
level. If none of the specified ciphers are supported, then an exception will
be thrown.

Closes elastic/elasticsearch#698

Original commit: elastic/x-pack-elasticsearch@68cf47ec19
2015-03-02 12:18:18 -05:00
Alexander Reelsen 6a6e44545c IP Filtering: Make IP filtering a dynamic setting
In order to be able to configure ip filtering in a dynamic way, all
the ip filter related settings have been made dynamic.

This commit also fixed a bug, as the setting shield.http.filter.enabled
was not working, but mentioned in the documentation.

Documentation has been updated along the way.

Closes elastic/elasticsearch#697

Original commit: elastic/x-pack-elasticsearch@2760c47b5b
2015-03-02 18:14:17 +01:00
Robert Muir c8a169e3be Don't tableize runautomatons.
tableizing means evaluation is strictly linear time O(inputLength),
but costs #states * alphabet in ram. alphabet here is unicode (64k) so it blows up huge.

With tableize=false, it just means evaluation is O(inputLength * log(numIntervals)).
This is plenty fast for our purposes.

For these same reasons lucene only tableizes ByteRunAutomaton (alphabet size=256)
by default, for CharRunAutomaton it defaults to false.

Ban the trappy RunAutomaton ctor that tableizes. Fix tests using it.

Closes elastic/elasticsearch#739.

Original commit: elastic/x-pack-elasticsearch@28ab66b0ee
2015-02-25 12:33:30 -05:00
jaymode 82beae9c0c [test] check node ports to see if they are already bound
A large number of recent test failures have been caused by failure to bind
a port in the range 32900 to 32999. The ports are now tested to see if they
can be bound by this JVM and if not tries to bind another port. This will
decrease the likelihood of a port bind failure but another application could
still bind a port before the node starts up.

Closes elastic/elasticsearch#737

Original commit: elastic/x-pack-elasticsearch@aaf098758f
2015-02-25 12:05:00 -05:00
jaymode 121a20ca87 [test] add lucene expressions jar as test dependency
REST tests that use expressions as the script language requires the
lucene-expressions library to be loaded.

Original commit: elastic/x-pack-elasticsearch@c0f2b8a4b2
2015-02-24 15:23:55 -05:00
jaymode 021000e4d8 [ldap] move bind user settings out of the user_search settings
The bind user can be used for other operations in the future, so it is being moved
out of the user_search settings into the top level ldap realm settings.

Closes elastic/elasticsearch#729

Original commit: elastic/x-pack-elasticsearch@babc5ece0b
2015-02-24 06:10:42 -05:00
jaymode 7336509acc [ldap] allow mapping users to roles
This change will always attempt to map a user's distinguished name
to a role in addition to the user's groups.

Closes elastic/elasticsearch#324

Original commit: elastic/x-pack-elasticsearch@9ebcdd549c
2015-02-24 05:53:59 -05:00
jaymode c2a61d2207 [ldap] add user search with base dn and bind dn
This adds a second mode of operation to the ldap realm. This mode of operation
allows for single bind user to be specified. This bind user will be used to
search for user DNs starting from a base DN. The user DN will then be used to
authenticate via a bind operation. The bind user will then search for the user's
groups.

Closes elastic/elasticsearch#552
Closes elastic/elasticsearch#323

Original commit: elastic/x-pack-elasticsearch@3338730a64
2015-02-23 08:52:38 -05:00
jaymode d108faede3 [Test] AwaitsFix for tcp timeout tests. See elastic/elasticsearch#499
Original commit: elastic/x-pack-elasticsearch@31b79d51ac
2015-02-18 20:02:59 -05:00
jaymode cac922974d [Test] add a ldap search to the tcp timeout tests
If tests are run on the same machine as the ldap server a bind may be
succesfull. This adds a search to the test which should take longer than
1 millisecond for the server to respond.

Original commit: elastic/x-pack-elasticsearch@f37fb912e8
2015-02-18 18:20:59 -05:00
jaymode 52a2dd4acf [SSL/TLS] reduce logging when non https traffic is received on ssl channel
This removes the logging of an exception at the default log level when a incoming request in
the http transport is unencrypted and the http transport expects traffic to be encrypted.

Closes elastic/elasticsearch#561

Original commit: elastic/x-pack-elasticsearch@0cf23e8e9d
2015-02-18 10:27:20 -05:00
jaymode 4de8d04f9f [ldap] Migrate to using UnboundID SDK for LDAP
This migrates all of the LDAP code off of JNDI and makes use of the UnboundID
SDK to perform LDAP communication. As much as possible the behavior has
remained consistent. The minimum ldap search timeout is now 1s as UnboundID
only accepts this timeout in seconds; previously a value in milliseconds could be
specified.

Closes elastic/elasticsearch#694

Original commit: elastic/x-pack-elasticsearch@dd1c92bf91
2015-02-18 07:38:47 -05:00
Alexander Reelsen 17e16e2c53 Testing: Try to rebind in case of BindException
Original commit: elastic/x-pack-elasticsearch@e68e156a54
2015-02-17 15:36:07 +01:00
Alexander Reelsen 3f9f0fcadb Testing: Properly terminate thread pools
Original commit: elastic/x-pack-elasticsearch@a16cbed365
2015-02-17 15:21:28 +01:00
uboness a4a88c1a82 Updated ShieldVersion with version 1.0.1
Original commit: elastic/x-pack-elasticsearch@eea021633f
2015-02-12 17:54:47 -08:00
uboness d29cbe4ef7 Added NOTICE.txt
Original commit: elastic/x-pack-elasticsearch@aad60b86a8
2015-02-12 17:25:22 -08:00
jaymode 59fbf4d5f2 add the automaton library to the plugin zip
Original commit: elastic/x-pack-elasticsearch@6ceff1fc0f
2015-02-12 13:44:11 -08:00
jaymode af409e2ff8 [authz] fix Indices.Globals iterator to continue past a global without indices
If a Global permission is encountered that has no indices the iterator would not continue
to the rest of the entries. This change fixes the iterator to check if a Global has indices and
if not continues to look for a Global with indices permissions.

Closes elastic/elasticsearch#701

Original commit: elastic/x-pack-elasticsearch@5fbe318046
2015-02-12 12:58:22 -08:00
jaymode 6a8d971df1 [ldap] group search base_dn should not be null
JNDI will throw a NullPointerException when base_dn is not specified.
This should always be a non-null value that points to at least the base
of the directory or higher.

Closes elastic/elasticsearch#703

Original commit: elastic/x-pack-elasticsearch@825afcdd78
2015-02-12 12:36:41 -08:00
Robert Muir e7f141bd5c use brics automaton instead of lucene, so we don't depend on lucene
Closes elastic/elasticsearch#710

Original commit: elastic/x-pack-elasticsearch@71ca4e6241
2015-02-12 15:24:42 -05:00
jaymode 0aeeb8c26f [Test] Add tests using the Java default truststore to SslMultiPortTests
This adds a few tests using the Java default truststore (cacerts) to SslMultiPortTests
and validates that when using that truststore, the client cannot connect to a node
that is using a self signed certificate.

Original commit: elastic/x-pack-elasticsearch@d7c2eaa16b
2015-02-03 08:49:46 -05:00
jaymode f6b2950323 [cleanup] separate SSLService into ClientSSLService and ServerSSLService
Separates the SSLService into a ClientSSLService and a ServerSSLService. The ClientSSLService
should be used for client connections and removes the requirement for setting a keystore or a
truststore. The ServerSSLService maintains the existing requirement to have a keystore. Also, fixed
a small issue where the HandshakeWaitingHandlerTests called handshake more than once.

Closes elastic/elasticsearch#622

Original commit: elastic/x-pack-elasticsearch@67b6121b04
2015-02-03 07:44:24 -05:00
uboness 458daa2323 Add anonymous user support
When a request (rest/transport) that arrives to elasticsearch, and that has no authentication token associated with it, the request is then considered to be sent by an anonymous user. By default, we disallow anonymous requests and fail it by returning an authentication error.

Anonymous access can be enabled by configuring the `shield.authc.anonymous.roles` setting in `elasticsearch.yml` file. When set, an anonymous request will be associated with an `anonymous` user that holds the configured roles. From there on, authorization will continue as usual, and will try to authorize the request based on these roles.

Closes elastic/elasticsearch#376

Original commit: elastic/x-pack-elasticsearch@028b3a380b
2015-02-03 01:49:38 +01:00
uboness af86fcaa52 Update naming of assert message
relates to elastic/x-pack@22ca864cd1

Original commit: elastic/x-pack-elasticsearch@e7715a9c26
2015-01-29 19:57:36 +01:00
uboness 5c175503b7 [cleanup] renaming classes
mostly renamed `Secured....` classes to `Shield...` classes. applied to construct that replace other similar constructs either in es core or in other libraries. This will make it clear that the new constructs are coming from shield (in the logs). Also no need to call it "secured" as if shield replaces them, it's very likely they relate to security in one way or another :)

Original commit: elastic/x-pack-elasticsearch@f528a10b14
2015-01-29 17:14:18 +01:00
uboness dd5332500c fixed a license disabled behaviour
When the license is disabled (expired) we need to also block the nodes stats API

Fixes elastic/elasticsearch#671

Original commit: elastic/x-pack-elasticsearch@277c470889
2015-01-28 16:02:01 +01:00
javanna 82fc8fb9bf [TEST] add version compatibility check for aliases resolution code that needs updating with es core 1.5.0
Original commit: elastic/x-pack-elasticsearch@fb3a48bd02
2015-01-28 14:59:24 +01:00
javanna f709d4e9f0 [TEST] Fixed minor bug in IndexAliasesTests
Two aliases were supposed to be created, while only one was, which was also associated with a broken filter.

Original commit: elastic/x-pack-elasticsearch@695acbd668
2015-01-27 19:12:56 +01:00
javanna 21af0dafbf [TEST] Remove leftover assert in ClusterDiscoveryConfiguration
Same check is performed as part of VersionCompatibilityTests, assert can be removed.

Original commit: elastic/x-pack-elasticsearch@6e9241f646
2015-01-27 19:11:56 +01:00
Alexander Reelsen 37e392155b Merge branch 'pr/664'
Original commit: elastic/x-pack-elasticsearch@6811c189d1
2015-01-27 15:58:59 +01:00
Kevin Kluge 26d87fa3ef [docs] make download URLs consistent
make the download URL consistent:

- changed from elasticsearch-license to just license.
- file name will be "shield-{version}.zip".
- download location will be https://download.elasticsearch.org/elasticsearch/shield/{filename}
- update  URL for license download.
- update esvmrc to account for license plugin name change
- update error message for license plugin name change

Original commit: elastic/x-pack-elasticsearch@bebde15b4f
2015-01-27 15:40:24 +01:00
uboness 2582f4bb22 moving version to 2.0.0-SNAPSHOT
Original commit: elastic/x-pack-elasticsearch@51f1ee293f
2015-01-27 11:31:15 +01:00
uboness f43dda3abc changed license version to 1.0.0
Original commit: elastic/x-pack-elasticsearch@7b1f2428f8
2015-01-27 10:57:12 +01:00
uboness e7aeaee734 moving version to 1.0.0
Original commit: elastic/x-pack-elasticsearch@0a1c282324
2015-01-27 10:29:54 +01:00
uboness 9c3b72e782 [cleanup] removing redundant import
Original commit: elastic/x-pack-elasticsearch@ec386a9c22
2015-01-27 00:59:09 +01:00
uboness ca49afddfb [fix] sets treats the license as enabled by default
We need to assume the license is enabled until we're told otherwise by the license plugin. It's required as we should allow the execution of APIs (like cluster health) on a node that just started and didn't receive the cluster state yet.

Original commit: elastic/x-pack-elasticsearch@ce5fa68bfa
2015-01-27 00:27:00 +01:00
Alexander Reelsen 9121003c47 REST: Dont fail with NPE for unknown user
A NullPointerException was triggered in InternalAuthenticationService
in case a user did not exist because of trying to access the non-existing user.

While fixing this, a test added in IndexPrivilegeTests uncovered lots of wrong
assumptions about HTTP error codes, which have been fixed as well (a successful
operation now is expected to have a non 4XX/5XX HTTP return code). Also made sure
that certain preconditions are fulfilled before going on.

Fixes elastic/elasticsearch#646

Original commit: elastic/x-pack-elasticsearch@c4ed759e16
2015-01-26 20:37:04 +01:00
Alexander Reelsen 9b4566b72b Testing: Fix ClusterPrivilegeTests by using jsonBuilder instead of handcrafting JSON
Original commit: elastic/x-pack-elasticsearch@07d79b0f0c
2015-01-26 16:26:31 +01:00
Alexander Reelsen 383e41d6ca Snapshot Status: Allow system privilege to execute
As Elasticsearch 1.4.2 and below do not copy the headers in
TransportSnapshotsStatusAction, we need to allow the system user
to execute this in action, in order to see snapshots being currently
in progress.

This should be removed once we support elasticsearch 1.4.3

Closes elastic/elasticsearch#640

Original commit: elastic/x-pack-elasticsearch@00adf3dacf
2015-01-26 13:50:16 +01:00