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.
Closeselastic/elasticsearch#701
Original commit: elastic/x-pack-elasticsearch@5fbe318046
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.
Closeselastic/elasticsearch#703
Original commit: elastic/x-pack-elasticsearch@825afcdd78
- 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
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
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
- 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
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
Create a `HttpClient` in alerts.support to handle http requests.
`HttpClient` is an injectable AbstractComponent.
Original commit: elastic/x-pack-elasticsearch@8e70962ddf
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
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
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
- 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
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
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.
Closeselastic/elasticsearch#622
Original commit: elastic/x-pack-elasticsearch@67b6121b04
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`
Closeselastic/elasticsearch#56
Original commit: elastic/x-pack-elasticsearch@58990a7c85
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.
Closeselastic/elasticsearch#376
Original commit: elastic/x-pack-elasticsearch@028b3a380b
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
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
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
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
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.
Fixeselastic/elasticsearch#646
Original commit: elastic/x-pack-elasticsearch@c4ed759e16