Commit Graph

424 Commits

Author SHA1 Message Date
jaymode 03520e0aa7 [CLI] check the number of arguments for esusers commands
Adds a check to all of the esusers commands to ensure the correct number
of arguments are found. If extra arguments are found, they are printed out
with an error message and the tool exits.

Closes elastic/elasticsearch#817

Original commit: elastic/x-pack-elasticsearch@cd3e786267
2015-06-01 08:21:31 -04:00
jaymode b8f75a2bae Netty: reduce logging for a close request during handshake
Reduces the amount of logging on both HTTP and Transport protocols for
a channel being closed while in the middle of a handshake. This often
occurs when the client does not trust the server certificate and aborts the
handshake. Also, reduces logging on the Transport protocol for a
plain text message received on a channel that is using TLS.

Closes elastic/elasticsearch#771

Original commit: elastic/x-pack-elasticsearch@321c384ddd
2015-06-01 08:04:55 -04:00
jaymode 6e660dbd7d remove commons codec dependency
This commit removes the commons codec dependency and simplifies the
hasher code by only supporting bcrypt encryption in the users file. All tests
now also exercise the esusers realm with bcrypt instead of plain text passwords.

Closes elastic/elasticsearch#806

Original commit: elastic/x-pack-elasticsearch@3119267851
2015-06-01 07:52:38 -04:00
jaymode ba1001a3a4 update BCrypt implementation to version 0.4
This updates the BCrypt implementation that we use to version 0.4, which
corrects an integer overflow bug when a large number of rounds are used.

Closes elastic/elasticsearch#865

Original commit: elastic/x-pack-elasticsearch@2f9a07e7c8
2015-05-29 13:52:39 -04:00
jaymode 2e4f3e8d23 make TLSv1.2 the default protocol
This commit makes TLSv1.2 the default protocol for better security. The
old value of TLS would only pick a TLSv1.0 supporting context and cause
client connections to be negotiated using that protocol when TLSv1.2 is
supported and considered an improved protocol.

Closes elastic/elasticsearch#867

Original commit: elastic/x-pack-elasticsearch@1f062f6dde
2015-05-29 13:46:48 -04:00
jaymode 44017711e2 remove DHE cipher from default list
This commit removes the DHE cipher from our list of enabled ciphers
due to the recently published Logjam attack. The default configuration
is not susceptible to the Logjam attack, but since we support Java 7
the maximum prime size (768 bit) is considered too weak. Java 8 supports
1024 bit primes, but these are also not ideal and this cipher should not be
used with a prime smaller than 2048 bits.

Closes elastic/elasticsearch#862

Original commit: elastic/x-pack-elasticsearch@9785bf47cf
2015-05-29 13:33:54 -04:00
jaymode c01eef8863 Test: update with new core actions and upgrade api changes
Original commit: elastic/x-pack-elasticsearch@0189cf850f
2015-05-29 09:16:31 -04:00
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