Commit Graph

494 Commits

Author SHA1 Message Date
Robert Muir 9e36796126 Merge pull request elastic/elasticsearch#973 from rmuir/fix_version
bump version to 2.0.0.beta1-SNAPSHOT and fix broken assert.

Original commit: elastic/x-pack-elasticsearch@08c68b3d22
2015-07-09 20:20:11 -04:00
Robert Muir e516427bfc bump version to 2.0.0.beta1-SNAPSHOT and fix broken assert.
this was already done in ES core, but commercial plugins are now sitting out of sync.

also 'mvn verify' would sometimes fail, because apparently the list of plugins from the plugin api
is not defined (my suspicion: filesystem order, which is undefined). For now I changed the assert
to allow any order.

Original commit: elastic/x-pack-elasticsearch@9ea0ac457f
2015-07-09 20:04:08 -04:00
Robert Muir f91059d1a9 Merge pull request elastic/elasticsearch#968 from rmuir/integ_tests
packaging, config, and file permissions are busted

Original commit: elastic/x-pack-elasticsearch@74787a2123
2015-07-09 12:58:03 -04:00
Robert Muir c3387464c6 Merge branch 'integ_tests' of github.com:rmuir/elasticsearch-shield into integ_tests
Conflicts:
	dev-tools/integration-tests.xml

Original commit: elastic/x-pack-elasticsearch@caf32d7cac
2015-07-09 12:53:21 -04:00
Robert Muir 889e63c6f5 remove chmod hack
Original commit: elastic/x-pack-elasticsearch@51bd629e5a
2015-07-09 12:52:27 -04:00
jaymode aac2fb5b75 elasticsearch-shield back to shield
Original commit: elastic/x-pack-elasticsearch@128fda2cd3
2015-07-09 11:35:30 -04:00
jaymode d2d5e62230 make integration tests work
Original commit: elastic/x-pack-elasticsearch@379e705138
2015-07-09 09:41:23 -04:00
jaymode b1147e3cb3 fix IndexAuditTrailTests
Original commit: elastic/x-pack-elasticsearch@d94ecf98e1
2015-07-09 07:21:45 -04:00
Robert Muir f7046efd48 use java.io.tmpdir for the GET hack
Original commit: elastic/x-pack-elasticsearch@ed63b5add8
2015-07-09 02:56:41 -04:00
Robert Muir bdb36263b3 get ES server started and stopped with shield... but many problems
Original commit: elastic/x-pack-elasticsearch@c6b6bc4c10
2015-07-09 02:48:45 -04:00
Robert Muir 1d0d30538d Disable integ test until we fix it to install license-plugin
Original commit: elastic/x-pack-elasticsearch@25f5d96b71
2015-07-08 03:23:49 -04:00
Robert Muir e09806e21e Merge pull request elastic/elasticsearch#962 from rmuir/integ_testing
Get basic integ test working... fixes broken groupids etc.

Original commit: elastic/x-pack-elasticsearch@7d0262c29a
2015-07-07 09:50:30 -04:00
Robert Muir 23190e4aff Get basic integ test working... fixes broken groupids etc.
Note currently this just installs the plugin. we need to add some
more logic to really get some kind of integ test working with rest tests.
e.g. we need to install the license plugin. I will look into this as a followup.

Original commit: elastic/x-pack-elasticsearch@ebc507a1fb
2015-07-07 09:42:12 -04:00
jaymode af377e6608 re-enable rest tests
Original commit: elastic/x-pack-elasticsearch@145d449099
2015-07-07 09:34:51 -04:00
uboness bca8f140c2 disabling rest tests
first focusing on getting a successful build without them

Original commit: elastic/x-pack-elasticsearch@cfc1e97c43
2015-07-03 20:38:19 +02:00
uboness 7350301792 Continued removing custom exceptions
- Removed `AuthorizationException` and `AuthenticationException`, both were replaced by the std `ElasticsearchSecurityException`.
- Added utility class `Exceptions` to help create authorization/authentication exceptions.
- Added a utility class `ShieldTestsUtils` that provides methods for asserting authentication/authorization exceptions

Original commit: elastic/x-pack-elasticsearch@b59360ebc7
2015-07-03 20:02:39 +02:00
jaymode a3a04a7d1d cleanup the exceptions used by Shield to only the ones in core
Original commit: elastic/x-pack-elasticsearch@5424fe68fa
2015-07-03 20:01:41 +02:00
uboness 792359103d Removed LicenseExpiredException
This exception was removed from the license plugin. We use `ElasticsearchException` instead with `es.license.expired.feature` header to hold the expired feature. We use `LicenseUtils.newExpirationException` to create and throw the proper exception.

