Commit Graph

6259 Commits

Author SHA1 Message Date
jaymode cc9568d1bb Add hostname verification support for transport and ldaps connections
SSL and TLS do not require hostname verification, but without it they are susceptible
to man in the middle attacks. This adds support for hostname verification for
transport client connections and for ldaps connections.

Closes elastic/elasticsearch#489

Original commit: elastic/x-pack-elasticsearch@c9380f0319
2014-12-23 14:22:00 -05:00
c-a-m c052a8ca95 Disable TCP read timeout tests
Added AwaitsFix(bugUrl = "https://github.com/elasticsearch/elasticsearch-shield/issues/499") to each test to ignore them to get CI working.

Original commit: elastic/x-pack-elasticsearch@2b0b1f0f21
2014-12-23 09:27:36 -07:00
Martijn van Groningen 9f014a9bf9 slightly improved logging.
Original commit: elastic/x-pack-elasticsearch@7a131bc4d8
2014-12-23 16:41:16 +01:00
Martijn van Groningen df7fc714e7 Ensure that the refresh has ran on all shards.
Original commit: elastic/x-pack-elasticsearch@6214514956
2014-12-23 16:30:04 +01:00
c-a-m cd9edbc75a Fixed AD leaked thread bug
The AD connection leaks a thread from the initial user search.  This fixes the issue.

Original commit: elastic/x-pack-elasticsearch@f8a3e4fa35
2014-12-23 08:26:58 -07:00
c-a-m 661b755639 test: ldap timeout test failing on windows
This extends the connect timeout on windows to give it enought time to complete.  It moves the ldap read timeout test to openldap and active directory.

We now have three timeouts configurable.  The timeout tests on active directory only work for TCP connect, and TCP read, but not LDAP Search.

Original commit: elastic/x-pack-elasticsearch@ff97396f60
2014-12-22 10:03:17 -07:00
Alexander Reelsen 38a0ec9c3e Guice: Ensure no exceptions are thrown in constructor
Because this leads to endless loops when starting elasticsearch
some components have been refactored to AbstractLifecycleComponents
so that the exception throwing logic can executed in the
`doStart()` method.

Closes elastic/elasticsearch#505

Original commit: elastic/x-pack-elasticsearch@75d1fd358a
2014-12-20 13:10:57 +01:00
Areek Zillur 26fa372056 updated README links
Original commit: elastic/x-pack-elasticsearch@93ae0f5c1e
2014-12-19 16:52:57 -05:00
Areek Zillur a8aa84cdd9 [PLUGIN] Licenses should only be valid between issue and expiration date
NOTE: Version bumped to beta2

closes elastic/elasticsearch#36

Original commit: elastic/x-pack-elasticsearch@c713a3c889
2014-12-17 16:06:41 -05:00
Alexander Reelsen 9d5dc3552b Test: Do not try to do an external network connection in LDAPConnectionTest
As no test has been marked with the @Network annotation, the test should not
try to connect to example.com (which needs to be resolved and thus requires an
internet connection). We can simply bind a local socket and run into the 1ms
timeout there.

Original commit: elastic/x-pack-elasticsearch@2c2da90607
2014-12-17 17:06:22 +01:00
Alexander Reelsen 431f30893f Cleanup: Split service transport service for client & server
In order to be more flexible this clean up commit splits the
TransportService into a client and server one. As part of this
we can safely remove the slightly misused TransportFilters class.

Renamed shield.type from server to node, so we can differentiate between node2node and node2client communication.

Original commit: elastic/x-pack-elasticsearch@a3a2f9bf38
2014-12-16 14:28:32 +01:00
c-a-m 060e17bc91 ldap: Adds configuration for timeouts
This adds configuration for ldap connection timeouts and ldap operation timeouts.  Both default to 5 seconds.

Fixes https://github.com/elasticsearch/elasticsearch-shield/issues/461

Original commit: elastic/x-pack-elasticsearch@3e6ed97d52
2014-12-15 10:45:49 -07:00
jaymode a710deb505 Cleanup logging on automatically reloaded files
Fixes duplicate messages being logged on reload of the user_roles file. Add the realm name
to the logging on reload of the role mappings file since there can be a distinct file per
ldap/ad realm.

Closes elastic/elasticsearch#485

Original commit: elastic/x-pack-elasticsearch@90932fcec7
2014-12-15 08:36:55 -05:00
javanna e3768b6cff [TEST] upgrade randomized runner to 2.1.11
2.1.11 contains the fix for this issue: carrotsearch/randomizedtestingelastic/elasticsearch#179 which will resolve these recurring failures described in elastic/elasticsearch#386.

Closed elastic/elasticsearch#490

Original commit: elastic/x-pack-elasticsearch@3a396d6302
2014-12-15 13:48:04 +01:00
Alexander Reelsen 2b7679ec33 Files: Create temp files first instead of overwriting existing files
Until now the store implementations truncated the existing file and recreated it in-place.
This has problems with bigger files as the files may not yet have finished to be written,
when the WatchService tries to pick them up.

This commit fixes the problem by creating a temp file first to write the new roles or user files
and then moves it over. Also an atomic move is tried first, if the file system supports this.

