Commit Graph

5732 Commits

Author SHA1 Message Date
javanna 847fc21def [TEST] temporarily log the default locale in REST tests
The locale is being randomized but never printed out for now (fixed upstream but we still depend on 1.4.0). We need to temporarily log it out manually to debug some test failures that might be related to the locale randomization (in combination with build machines settings).

Original commit: elastic/x-pack-elasticsearch@6f7e9625d1
2014-12-02 19:24:12 +01:00
uboness eac85eda10 [Cleanup] - FileRolesStore no longer depends on AuthorizationService
It used to be required, but since elastic/x-pack@607fabbade it's no longer needed.

Original commit: elastic/x-pack-elasticsearch@3c60798c2e
2014-12-02 19:04:25 +01:00
javanna 452851be6a [TEST] fixed tests repeatability issue
Every random call should happen all the time on all platforms (unless randomized!), otherwise tests won't reproduce on different platforms.

Original commit: elastic/x-pack-elasticsearch@d5b2d2079c
2014-12-02 18:43:43 +01:00
Alexander Reelsen 1d4422fc79 Profiles: Add client server transport filter
This PR allows to configure different ServerTransportFilters per profile.
By default there is a `server` transport filter, that does authentication
and a `client` on that rejects internal actions and shard actions.

Closes elastic/elasticsearch#312

Original commit: elastic/x-pack-elasticsearch@1ce66495a5
2014-12-02 16:59:20 +01:00
Alexander Reelsen dca9f3115e IP Filtering: Add support for having on filters on HTTP transport
In order to fix elastic/elasticsearch#378 a problem was revealed, that the ip filter for HTTP was
always the one for the default profile, which lead to failed tests (along
with wrong socket connections, which made the test go green irregularly).

This commit fixes the tests and allow to configure own HTTP ip filters, adding
the following settings

* shield.http.filter.enabled
* shield.http.filter.allow
* shield.http.filter.deny

If not specific settings are configured, the one of the default profile are used.

Closes elastic/elasticsearch#378

Original commit: elastic/x-pack-elasticsearch@89dbaefe9a
2014-12-02 16:44:15 +01:00
uboness 63a483e77e [Cleanup] - refactored out N2NAuthenticator
N2NAuthenticator was not really used. Only the ip filtering authenticator was used, and was used directory (no use for a generic interface). `IPFilteringN2NAuthenticator` is now `IPFilter` and all relevant classes were moved to `shield.transport.filter` package.

Original commit: elastic/x-pack-elasticsearch@43f6faeb4b
2014-12-02 14:27:54 +01:00
Alexander Reelsen 8bcbc690ce SSL: Re-enabling configuration option to disable client auth
In order to not require client side SSL certs for transport clients
another option was added in the profile configuration to enable
or disable client side certs. The same option has also been added
for HTTP.

Original commit: elastic/x-pack-elasticsearch@9658598bdc
2014-12-02 14:01:50 +01:00
uboness 1c54bf0d2e Added validation for esusers username, password and role name
Force validation of eusers username & password, and the role names.

role names and usernames follow the following validation rule:
```
A valid name must be at least 1 characher and no longer than 30 characters. It must begin with a letter (`a-z` or `A-Z`)
or an underscore (`_`). Subsequent characters can be letters, underscores (`_`), digits (`0-9`) or any of the following
symbols `@`, `-` or `$`
```

passwords must be at least 6 characters long.

Closes elastic/elasticsearch#399

Original commit: elastic/x-pack-elasticsearch@e6be51b357
2014-12-02 12:49:10 +01:00
javanna d7478b188e [TEST] restored `gateway: local` settings in ClusterDiscoveryConfiguration fork and clarify version assert (now for real)
Local gateway has been removed in core, but it's a master only change. If we don't set it to local in our settings, we end up using the none gateway and KnownActionsTests fails because the local gateway endpoint are not registered to core.

Original commit: elastic/x-pack-elasticsearch@9bb550329f
2014-12-02 11:07:05 +01:00
javanna 731feff48f [TEST] restored `gateway: local` settings in ClusterDiscoveryConfiguration fork and clarify version assert
Local gateway has been removed in core, but it's a master only change. If we don't set it to local in our settings, we end up using the none gateway and KnownActionsTests fails because the local gateway endpoint are not registered to core.

Original commit: elastic/x-pack-elasticsearch@c3bc37df4b
2014-12-02 11:06:29 +01:00
javanna 16929a0da7 [TEST] sync our fork of ClusterDiscoveryConfiguration with core
This class will be deleted when we'll depend on the next version, for now we forked it and we have to keep it up-to-date

Original commit: elastic/x-pack-elasticsearch@0d7cfdfe3d
2014-12-02 10:33:23 +01:00
javanna 45f5bd1967 [TEST] randomly enable/disable ssl on the transport layer
We currently run with ssl always on on the transport layer, which means that we never test with ssl off. We found bugs in the past caused by the ssl classes being loaded even when ssl was disabled, those should be caught by this new randomization.