Original commit: elastic/x-pack-elasticsearch@5e722be1cc
2015-07-03 02:54:54 +02:00
Konrad Beiske 31e2516fd6 Changed to depend only on license-plugin-api in main scope
Original commit: elastic/x-pack-elasticsearch@e508b73033
2015-07-02 11:04:29 -04:00
Konrad Beiske c9aba06721 Merge pull request elastic/elasticsearch#945 from elastic/beiske-attach-zip-assembly
Attach zip assembly as artifact to build when deploying internally

Original commit: elastic/x-pack-elasticsearch@851687bc88
2015-07-02 16:26:49 +02:00
Konrad Beiske 44909bdcd6 Attach zip assembly as artifact to build when deploying internally
Attaching the zip assembly as an artifact to the build will include it when deploying to maven repositories. This will in turn facilitate testing Elasticsearch snapshot versions in a Found environment. We need to to that in order to cut down the delay from a release is made until it is available on Found.

Original commit: elastic/x-pack-elasticsearch@27516c7243
2015-07-02 16:18:03 +02:00
jaymode b7133a516a awaits fix for another test failing due to exception serialization changes
Original commit: elastic/x-pack-elasticsearch@9585a3647b
2015-07-01 09:37:47 -04:00
jaymode b3cd671d45 add awaits fix for exception serialization issue
Original commit: elastic/x-pack-elasticsearch@6c9e993a62
2015-06-30 18:55:39 -04:00
jaymode 2d71019df9 mute tests that rely on ShieldException serialization
See elastic/elasticsearch#947

Original commit: elastic/x-pack-elasticsearch@28a69c3193
2015-06-30 18:26:45 -04:00
jaymode aef47ecc47 mute the render_search_template rest tests for now
These tests trip a Shield assertion. Need to look into how to proceed in detail.

See elastic/elasticsearch#946

Original commit: elastic/x-pack-elasticsearch@b5027ce105
2015-06-30 18:25:42 -04:00
jaymode ed0aea1311 add new action and handlers from core
Original commit: elastic/x-pack-elasticsearch@457055e5d2
2015-06-30 17:57:07 -04:00
Martijn van Groningen 1fffcc9666 fix compile error due to a rename in core
Original commit: elastic/x-pack-elasticsearch@03c9032c8b
2015-06-30 18:12:25 +02:00
jaymode 480ee9cabc only load the shield plugin for remote auditing client
Currently, any plugin that is on the classpath will be loaded by the TransportClient we create
for remote audit indexing. The only plugin that should be loaded for this client is the Shield
plugin. To accomplish this, we disable loading of plugins from the classpath and specify that
the Shield plugin should be loaded.

Closes elastic/elasticsearch#941

Original commit: elastic/x-pack-elasticsearch@2bc0a8ce17
2015-06-30 06:21:54 -04:00
Robert Muir 9edfd2f0d0 remove jar hell
Original commit: elastic/x-pack-elasticsearch@205e35baf9
2015-06-30 00:59:05 -04:00
Robert Muir 3543d7874b don't depend on ant tasks in tests
Original commit: elastic/x-pack-elasticsearch@ebbc490a2e
2015-06-30 00:56:26 -04:00
Robert Muir 9380b5c050 Merge pull request elastic/elasticsearch#942 from rmuir/securemock
Use elasticsearch securemock library

Original commit: elastic/x-pack-elasticsearch@198b7ab3b1
2015-06-29 11:08:33 -04:00
Robert Muir ebd515e6ee Use elasticsearch securemock library
Original commit: elastic/x-pack-elasticsearch@b44c85ca99
2015-06-29 10:38:52 -04:00
jaymode 8258cd9f18 add versions 1.2.2 and 1.3.0
Original commit: elastic/x-pack-elasticsearch@b449e20b66
2015-06-24 13:28:26 -04:00
jaymode a7be4867c1 Test: fix exception text assert due to change in es core
Original commit: elastic/x-pack-elasticsearch@c9e711f8c9
2015-06-24 11:45:02 -04:00
jaymode d65bfd1721 use doc_values for most fields in audit indices
This changes the mappings for the audit indices to use doc_values for all fields
other than the request_body, which will have a lot of variance. Additionally, the
request_body field is no longer indexed.

Closes elastic/elasticsearch#918

Original commit: elastic/x-pack-elasticsearch@4917529ffa
2015-06-23 09:40:27 -04:00
jaymode f0d5c2da61 make addition of message to the bulk processor asynchronous
The index audit trail is currently using a BulkProcessor directly, which under
certain conditions can result in a deadlock. This occurs when the BulkProcessor
is executing a bulk request that triggers another request on the same node and
a flush of the BulkProcessor is also triggered at the same time. The flush
operation holds the lock on the bulk processor but block on acquiring a permit
from the semaphore. The request that was triggered by the bulk request blocks
the release of the semaphore permit since it needs to add a new audit message
to the BulkProcessor.