Closes elastic/elasticsearch#477

Original commit: elastic/x-pack-elasticsearch@75894dd75d
2014-12-12 15:08:19 +01:00
jaymode 88162d142b Add the option to specify both a keystore and key password
Previously, we always used the keystore password as the key password, which does not
work if a user specifies a different password when generating the key with keytool. If the
key password is not specified, the keystore password will be used.

Closes elastic/elasticsearch#473

Original commit: elastic/x-pack-elasticsearch@8a6efdbf21
2014-12-12 08:38:27 -05:00
jaymode 9bfab4d8d5 Do not add a disabled realm to the list of realms
The realm documentation has a 'enabled' parameter to indicate whether the realm
should be used or not. This value is now being honored so that a realm can be disabled.

Closes elastic/elasticsearch#474

Original commit: elastic/x-pack-elasticsearch@3638a14c22
2014-12-12 08:25:16 -05:00
c-a-m 2902ccb5f0 Updates the esvm files to esvm 0.0.10, and latest shield format
This moves the esvm files into dev-tools and collapses the settings with "." This will require the latest version of esvm 0.0.10.  It combines the ldap and ad config into the same file.
Added readme to dev-tools/esvm

Original commit: elastic/x-pack-elasticsearch@dab9fa643d
2014-12-11 12:19:23 -07:00
javanna af0f04ed17 Add more info to _shield info output, align output to core main action
New output looks like this:

```
{
  "status" : "enabled",
  "name" : "Plantman",
  "cluster_name" : "cluster1",
  "version" : {
    "number" : "1.0.0",
    "build_hash" : "3bc25c3c94e494baa55a56f7d459cd4e08b2a362",
    "build_timestamp" : "2014-12-05T11:45:30Z",
    "build_snapshot" : true
  },
  "tagline" : "You know, for security"
}
```

Status can be either enabled, disabled or unlicensed.

Closes elastic/elasticsearch#429

Original commit: elastic/x-pack-elasticsearch@647eb3aea8
2014-12-11 12:06:19 +01:00
c-a-m d17c0f6d83 Bugfix: Any LDAP or AD exceptions are not getting logged.
The AD and LDAP realms now catch and log Throwable.  This changes LDAPException and ActiveDirectoryExceptions to be ShieldExceptions instead of SecurityExceptions

Fixes https://github.com/elasticsearch/elasticsearch-shield/issues/452

Original commit: elastic/x-pack-elasticsearch@aff428e5c1
2014-12-10 17:07:44 -07:00
Alexander Reelsen cf0987a4a0 Cleanup: Fix SSLService design problems
In order to fix various issues with the SSL service, the following cleanups have been done

* Removed SSLServiceProvider and all the lazy loading magic
* Do not try to create an SSLContext in the constructor. According to Guice docs the constructor
  should only be used ever for variable declarations but not business logic. This also fixes a nasty
  OOM, in case an exception was thrown in the constructor, because Guice tried to recreate that class
  in an endless loop
* Get responsibilities right (which resulted in this nasty lazy loading provider design).
  The SSLService allows to create a SSLEngine at the time you need it, but you need to supply
  specific configuration if you want it to instead of using the default configuration
  and creating a SSLContext on startup like we did before.

All changes are internal.

Closes elastic/elasticsearch#454
Closes elastic/elasticsearch#453

Original commit: elastic/x-pack-elasticsearch@7ca49f781c
2014-12-10 15:16:57 +01:00
jaymode b55180f3f8 [TEST] Use operating system specific line ending
The line endings differ between operating systems and the existing test failed
on Windows systems. This change uses the OS specific line ending.

Closes elastic/elasticsearch#443

Original commit: elastic/x-pack-elasticsearch@a458472322
2014-12-08 09:00:17 -05:00
uboness 9a932f8ae8 Fixed typos in validation error message
Original commit: elastic/x-pack-elasticsearch@8164ee18ed
2014-12-08 14:40:12 +01:00
uboness 9970267058 Fixes wrong password validation
Now, minimum length of 6 is properly checked

Closes elastic/elasticsearch#441

Original commit: elastic/x-pack-elasticsearch@d644528570
2014-12-08 14:17:53 +01:00
uboness 87a2a2afc6 Added "no user found" output to esusers tool
for the `list` command and when no users are defined

Original commit: elastic/x-pack-elasticsearch@3ca7b9a62b
2014-12-08 13:41:35 +01:00
javanna cf71f3f05e [TEST] update ShieldPluginTests
The shield test infra already verifies that the plugin is loaded before each test, it makes little sense to check again in this specific test. Left the second part that tests the shield info endpoint and renamed the test method

Closes elastic/elasticsearch#423

Original commit: elastic/x-pack-elasticsearch@ac2d566c42
2014-12-08 13:01:34 +01:00
uboness aa4269ff82 Added info logging for auto-related files
- users
- users_roles
- roles.yml