Added method to override whether ssl is enabled or not for SUITE and TEST tests, called sslTransportEnabled(). A couple of tests do require ssl always on, thus they enable it through that method, which means that both nodes and transport client will have the keystore configured and ssl enabled on the transport.

Note that ssl on http is not touched here, that stays off by default unless enabled specifically in SUITE or TEST tests.

Closes elastic/elasticsearch#396

Original commit: elastic/x-pack-elasticsearch@63061b97ff
2014-12-02 09:52:35 +01:00
Areek Zillur 01439e42cd [Plugin] Ensure a consumer plugin registers only once to LicensesClientService
closes elastic/elasticsearch#8

Original commit: elastic/x-pack-elasticsearch@6f4a0a71ce
2014-12-01 22:18:37 -05:00
Areek Zillur be26fd7c49 Expose plugin name in a public constant
closes elastic/elasticsearch#27

Original commit: elastic/x-pack-elasticsearch@3410ca2e3d
2014-12-01 22:08:25 -05:00
jaymode 7a6a3d072f Fix password comparison in UsernamePasswordToken.equals
The password comparison in the UsernamePasswordToken compares the
instances password to itself instead of the other instances password.

Closes elastic/elasticsearch#405

Original commit: elastic/x-pack-elasticsearch@3cb5658edf
2014-12-01 19:08:35 -05:00
jaymode c1cac5887a Add ip filtering output to the audit trail
This replaces the use of the logger in the IPFilteringN2NAuthenticator with the
AuditTrail, so that the connection granted or denied messages will now be seen
with the rest of the audit output.

Closes elastic/elasticsearch#101

Original commit: elastic/x-pack-elasticsearch@10218a45a9
2014-12-01 18:27:23 -05:00
uboness da430a5143 Fixes lazy loading issues in the codebase
- SSLService needs to be lazy loaded (only loaded when required). Guice provider doesn't seem to work as all singleton bindings are forced to be loaded eagerly. For this reason, a new `SSLServiceProvider` is introduced and is injected wherever the SSLService might be needed (SSLService is never injected directly)

 - `IPFilteringN2NAuthenticator` is now always injected and used. enabling/disabling the filtering is handled within the `IPFilteringN2NAuthenticator` and the `SecuredMessageChannelHandler` on the transport is always set. Although we add another handler to netty's event chain (even while having ip filtering disabled), the overhead of this handler is negligible and this will also enabled enabling/disabling filtering at runtime (if we choose to support it) via API later on.

Original commit: elastic/x-pack-elasticsearch@cd44ecd6ac
2014-12-01 11:21:56 -08:00
Martijn van Groningen d3dcecbd77 Changed visibility of setters and made naming of setters and getters consistent
Original commit: elastic/x-pack-elasticsearch@c9cc736012
2014-12-01 18:52:02 +01:00
Martijn van Groningen 8e8d360fd2 Test: ensure a no action entry has been fired
Original commit: elastic/x-pack-elasticsearch@0e6d915669
2014-11-28 16:32:09 +01:00
Martijn van Groningen 8910a1f284 Let the xcontent type of alert history documents be based on the xcontent type of alert documents.
Closes elastic/elasticsearch#54

Original commit: elastic/x-pack-elasticsearch@e03bf5d3bf
2014-11-28 15:54:32 +01:00
Martijn van Groningen c094430584 Moved the stopping log info message
Original commit: elastic/x-pack-elasticsearch@0391704846
2014-11-28 15:36:34 +01:00
javanna 123d577a88 Remove benchmark privileges and actions from codebase and docs
Closes elastic/elasticsearch#384

Original commit: elastic/x-pack-elasticsearch@13cdefd585
2014-11-28 13:41:51 +01:00
Martijn van Groningen b883641b01 Also check if the refresh was successful on all the shards it was supposed to execute.
Original commit: elastic/x-pack-elasticsearch@ab867346e4
2014-11-28 12:49:51 +01:00
javanna ac2b30f150 [TEST] delete the temp folder if already existing (this time for real)
Original commit: elastic/x-pack-elasticsearch@618fcd4dbd
2014-11-28 10:11:38 +01:00
Areek Zillur 4ba17be1e6 minor edit
Original commit: elastic/x-pack-elasticsearch@da50e65388
2014-11-27 18:54:48 -05:00
Areek Zillur 3bbc666b82 Update Readme for multi-module setup
Original commit: elastic/x-pack-elasticsearch@65895002b5
2014-11-27 18:53:20 -05:00
Areek Zillur 43284305b6 Make elasticsearch-license multi-module:
- core-shaded - has CryptUtils (used by core and can be shared with consumer plugins)
 - core - License data structures & verifier
 - licensor - License Signer along with key-pair and license generation, verification
 - plugin - Enforce licensing on a deployment

Original commit: elastic/x-pack-elasticsearch@041ef3a9f1
2014-11-27 13:14:54 -05:00
Martijn van Groningen 737e9567b9 Alert action manager: Start the queue reader thread with self maintained thread instead of using thread pool.
This gives us more control over interrupting and joining this thread during stopping, so we have a good moment in time to clear the queue.

