Commit Graph

865 Commits

Author SHA1 Message Date
Ryan Ernst fedd3b4f4a Convert FileWatchListener to an interface
Original commit: elastic/x-pack-elasticsearch@da9f6eddc1
2016-07-27 15:32:52 -07:00
Nik Everett b9e1bdfce6 Test reindex-from-remote with security
Original commit: elastic/x-pack-elasticsearch@7e3530a958
2016-07-27 14:19:01 -04:00
Chris Earle ac43e72aec [Monitoring] Change xpack.monitoring.collection.exporters to xpack.monitoring.exporters
Removes the exporters from the collection settings.

Original commit: elastic/x-pack-elasticsearch@e721e5cb6d
2016-07-27 14:05:36 -04:00
Areek Zillur 92e357f838 Remove bwc code to read 1.x licenses from cluster state
In 2.x, 1.x license format in cluster state was upgraded
to the 2.x format.  This commit removes the code to read
1.x license format from cluster state in 5.x, as 2.x clusters
will already upgrade the license format to 2.x format.

Original commit: elastic/x-pack-elasticsearch@77f18ffc76
2016-07-27 11:56:13 -04:00
Ryan Ernst d53315b613 Merge branch 'master' into deguice15
Original commit: elastic/x-pack-elasticsearch@38f0a6f641
2016-07-26 15:07:20 -07:00
Ryan Ernst 4089ae0775 move license utils back to public, for now
Original commit: elastic/x-pack-elasticsearch@3e37e2a08f
2016-07-26 14:20:11 -07:00
Ryan Ernst 059bf323c4 Cleanup: Move all license related classes into a single package
This change moves all license related code in xpack under
org.elasticsearch.license. Some classes become package private (more can
become package private later with further deguicing). It also adds
package level javadocs. Note, I did not move anything from the actual
licensing jar.  This should be cleaned up in a followup.

Original commit: elastic/x-pack-elasticsearch@2413c4f288
2016-07-26 13:26:29 -07:00
Ryan Ernst b02b30ee0a Internal: Remove guice from monitoring
This change removes guice from construction of monitoring classes.
Additionally, it removes disk threshold watermark and enabled setting
from node stats collector. These were not node stats, just cluster
settings. If we want to add back actual percentage of disk threshold
used, it should be in node stats directly.