Original commit: elastic/x-pack-elasticsearch@e3ee647915
2014-12-07 04:57:17 +01:00
Martijn van Groningen a7e85df649 Move the get alert api over to be a master node api and that it fetches the alert from the in memory alert store instead via core get api from an index.
Original commit: elastic/x-pack-elasticsearch@6bf471bf74
2014-12-05 19:59:58 +01:00
Martijn van Groningen 05848603d8 Added missing rest handler
Original commit: elastic/x-pack-elasticsearch@749dfc61f5
2014-12-05 19:24:11 +01:00
Martijn van Groningen b039f8bbdb Changed to use indexBlockedException instead of indicesBlockedException
Original commit: elastic/x-pack-elasticsearch@33f581ddd2
2014-12-05 19:13:31 +01:00
Martijn van Groningen bbaa122d7e Removed unused field.
Original commit: elastic/x-pack-elasticsearch@b6b0d926ba
2014-12-05 19:11:24 +01:00
Areek Zillur fd1011b32a [FIX] Do not emit feature license status on shutdown
closes elastic/elasticsearch#33

Original commit: elastic/x-pack-elasticsearch@caa49a52c5
2014-12-05 11:29:47 -05:00
Martijn van Groningen 45e5c13369 Disallow dynamic mapping
Added config mapping

Original commit: elastic/x-pack-elasticsearch@f3de2c17bd
2014-12-05 17:03:26 +01:00
Brian Murphy c97e083a59 Move the saving of configs to the manager.
Original commit: elastic/x-pack-elasticsearch@aa8372d34e
2014-12-05 15:55:19 +00:00
Martijn van Groningen ac45a4fe99 Changes the configuration manager to rely more on alert store for the .alerts index / templated to be loaded. This simplified to loading logic in the configuration manager.
Original commit: elastic/x-pack-elasticsearch@ccd7a23243
2014-12-05 16:42:58 +01:00
Brian Murphy 780c89ec23 Move settings checking to the creation of SMTP alert actions.
Original commit: elastic/x-pack-elasticsearch@30da14cb9e
2014-12-05 15:09:07 +00:00
Martijn van Groningen 203cf5c024 Remove redundant config manager start checking
Original commit: elastic/x-pack-elasticsearch@5369765398
2014-12-05 16:02:28 +01:00
Martijn van Groningen 984d7d615a removed log statements
Original commit: elastic/x-pack-elasticsearch@c4b7b16cd4
2014-12-05 15:36:18 +01:00
Martijn van Groningen aeacbe44ca Removed redundant if statement
Original commit: elastic/x-pack-elasticsearch@2de43dc7d5
2014-12-05 15:34:44 +01:00
Martijn van Groningen 1258a4c327 Renamed ConfigManager#isReady() to ConfigManager#start()
Add ConfigManager#stop()
Simplified config loading
smpt alert action settings are now also updated

Original commit: elastic/x-pack-elasticsearch@acb180f88c
2014-12-05 15:14:24 +01:00
Brian Murphy 920f7ea2a9 More changes for configuration manager and email action renaming.
Original commit: elastic/x-pack-elasticsearch@1c5087e79a
2014-12-05 12:07:31 +00:00
Brian Murphy d8b751f6ed Change to support name change of email alert action.
Original commit: elastic/x-pack-elasticsearch@d8bba3194b
2014-12-05 12:07:31 +00:00
Brian Murphy d4f8bf0d2c Fix test to pass in a dummy cluster state when readying the ConfigManager.
Original commit: elastic/x-pack-elasticsearch@e085844f9f
2014-12-05 12:07:31 +00:00
Brian Murphy 1f49c9199d Changes after review.
Original commit: elastic/x-pack-elasticsearch@a5fac88f19
2014-12-05 12:07:31 +00:00
Brian Murphy d70164de4d Rename EmailAlertAction
Original commit: elastic/x-pack-elasticsearch@35e819cdf2
2014-12-05 12:06:42 +00:00
Brian Murphy 6791841f42 Changes after review.
Original commit: elastic/x-pack-elasticsearch@0a9055b918
2014-12-05 12:05:57 +00:00
Brian Murphy 31173507a5 Add actions and listeners for Configuration.
Add transport actions for configuration.
Add Listener so that components can listen for config changes.

Original commit: elastic/x-pack-elasticsearch@bab02770d9
2014-12-05 12:05:57 +00:00
Brian Murphy d3ec7f40ba Add tests for configuration manager.
Original commit: elastic/x-pack-elasticsearch@9c284fc4c6
2014-12-05 12:05:57 +00:00
Brian Murphy 8fa42a581f Configuration : Add ability to configure alerting by creating .alerts/config/<name> documents in the index.
This commit adds the ConfigurationManager which the components use to load configuration from the index.
The configuration manager exposes an isReady method which components should not start until it is returns true.

Original commit: elastic/x-pack-elasticsearch@96a2f9f44f
2014-12-05 12:05:57 +00:00
javanna 8320be7b09 Build: add scm info to pom.xml
Build number maven plugin requires this info to retrieve the build number and make it available as a variable, which is then published through RestShieldInfoAction, which is currently null. This commit makes sure the build number gets currently published.

Closes elastic/elasticsearch#428

Original commit: elastic/x-pack-elasticsearch@0a2bc7646b
2014-12-05 12:42:44 +01:00