Commit Graph

417 Commits

Author SHA1 Message Date
jaymode 84c5115889 Test: use URI so paths work on Windows
Original commit: elastic/x-pack-elasticsearch@3e6a185ac4
2015-05-27 06:55:19 -04:00
jaymode fb7cbbe581 fix compilation due to renamed transport actions
Original commit: elastic/x-pack-elasticsearch@fca64087dd
2015-05-27 06:42:42 -04:00
jaymode 7c4ce5760f Test: workaround JNA being required on windows now
Adds JNA as a test time dependency to work around it being required on
windows in elasticsearch core.

Original commit: elastic/x-pack-elasticsearch@b8fc70a051
2015-05-26 15:26:01 -04:00
jaymode 39915f92bc update shield to depend on elasticsearch 2.0
This commit is a squashed commit of work done in conjunction with @rmuir to make
shield work properly with elasticsearch 2.0. This includes ensuring all tests
pass when running with the security manager and updating the code to be compatible
with the latest core forbidden apis.

Shield is now a child project of elasticsearch-parent and inherits a lot of common
build, test, and static coverage functionality from that project resulting in a much
smaller and simpler pom.xml for shield. As part of this work, Shield can now read
rest tests from the elasticsearch jar so the rest tests are run automatically when
running the slow tests.

Original commit: elastic/x-pack-elasticsearch@2ebbf4284a
2015-05-26 13:57:58 -04:00
jaymode 3848ef3644 [Test] use elastic.co instead of elasticsearch.com
The elasticsearch.com SSL cert expired causing these tests to fail. Just use
elastic.co instead.

Original commit: elastic/x-pack-elasticsearch@b54895e6b8
2015-05-06 13:57:04 -04:00
jaymode 7366c95994 [Test] fix bug where random byte may be the same as the byte being changed
Original commit: elastic/x-pack-elasticsearch@657d38fbca
2015-04-30 13:11:15 -04:00
jaymode 03a00201ab add version 1.2.1
Original commit: elastic/x-pack-elasticsearch@b5c40a88bf
2015-04-29 13:04:00 -04:00
jaymode 316c179ec5 add version 1.1.1
Original commit: elastic/x-pack-elasticsearch@b95b59414a
2015-04-29 12:18:43 -04:00
jaymode a6df3d003e add reroute permissions for the system user
The system user needs to be able to execute a reroute action to support the
DiskThresholdDecider. The DiskThresholdDecider executes an empty reroute
request when a high disk watermark has been exceeded.

Relates to elastic/elasticsearch#816

Original commit: elastic/x-pack-elasticsearch@890b44d79e
2015-04-29 08:39:31 -04:00
jaymode c83836df71 [Test] fix bug in creating a byte array for tampered encryption test
The testChangingAByte method was requesting a random length byte array ranging
from 0-1000. The issue is that a byte array with length of 0 cannot be changed and
therefore this test is not valid in this case. It now requests a range of 1-1000.

Original commit: elastic/x-pack-elasticsearch@88edf535f4
2015-04-27 09:27:01 -04:00
jaymode c0858842ad [Test] update randomization file for elasticsearch 1.5.2 release
Original commit: elastic/x-pack-elasticsearch@cc48198ce4
2015-04-27 08:39:42 -04:00
jaymode bff95d9ca1 Add CryptoService to support signing and encryption operations
This changes the SignatureService into a CryptoService that now supports encryption
operations in addition to the signing operations. The encryption leverages the existing
system key and uses it with AES.

Closes elastic/elasticsearch#805

Original commit: elastic/x-pack-elasticsearch@a792ed4a54
2015-04-21 08:38:40 -04:00
jaymode 39f587a497 [CLI] attempt to restore owner and group on new files
For the CLI tools in Shield we create a new temp file and replace the existing file
to prevent issues with reloading a half written file. This has a potential side effect
of changing the user and group that own the file. Many times the commands are
run with root privileges (sudo) and when run with root privileges we can actually
reset the owner and group correctly.

Closes elastic/elasticsearch#812

Original commit: elastic/x-pack-elasticsearch@1ee3715376
2015-04-21 07:32:44 -04:00
jaymode 197817e900 use a time constant comparison function for security
For HMAC and password hash comparisons we need to use a time
constant comparison that always compares the whole value in order
to protect against timing attacks.

Original commit: elastic/x-pack-elasticsearch@f6082c76b9
2015-04-10 09:37:41 -04:00
jaymode d1759ff322 Tests: update randomization for ES 1.5.1
Elasticsearch version 1.5.1 was released today, so move to testing against
the release version and add 1.5.2-SNAPSHOT.

Original commit: elastic/x-pack-elasticsearch@36b502dbb1
2015-04-09 10:19:11 -04:00
jaymode aec8982996 Build: rename zip to shield-version.zip
As part of the release process, the shield zip files are renamed prior to
uploading to the downloads server. This change removes the need to
rename the file.