Original commit: elastic/x-pack-elasticsearch@4cd49557cf
2016-07-26 11:25:22 -07:00
Nik Everett 4d063eddbd Rename client yaml tests
Original commit: elastic/x-pack-elasticsearch@4d37d18090
2016-07-26 13:54:40 -04:00
Alexander Reelsen 462897e8c8 Watcher: Fix watch history template for failed inputs (elastic/elasticsearch#2928)
If the result of a search actions fails (i.e. because the index you queried does not exist yet),
the watch record failed to store into the Watch History because of a mapping issue, as the
template path match regular expression did not match properly.

Closes elastic/elasticsearch#2913

Original commit: elastic/x-pack-elasticsearch@3c2d4b3ca9
2016-07-26 18:22:34 +02:00
Ryan Ernst 8e0da2602d Fix license ack tests to ensure license change always results in ack
messages

Original commit: elastic/x-pack-elasticsearch@25029eb83e
2016-07-25 20:12:42 -07:00
Ryan Ernst 3e8bc2879f Add back disabling dependency licenses check
Original commit: elastic/x-pack-elasticsearch@51b76f6f89
2016-07-25 18:06:57 -07:00
Ryan Ernst 1ca2db1d88 Merge branch 'master' into deguice2
Original commit: elastic/x-pack-elasticsearch@c4151d75e1
2016-07-25 17:49:19 -07:00
Ryan Ernst b9a3fa3079 Build: Turn on license header checks
This is dependent on elastic/elasticsearchelastic/elasticsearch#19589. It also fixes the
existing files that either were missing the license header or had the
open source license header.

Original commit: elastic/x-pack-elasticsearch@2642c20381
2016-07-25 17:09:54 -07:00
Nik Everett 3ec40d67a5 Handle core renaming ESRestTestCase
Original commit: elastic/x-pack-elasticsearch@c47a7f839d
2016-07-25 17:58:13 -04:00
Alexander Reelsen 0b2b50be94 Watcher: Put response code in payload in http input (elastic/elasticsearch#2888)
The response status code was stored in the result of an http input,
but inaccessible in the payload itself and could not be used in
scripts.

This puts the status code in the payload under the name '_status_code',
similar to the '_headers' variable, which already stores the headers.

Original commit: elastic/x-pack-elasticsearch@dff2a39535
2016-07-25 14:57:57 +02:00
Alexander Reelsen f02a9cdc35 Watcher: Ensure watch status needs to be udpated on unmet condition (elastic/elasticsearch#2863)
Background: When a watch has been acked, but the condition evaluates to false again,
the watch must be marked as dirty - which means it needs to be persisted to the watches
index - so in case of a master node switch this information is not lost.

This commit fixes the setting of the `dirty` field in the watch status, in case
the condition is not met, but some actions have been acked.

Original commit: elastic/x-pack-elasticsearch@1a55a45b14
2016-07-25 13:24:12 +02:00
Martijn van Groningen d33e639d4c security: Added templating support to DLS' role query.
Closes elastic/elasticsearch#410

Original commit: elastic/x-pack-elasticsearch@2b91ea9eed
2016-07-25 08:11:28 +02:00
Ryan Ernst 0ae6e53173 Internal: Collapse Licensee per feature into single XPackLicenseState
The license code currently has a Licensee implementation per feature,
which is updated by the license service. This meant maintaining a
listener type feature for the license service, and having an abstract
listener and such. The licensee class also mixed in stuff only needed by
the license service (acknowledgement messages).

This change collapses all the methods from licensees into
XPackLicenseState. The naming was inconsistent across licensee
implementations, so here it is standardized on `is*Allowed()`. There are
also a number of tests which should be consolidated for testing the
license service but that is left for a future change. I also removed
collector tests that were testing license: that is better left for the
direct tests of the license state in XPackLicenseStateTests.

Original commit: elastic/x-pack-elasticsearch@734871e870
2016-07-23 16:55:04 -07:00
Ryan Ernst d734d483c5 Merge pull request elastic/elasticsearch#2902 from rjernst/license_state_removal
Internal: Removed LicenseState enum

Original commit: elastic/x-pack-elasticsearch@13abacbb78
2016-07-22 14:25:19 -07:00
javanna 9b73b26b7d Merge branch 'master' into feature/async_rest_client
Original commit: elastic/x-pack-elasticsearch@e58a8d9484
2016-07-22 22:22:14 +02:00
Ryan Ernst 7fcf05dcb1 Internal: Removed LicenseState enum
The LicenseState class exists to distinguish when a license is enabled,
vs being inside its grace period. However, the consumers of this state
do not care whether the license is in the grace period, they view that
and an active license as the same thing. The only part that cares about
the grace period is in the license service which logs a warning when a
license begins its grace period.

This change removes the LicenseState enum in favor of a simple boolean
indicating whether the license is active.

Original commit: elastic/x-pack-elasticsearch@5a90a0e3d4
2016-07-22 11:30:56 -07:00
Ryan Ernst dcb9145b93 Merge pull request elastic/elasticsearch#2891 from rjernst/license_service_name
Rename LicensesService to LicenseService

Original commit: elastic/x-pack-elasticsearch@e9c3058ca1
2016-07-22 08:47:06 -07:00
Alexander Reelsen efc5de782b Watcher: Refactor integration test into rest test (elastic/elasticsearch#2864)
As the specified integration tests were better suited as REST tests, I changed them into
those and removed the (partially already unused) java classes.

Original commit: elastic/x-pack-elasticsearch@f26d8d94e8
2016-07-22 17:01:57 +02:00
javanna 748962e626 Merge branch 'master' into feature/async_rest_client
Original commit: elastic/x-pack-elasticsearch@cb4f022353
2016-07-22 15:52:44 +02:00
Ryan Ernst a93a5fcd5b Rename LicensesService to LicenseService
We only have one license in 5.x. This change renames the service that
mantains the license state on each node to reflect that fact.

Original commit: elastic/x-pack-elasticsearch@bb241b30cb
2016-07-21 11:59:52 -07:00
Alexander Reelsen 81382262ec Watcher: Hardcode index names for auto index create validation (elastic/elasticsearch#2834)
This is broken in 2.x and returns a wrong index name. We should just use
the indices, that are hardcoded in the error message.

Relates elastic/elasticsearch#2831

Original commit: elastic/x-pack-elasticsearch@457be61013
2016-07-21 14:25:22 +02:00
Jim Ferenczi bd91603f6d Sort plugins in list x-pack extensions command
Fix tests that rely on deterministic order.

Original commit: elastic/x-pack-elasticsearch@324b0db514
2016-07-20 19:45:10 +02:00
Britta Weber 75362e70a3 fix compile
Original commit: elastic/x-pack-elasticsearch@d234e88c22
2016-07-20 19:24:56 +02:00
Ryan Ernst 59c76e1bc6 Merge pull request elastic/elasticsearch#2873 from rjernst/deguice11
Remove guice from authentication and authorization services

Original commit: elastic/x-pack-elasticsearch@323540a4eb
2016-07-20 08:52:25 -07:00
Jim Ferenczi 7467652b43 Add verbose mode for extension list command
This is a late follow up of https://github.com/elastic/elasticsearch/pull/18051
Closes elastic/elasticsearch#2806

Original commit: elastic/x-pack-elasticsearch@d1c9a3d7c5
2016-07-20 14:37:36 +02:00
Ryan Ernst f05005f667 Internal: Remove guice from authentication and authorization services
This change removes guice from most of the rest of security. It also
converts the last use of onModule in xpack extensions to a pull based
extension.

Original commit: elastic/x-pack-elasticsearch@9de072550e
2016-07-19 15:57:29 -07:00
Ryan Ernst 94b9b332d4 Internal: Remove interfaces for auth services
Both AuthenticationService and AuthorizationService are currently
interfaces with single implementations. This is unnecessary, and makes
it harder to deguice. This change removes the abstractions and leaves
just AuthenticationService and AuthorizationService.

Original commit: elastic/x-pack-elasticsearch@d04c897ae4
2016-07-19 14:38:51 -07:00
Ryan Ernst 6c7a9af7bf Internal: Remove use of AuditTrail interface in place of
AuditTrailService

We currently have a number of actions and components which try to write
to the audit trail. But they do so by expecting a bound AuditTrail
object. In reality, this should always be AuditTrailService, except when
security is disabled. This change removes the use of the AuditTrail
interface for that purpose, and instead makes the AuditTrailService
allow an empty list of trails, so that it is always bound when running
on a node.

Original commit: elastic/x-pack-elasticsearch@9559dbd6c1
2016-07-19 13:41:19 -07:00
jaymode 9be5c7df60 security: remove SelfReSchedulingRunnable
This commit removes the SelfReschedulingRunnable and changes the native stores
to use the threadpool for scheduling again since we have now fixed the issue in core.

Original commit: elastic/x-pack-elasticsearch@50030e31ff
2016-07-19 12:19:52 -04:00
Ryan Ernst 4552df11da Merge pull request elastic/elasticsearch#2860 from rjernst/deguice12
Internal: Simplify SecurityContext dependencies

Original commit: elastic/x-pack-elasticsearch@74d0036e80
2016-07-19 09:05:26 -07:00
javanna 63a5001837 [TEST] restore throws IOException clause on all sync performRequest callers
Original commit: elastic/x-pack-elasticsearch@d114419752
2016-07-19 16:51:07 +02:00
javanna 5c31e20746 Use ContentType constant instead of RestClient#JSON_CONTENT_TYPE
Original commit: elastic/x-pack-elasticsearch@6f3165b569
2016-07-19 16:42:32 +02:00
javanna ca557af48c Merge branch 'master' into feature/async_rest_client
Original commit: elastic/x-pack-elasticsearch@693e281d0d
2016-07-19 16:29:50 +02:00
Yannick Welsch ea7ad5d4c5 Add new transport handler introduced by elastic/elasticsearchelastic/elasticsearch#19287
Original commit: elastic/x-pack-elasticsearch@8e71782cba
2016-07-19 14:56:51 +02:00
Martijn van Groningen 7c12fa0eb6 Removed basic sanity test as it caused problems for the clients
Original commit: elastic/x-pack-elasticsearch@1bd7c82708
2016-07-19 10:59:23 +02:00
Martijn van Groningen cc7cfb7fd9 security: Added `set_security_user` ingest processor that enriches documents with user details of the current authenticated user
This is useful if an index is shared with many small customers, which are to small to have their own index or shard,
 and in order to share an index safely they will need to use document level security. This processor can then automatically
 add the username or roles of the current authenticated user to the documents being indexed, so that the DLS query can be simple. (`username: abc` only return data inserted by user abc)

Closes elastic/elasticsearch#2738

Original commit: elastic/x-pack-elasticsearch@f4df2f6d6f
2016-07-19 09:48:52 +02:00
Ryan Ernst a76a6b4e54 Internal: Simplify SecurityContext dependencies
Currently the security context is an object passed around to code
needing to check the user for the current request. Like recent
InternalClient changes, it current depends on the AuthenticationService,
but can be simplified by only knowing about the thread context and
crypto service. This change makes SecurityContext a class, instead of an
interface, and removes the dependency on AuthenticationService.

Original commit: elastic/x-pack-elasticsearch@b8af75e8cb
2016-07-18 17:00:55 -07:00
Ryan Ernst 41eea741b8 Ensure index audit trail is bound for security lifecycle service
Original commit: elastic/x-pack-elasticsearch@bbe7ec0802
2016-07-18 15:13:10 -07:00
Ryan Ernst f03683fb18 Internal: Remove guice from audit trail construction
This change removes guice from audit trails.

Original commit: elastic/x-pack-elasticsearch@ace1f11dc4
2016-07-18 13:59:51 -07:00
Ryan Ernst e2303f2584 Merge branch 'master' into deguice8
Original commit: elastic/x-pack-elasticsearch@8b273d3f8a
2016-07-18 13:54:43 -07:00
Ryan Ernst 07c9903e8f Merge branch 'master' into remove_script_proxy
Original commit: elastic/x-pack-elasticsearch@0046ab598a
2016-07-18 13:41:21 -07:00
jaymode 67f473a992 test: mute ldap timeout tests
See elastic/elasticsearch#2849

Original commit: elastic/x-pack-elasticsearch@318307073e
2016-07-18 11:20:52 -04:00
Simon Willnauer 12c709ea3a Move over to dedicated TransportClient implementations (elastic/elasticsearch#2819)
Followup of elastic/elasticsearchelastic/elasticsearch#19435
Relates to elastic/elasticsearchelastic/elasticsearch#19412

Original commit: elastic/x-pack-elasticsearch@60f7047ea9
2016-07-18 15:43:29 +02:00
jaymode 34d04a8c78 security: mention comma-separated for IP and DNS name prompts
Original commit: elastic/x-pack-elasticsearch@3e58fc282a
2016-07-18 08:53:17 -04:00