Original commit: elastic/x-pack-elasticsearch@ed3f85fa75
2014-11-27 17:22:22 +01:00
Martijn van Groningen 0ec1f66c60 Test: Run refresh before the search on metadata occurs.
Original commit: elastic/x-pack-elasticsearch@2097f01458
2014-11-27 17:20:32 +01:00
Martijn van Groningen ac715134b3 Increased logging
Original commit: elastic/x-pack-elasticsearch@39093540fd
2014-11-27 15:46:41 +01:00
Brian Murphy fbec93d941 This adds metadata to alerts that are copied to the action entries for this alert.
Original commit: elastic/x-pack-elasticsearch@0abfc22421
2014-11-27 14:00:28 +00:00
Martijn van Groningen b54aea7c14 Test: We can't be sure how often an alert has been fired, so these asserts should by in the atleast mindset.
Original commit: elastic/x-pack-elasticsearch@d4195eb3c0
2014-11-27 14:27:56 +01:00
Martijn van Groningen c29e3c9611 But we still need to clear if loading fails
Original commit: elastic/x-pack-elasticsearch@69bf786e81
2014-11-27 14:07:20 +01:00
Martijn van Groningen 385ea45b7c If loading or alerts or alert entries fail the alert manager should retry and if the search response are partial alert manager should retry as well.
Original commit: elastic/x-pack-elasticsearch@ea6a5a6372
2014-11-27 13:57:09 +01:00
Martijn van Groningen 6da23d412a When stopping alert manager wait for ongoing operations to complete.
Original commit: elastic/x-pack-elasticsearch@646e534628
2014-11-27 13:36:09 +01:00
javanna 8c1fcb52ea [TEST] delete and recreate config dir if already existing
Original commit: elastic/x-pack-elasticsearch@90af42b95d
2014-11-27 12:34:34 +01:00
Martijn van Groningen 27f83bb621 Clear the queue once the reader thread sees that it needs to stop.
Original commit: elastic/x-pack-elasticsearch@b70a224ff1
2014-11-27 12:14:30 +01:00
Martijn van Groningen 1cd5ae6a31 Added assertion
Original commit: elastic/x-pack-elasticsearch@3aae405242
2014-11-27 11:40:56 +01:00
javanna a995ed9cca [TEST] allow to configure tests.timezone and tests.locale
tests.timezone and tests.locale are values that gets randomized all the time (even without configuring them). They don't get printed yet out with shield failures as this was only recently added to es core, but it makes sense to get ready and allow to configure them for better test repeatability.

Also removed support for es.node.mode and es.node.local as we always use network since we test with unicast discovery only.

Original commit: elastic/x-pack-elasticsearch@d03fa0c162
2014-11-27 11:40:13 +01:00
Martijn van Groningen 29dd1bb888 Removed error log for null values
Original commit: elastic/x-pack-elasticsearch@4477fc1c2a
2014-11-27 10:17:51 +01:00
Martijn van Groningen 775f1cb878 Increased logging
Original commit: elastic/x-pack-elasticsearch@375279fca5
2014-11-27 09:53:10 +01:00
Martijn van Groningen 45ee1d2d9b Test: Added test that uses an agg in a trigger.
Original commit: elastic/x-pack-elasticsearch@ad87b18aa5
2014-11-26 23:31:40 +01:00
Martijn van Groningen 3965cb194c Make sure that the alerts templates get applied and disabled test template since it conflicts with the alerts templates.
Original commit: elastic/x-pack-elasticsearch@ddd178da78
2014-11-26 23:23:15 +01:00
Martijn van Groningen e4d10c58a9 Core: load alert store before the action manager, b/c action depends on alert store
Original commit: elastic/x-pack-elasticsearch@6aa3cb33b0
2014-11-26 22:51:34 +01:00
Martijn van Groningen 56a121109d Simplified getAlertHistoryIndexNameForTime()
Original commit: elastic/x-pack-elasticsearch@08ce6daf75
2014-11-26 22:38:40 +01:00
Martijn van Groningen 4048bfe55c Removed explicit delete index calls, because it redundant and the test framework wipes the clusters between tests.
Original commit: elastic/x-pack-elasticsearch@eebeef3bee
2014-11-26 22:18:19 +01:00
Martijn van Groningen 6b4f68fcb3 Test: made the simple no master node test more useful
Original commit: elastic/x-pack-elasticsearch@4ffc11d702
2014-11-26 22:00:26 +01:00
Martijn van Groningen 168bed9d32 Restored some code and fix the assert trigger methods
Original commit: elastic/x-pack-elasticsearch@7ca18b77b9
2014-11-26 21:56:13 +01:00
Paul Echeverri fff49d9e53 Merge branch 'doc-295' of https://github.com/palecur/elasticsearch-shield
Original commit: elastic/x-pack-elasticsearch@e63e3db412
2014-11-26 11:54:27 -08:00
Brian Murphy 871274adbd Add back in the exists checks for the alert history indices.
Original commit: elastic/x-pack-elasticsearch@a170742e56
2014-11-26 18:17:31 +00:00