Commit Graph

1456 Commits

Author SHA1 Message Date
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
uboness 70b5d36098 Enhanced email action
- Introducing the notion of email account (i.e. smtp account). It is now possible to configure multiple email accounts (in node settings) via which the emails will be sent. The email alert action can be configured with an account name, to indicate which account should be used, if no account is configured, the email will be sent with the _default account_. The default account can also be configured using the `default_account` node setting.
- `InternalEmailService` maintains the email sessions and responsible for sending emails.
- the account settings are dynamic (configurable at runtime)
- `Email` class was introduces to abstract away the email structure (`javax.mail`'s `Message` is not the most intuitive construct to deal with. `Email` enables setting both `text` and `html` content and also support normal and inlined attachments.
- "profiles" were added to support different email message formats. Unfortunately the different email systems don't fully comply to the standards and each has their own way of structuring the mime message (especially when it comes to attachments). The `Profile` enum abstracts this by letting the user define what email system structure it wants to support. we define 4 profiles - `GMAIL`, `MAC`, `OUTLOOK` and `STANDARD`. `STANDARD` is the official way of structuring the mime message according to the different RFC standard (it also serves as the default profile).
- The `EmailAction` only task is to create an `Email` based on the action settings and the payload, and send it via the `EmailService`.

Original commit: elastic/x-pack-elasticsearch@2b893c8127
2015-02-10 18:19:11 -08:00
uboness ec42ec8fdc introduced AlertContext
Represents the context of an alert run. It's passed as an argument to all the different constructs that execute during an alert run - trigger, throttler, transform and action. This will provide each execution phase access to to all the results of the previous phase. It also holds the current payload in the execution.

Action results representing failures now hold the `reason` for the failure. This will provide insight on failed action execution as these messages will end up in the fired alert history.

Original commit: elastic/x-pack-elasticsearch@6846a49247
2015-02-09 20:41:42 +01:00
uboness 157c7b6fd6 Introduced the `payload` and `transform` constructs
A payload represents a the payload the is originally created by the trigger and passed all the way down to the executing actions. The action may use this payload during their execution, for example, the email action may use this payload as the model behind the email templats.

A transform represents a transformation of a payload. In its core, it accepts a payload applies a transformation to it and outputs the outcome of the transformation as a payload. This simple design makes transforms chainable, meaning, a list of transformations can be applied in a well defined order to a payload.

The transform is applied on the payload initially generated by the trigger. The output of the transformation will be provided to the actions as a payload when they're executed.

Currently we only have two transform types - `noop` and `search`. The former is a transform construct that doesn't actually do any transformation, but instead outputs the same payload it's applied on. The latter (`search`) perform a search on elasticsearch and uses the output of the search (the search response) as the payload it outputs.

Original commit: elastic/x-pack-elasticsearch@6d40337635
2015-02-07 01:25:47 +01:00
uboness 241444437f Refactored `Alert` and `Alert.Status`
- all alerts are now ackable (there's no way to define an "unackable" alert)
 - `Alert.Status` now holds an `ack` that represents the ack status
 - `Alert.Status` now holds a `lastThrottle` that represents the state of the last throttle (will be `null` if not throttled yet)
 - changed the `Alert.Status.Ack.State` to hold more intuitive values - `awaits_execution`, `ackable` and `acked`
 - `Alert.Status` is now streamble
 - introduced additional info method on `Alert.Status` (e.g. `executed()`, `triggered()`, `ran()`)

Original commit: elastic/x-pack-elasticsearch@3eda1c211a
2015-02-06 18:33:11 +01:00
Brian Murphy 0470fdf6af Add EmailSettingsService to hold global email settings.
This change adds a service to hold the dynamically updateable email settings.
Added logging and made inner settings holding class static.

Original commit: elastic/x-pack-elasticsearch@e1690fa292
2015-02-06 11:08:28 -05:00
Brian Murphy da1f446b49 Add HttpClient to encapsulate HttpRequest from `WebhookAction`
Create a `HttpClient` in alerts.support to handle http requests.
`HttpClient` is an injectable AbstractComponent.

Original commit: elastic/x-pack-elasticsearch@8e70962ddf
2015-02-06 11:02:24 -05:00
Martijn van Groningen f261d8aeaf Componentized the history service and alert record parser.
Renamed AlertRecord to FiredAlert
Refactored the persistence part of FiredAlert out of HistoryService to HistoryStore.
Moved AlertActionState to FiredAlert.State

Original commit: elastic/x-pack-elasticsearch@595c733cfc
2015-02-06 08:23:27 +01:00
Brian Murphy 31a3907bed Use `ParseField` when parsing actions
Use parse fields when parsing and building XContent in Actions.

Original commit: elastic/x-pack-elasticsearch@db48702b76
2015-02-05 16:57:30 -05:00
Brian Murphy 3147927e20 Refactor actions to match trigger refactoring.
This change refactors the old AlertActions code into Actions to mirror the triggers code.
This work also includes the configuration changes and webhook changes from master.
TemplateUtils has been renamed to StringTemplateUtils. References to the old AlertActions code have been removed and updated
to reference the new code.
Action.Result now implements ToXContent
This allows the FiredAlerts to track the history of the actions.

Original commit: elastic/x-pack-elasticsearch@a3d5d3bd4d
2015-02-05 16:42:45 -05:00
uboness 01375a320d updated the alert service and store
Original commit: elastic/x-pack-elasticsearch@61c75d8258
2015-02-05 12:37:08 +01:00
uboness af7cf03a1c removed compound throttler in favour of an alert throttler
We don't really need a generic compound throttler. Instead we now have an `AlertThrottler` that can be configured with optional `AckThrottler` and `PeriodThrottler`.

The logic of what throttler is applied first has therefore moved from the `Alert` to the `AlertThrottler` (back to its natural place)

Original commit: elastic/x-pack-elasticsearch@b81e467c97
2015-02-05 12:08:50 +01:00
uboness 7d9d0aae05 Refactoring of the codebase
Original commit: elastic/x-pack-elasticsearch@08872f71ea
2015-02-05 10:00:48 +01:00
uboness 79ee2ed62e [cleanup] Refactoring of the code base
- Renamed `AlertingModule` to `AlertsModule`
- Started modularizing the code base.. each module has its own guice module and `AlertsModule` spawn all the sub-modules
- Renamed `*Helper` classes to `*Utils` for consistency sake and moved all utilities to `support` package
- Moved `AlertsPlugin` to the base package (no need for `plugin` package... it just creates noise)
- Moved `State` to be inner enum within `AlertsService` (that's where it belongs)
- Moved all the rest actions to `rest.action` package

Original commit: elastic/x-pack-elasticsearch@4ce9bf8dcd
2015-02-03 14:55:28 +01: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 4b38006f64 Changed the alerts client to wrap es client
Instead of having another client interface, the alerts client should be a wrapper around the standard es client. This will make sure that whatever logic that is applied on these std clients will also be applied to any requests/actions that are executed in the alerts client.

Using the es client introduces a cyclic dependency for all those services that use the es client and that are also injected into the transport actions. For this reason, instead of using the es client and script service directory, we're using proxies. The proxies are initialized lazily be a new `InitializationService`.

Also introduced the `AlertsClientModule` and `AlertsTransportModule`

Closes elastic/elasticsearch#56

Original commit: elastic/x-pack-elasticsearch@58990a7c85
2015-02-03 11:54:08 +01: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
Brian Murphy 8c6aad11ed Add username to SMTP settings.
This partially addresses elastic/elasticsearch#69 until I can make the changes suggested in the code review.

Original commit: elastic/x-pack-elasticsearch@0f1433d9b4
2015-01-30 11:31:15 -05:00
Martijn van Groningen 27b6aa50f7 Add version and build information to the stats api
Also set the current maven version to -SNAPSHOT

Original commit: elastic/x-pack-elasticsearch@964c740373
2015-01-30 17:08:19 +01:00
Martijn van Groningen f5605db41b Share all libraries and noop-ed quartz logging
Original commit: elastic/x-pack-elasticsearch@88228b7f46
2015-01-30 17:02:28 +01:00
Martijn van Groningen d68cad9b72 Renamed AlertActionEntry to AlertHistory.
Original commit: elastic/x-pack-elasticsearch@cc48a27a3c
2015-01-29 21:08:34 +01:00
Martijn van Groningen 57e65fccf1 Rename *Manager to *Service
Original commit: elastic/x-pack-elasticsearch@f37d301660
2015-01-29 20:53:51 +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
Martijn van Groningen 61af10f7c0 Added jdoc explanation why the execution of fired alerts is split it into two operations.
Original commit: elastic/x-pack-elasticsearch@03c8645e9d
2015-01-29 17:00:28 +01:00
Martijn van Groningen 11864df421 Fix thread pool name
Original commit: elastic/x-pack-elasticsearch@0ed6327768
2015-01-29 16:20:11 +01:00
Areek Zillur 092bdbe0c9 Add deploy note to readme; change log level to debug
Original commit: elastic/x-pack-elasticsearch@05f1f520fc
2015-01-28 18:22:22 -05: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
Areek Zillur c21cc3494e add deploy-public profile
Original commit: elastic/x-pack-elasticsearch@6ff92a1472
2015-01-26 22:00:29 -05:00
Areek Zillur 8ef2df3f1b moving version to 2.0.0-SNAPSHOT
Original commit: elastic/x-pack-elasticsearch@e6dd782df9
2015-01-26 21:45:36 -05:00
Areek Zillur 3352f77f20 moving version to 1.0.0
Original commit: elastic/x-pack-elasticsearch@9dfc56d75f
2015-01-26 20:27:45 -05:00
Areek Zillur 8705d4d603 [TEST] test initial call to onDisabled
Original commit: elastic/x-pack-elasticsearch@24d20ff3a0
2015-01-26 19:02:42 -05:00
uboness 9c3b72e782 [cleanup] removing redundant import
Original commit: elastic/x-pack-elasticsearch@ec386a9c22
2015-01-27 00:59:09 +01:00
Areek Zillur 0fb0f24e36 [FIX] call onDisabled at first if appropriate
Original commit: elastic/x-pack-elasticsearch@72ddcfd197
2015-01-26 18:55:44 -05: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