Closes elastic/elasticsearch#760

Original commit: elastic/x-pack-elasticsearch@f1822d9d4c
2015-04-07 13:47:23 -04:00
jaymode 11790f3f0d Test: fix compilation error with ES 1.6.0-SNAPSHOT
The contentUnsafe field was removed and this caused a compilation error
with two implementations of RestRequest in test code. This fixes the compilation
error and only uses a single implementation of RestRequest.

Original commit: elastic/x-pack-elasticsearch@d4d8a6ba6b
2015-04-01 10:01:06 -04:00
jaymode f80d49e19c Test: fix realm ordering so that node transport clients still work
Original commit: elastic/x-pack-elasticsearch@24b660ac45
2015-03-31 11:45:55 -04:00
jaymode 2db6f4e281 add type parameters to emptySet()
Original commit: elastic/x-pack-elasticsearch@e7de5b5aff
2015-03-31 10:07:39 -04:00
jaymode 366e27c551 add PKI realm
Adds PKI authentication realm that uses X.509 certificates for authentication.
Authorization is provided through the use of role mapping files.

Closes elastic/elasticsearch#782

Original commit: elastic/x-pack-elasticsearch@5a50e50598
2015-03-31 09:38:46 -04:00
jaymode c0a197c933 Tests: add randomization settings file
Adds randomization.yml file that contains the versions of elasticsearch
and lucene to test the current branch against. This allows us to control
the versions we test against in the repo vs having to continually modify
the randomization scripts.

Closes elastic/elasticsearch#773

Original commit: elastic/x-pack-elasticsearch@5e5645a627
2015-03-27 12:07:02 -04:00
uboness 0abef51d80 Enhanced integration with other plugins
- Added an option for other plugins to define reserved roles. These roles will be reserved for the plugins and will be used by the plugin when executing actions. The reserved roles cannot be overridden by the `roles.yml` file. While at it, also made sure the system role cannot be defined in the `roles.yml` file. The roles can be registered via the `AuthorizationModule.registerReservedRole` method.

- Enable plugins to add their own (new) cluster & index privileges. The can be done by simply calling `Cluster.addCustom` and `Index.addCustom` static methods.

Original commit: elastic/x-pack-elasticsearch@11f795bebd
2015-03-26 13:28:55 +01:00
jaymode a5e33b1aec [test] add active directory realm tests
This adds tests for the active directory realm using the unboundid
in memory directory server.

Closes elastic/elasticsearch#723

Original commit: elastic/x-pack-elasticsearch@e87c8bd65b
2015-03-25 08:15:06 -04:00
jaymode c55994417c [test] remove timing assertion from timeout test
The timeout test times an operation that involves much more than a simple
socket connect. There is overheard from the UnboundID library and its
asynchronous nature that could cause delay in a response. This removes
the assertion that the call to session took less than one second and adds
an assertion about the exceptions cause.

Closes elastic/elasticsearch#740

Original commit: elastic/x-pack-elasticsearch@45577626b6
2015-03-25 07:37:44 -04:00
uboness 336d508172 Changed default in-mem password hashing
- Introduced `ssha256` hashing (salted sha-256) which is now the default in-mem hashing algorithm (instead of bcrypt4)
- changed the `md5` to be a real MD5 algorithm (used to be md5crypt.
- introduced `apr1` hashing algo. which is the old md5crypt algorithm.

Also updated the relevant docs & tests

Original commit: elastic/x-pack-elasticsearch@c8c0be5b95
2015-03-24 02:12:52 +01:00
jaymode 31f3afe684 use the BytesStreamInput with BytesArray
This resolves a compatibility issue with the current builds of elasticsearch
1.6.0.

Closes elastic/elasticsearch#774

Original commit: elastic/x-pack-elasticsearch@0ee97afa53
2015-03-23 21:08:06 -04:00
uboness b0ef266601 moved to elasticsearch 1.5.0
Original commit: elastic/x-pack-elasticsearch@c9fdf1f81a
2015-03-23 18:04:58 +01:00
jaymode 02a2309623 add 1.0.2 to ShieldVersion
Original commit: elastic/x-pack-elasticsearch@da77faf4e6
2015-03-23 09:09:05 -04:00
jaymode 5863e3ab69 update ShieldVersion with 1.1,1.2, and 1.3
Original commit: elastic/x-pack-elasticsearch@dd00a35f51
2015-03-23 07:30:21 -04:00
jaymode eedb677dc2 fix compile error due to new signature of InternalTestCluster
Original commit: elastic/x-pack-elasticsearch@bc8a9099dc
2015-03-20 07:01:57 -04:00
jaymode 1ff99994bc [Test] enable HTTP for rest tests
Original commit: elastic/x-pack-elasticsearch@4c631595b1
2015-03-19 14:12:03 -04:00
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