This commit works around this issue by making use of a bounded queue between the
index audit trail and the BulkProcessor with a consumer thread that handles the
add calls to the BulkProcessor.

Additionally, a new state, INITIALIZED, was added for the lifecycle of the index
audit trail. This is needed for tests since the audit trail can stop, a new
cluster state update is received, and the ShieldLifecycleService will restart the
index audit trail. At the end of the tests, the test infrastructure interrupts all
the threads and this was causing tests to fail with a InterruptedException.

Finally, the test infrastructure was also deleting the template for the index audit
logs, so this commit adds the necessary logic to prevent the deletion of this
template.

Closes elastic/elasticsearch#920

Original commit: elastic/x-pack-elasticsearch@f1b0b47b99
2015-06-22 16:34:23 -04:00
jaymode 9fcd68c8f4 always store origin type and request content for rest requests
The change fixes two bugs in the index audit trail implementation. The first is that
we did not always store the origin type with rest requests. The second is that a
conditional statement controlled the storage of the rest requests content, but the
conditional was based on a log level that had nothing to do with the index based
audit implementation.

Closes elastic/elasticsearch#932

Original commit: elastic/x-pack-elasticsearch@b309e261c3
2015-06-22 15:05:34 -04:00
jaymode 4e11cbebad remove _timestamp from audit index mapping
we're not using the _timestamp field and the path option is no longer supported
in elasticsearch 2.0 so this commit removes the field from the mapping.

Original commit: elastic/x-pack-elasticsearch@399d835d1f
2015-06-22 14:54:37 -04:00
uboness b4342d6bd4 changed version number to the new scheme
- lowercase `beta` and `rc`
- replaced `.betaXXX` and `.rcXXXX` suffix with `-betaXXX` and `-rcXXX`

Original commit: elastic/x-pack-elasticsearch@843d01c647
2015-06-19 11:26:12 +02:00
jaymode d302b04256 rename shield audit indices to keep naming consistent
This change renames the shield audit indices to keep naming consistent with other plugins.
The name of the index uses '_' to separate words, a '-' to separate the prefix from the time
portion, and '.'s to separate the different portions of the date.

Closes elastic/elasticsearch#925

Original commit: elastic/x-pack-elasticsearch@8ca6856e4a
2015-06-18 15:53:51 -04:00
jaymode bf9a8024ca Test: remove @Repeat instead of suppressing
Original commit: elastic/x-pack-elasticsearch@cc61a9d14a
2015-06-18 15:06:25 -04:00
jaymode 0533b55dbc Test: add SuppressForbidden for tests with @Repeat
Original commit: elastic/x-pack-elasticsearch@41247fa507
2015-06-18 14:55:33 -04:00
jaymode a5eefb6259 use UTC dates for audit indexing
Previously, we were just using the current time in milliseconds from the system
for dates and the indices were not being created for UTC dates. This change
uses UTC dates for timestamps and indices resolution for index auditing.

This also ensures that custom shield forbidden apis for tests are enforced.

Closes elastic/elasticsearch#916

Original commit: elastic/x-pack-elasticsearch@724d12cb7a
2015-06-18 14:25:38 -04:00
jaymode 2b3c157c97 store names of indices as an array instead of a string
We currently store the names of indices as a comma separated string instead
of an array. An array is the proper format for this information so this commit
changes the index audit trail to store the indices as an array.

Closes elastic/elasticsearch#917

Original commit: elastic/x-pack-elasticsearch@025393d91c
2015-06-18 13:26:51 -04:00
jaymode 6202914ffc Test: add '.' to allowed name characters
Original commit: elastic/x-pack-elasticsearch@26a254a4c2
2015-06-18 09:20:30 -04:00
Boaz Leskes 3394c2e883 Add a debug log to IndexAuditTrail
Original commit: elastic/x-pack-elasticsearch@ccff079b12
2015-06-18 08:55:34 +02:00
jaymode 853f8d50ef Test: assert that the current thread is not already interrupted
Original commit: elastic/x-pack-elasticsearch@acc517ca53
2015-06-17 09:38:50 -04:00
jaymode d036fc505d Test: override beforeIndexDeletion for audit trail tests
The beforeIndexDeletion method expects that nothing is still indexing when it runs
but this is not the case as the index audit trail will continue indexing events that
occur as checks are being performed in the cluster.

Original commit: elastic/x-pack-elasticsearch@02001a5222
2015-06-17 06:26:12 -04:00
Alexander Reelsen 22c77805bd Test: Removed river handler due to removal in master
Original commit: elastic/x-pack-elasticsearch@c6a3372ce0
2015-06-17 12:07:02 +02:00
jaymode 38837b310c [Test] disable random dynamic templates for audit index
Original commit: elastic/x-pack-elasticsearch@914e0990ef
2015-06-16 15:43:58 -04:00