Commit graph

65 commits

Author SHA1 Message Date
Rene Groeschke
63e4917775
Add Saml test connection timeout debugging output (#104801) (#106226)
Add additional logging to idp test fixture container

(cherry picked from commit 46beceb180)
2024-03-13 13:07:11 +01:00
Brian Seeders
ad2bc23c2a
Renew samba fixture expired test certificates (#105561) (#105566)
(cherry picked from commit 15877f5593)
2024-02-15 10:43:36 -05:00
Rene Groeschke
077d8be599
Fix typo in BuildParams.isCi() usage (#104812) 2024-01-26 09:24:12 -05:00
Rene Groeschke
ab8ee60bba
Fix SamlAuthenticationIT flakyness (#103867) 2024-01-24 13:44:31 -05:00
Rene Groeschke
566cecd055
Enlarge jetty restart timeframe in idpfixture (#103616)
Enlarge jetty restart timeframe in idpfixture in order to trying to fix flakiness we see in #103595 
caused by connection issues to the idp fixtuere in the SamlAuthenticationIT tests

Add healthcheck wait for idp fixture that matches the healthcheck we had in docker compose, 
being closer to what we had in docker compose to limit surface we see at #103595
2023-12-21 08:22:48 +01:00
Rene Groeschke
62ddafb0e0
Port smb fixture from test fixture plugin to testcontainer (#103440)
this removes smb test fixture to use test container instead of relying
on our gradle test fixture plugin.
2023-12-20 04:01:52 -05:00
Rene Groeschke
6e36ea841d
Port idp-fixture to testcontainers (#103320)
This ports idp-fixture to test container and updates downstream tests
accordingly.
2023-12-13 05:38:24 -05:00
Brian Seeders
9dd8ae60af
[buildkite] Remove idp-fixture docker-compose wait and bump check task agent memory (#101059) 2023-10-18 12:00:28 -04:00
Brian Seeders
d0c263bfa6
Add healthcheck for shibboleth-idp in idp-fixture (again) (#100461) 2023-10-09 11:25:20 -04:00
Brian Seeders
0770e3def8
Revert "Add healthcheck for shibboleth-idp in idp-fixture (#100369)"
This reverts commit 003912bd56.
2023-10-06 14:31:32 -04:00
Brian Seeders
003912bd56
Add healthcheck for shibboleth-idp in idp-fixture (#100369) 2023-10-06 13:53:45 -04:00
Nikolaj Volgushev
7f0f73f942
Port OIDC integration tests to internal REST test (#96756)
Ports OIDC integration tests from the old Docker-based ES test cluster
setup to internal REST tests. The OIDC fixture itself is still
dockerized. I'm doing this in the context of bumping a version on a
dependency. The old Docker-based test does not really work on M1 Macs;
porting this suite to the new test setup (aside from being a general
improvement) also allows me to test the version update and iterate on it
locally.
2023-06-13 13:54:08 -04:00
Nik Everett
74d0d19c0f
Synthetic _source: support field in many cases (#89950)
This adds support for the `field` scripting API in many but not all
cases. Before this change numbers, dates, and IPs supported the `field`
API when running with _source in synthetic mode because they always have
doc values. This change adds support for `match_only_text`, `store`d
`keyword` fields, and `store`d `text` fields. Two remaining field
configurations work with synthetic _source and do not work with `field`:
* A `text` field with a sub-`keyword` field that has `doc_values` * A
`text` field with a sub-`keyword` field that is `store`d

![image](https://user-images.githubusercontent.com/215970/189217841-4378ed42-e454-42c1-aaf0-6c2c041b29be.png)
2022-11-10 10:44:06 -05:00
Jake Landis
a94347e002
Fix hacky ephemeral port config for SAML tests (#91301)
This commit re-implements how the SAML tests configure their ephemeral ports. 
The prior implementation had 2 tasks competing over files in the output directory 
resulting in some odd behavior w.r.t. when the task was up to date or was not. 
The change here removes the unnecessary task and leverages a lazy map with 
the expand option to lazily populate the port mapping.
2022-11-07 11:51:12 -06:00
Jake Landis
1f3ec5f197
Build shibboleth-idp for testing purposes (#91216)
We currently use unicon/shibboleth-idp:3.4.2 to help test our SAML integration.
That container is no longer actively supported and does not support
ARM architectures.

This commit is a partial clone from Unicon/shibboleth-idp-dockerized 3.4.3.

Changes from upstream include:

    Use openjdk:11.0.16-jre as the base image for support for ARM architectures
    Handle missing keystore download from Jetty
    Fix URL paths for artifacts to download

Changes to this repository include:

    Copied required Jetty configuration files from upstream project
    Updates to docker compose
    Placed the missing keystore Jetty downloads in a separate location (jetty-custom)

The final result is a bit messy. Mixing cloned files with custom files and mixing
Jetty and IDP concerns. However, it is not much messier than prior and now
that we control building the image we can more easily upgrade shibboleth IDP
The upgrade to the latest version is fairly involved and as such we will need to
deviate more from the clone which should allow some additional clean up.

part of: #71378
related: #91144
supersedes: #89674
2022-11-03 13:52:28 -05:00
Jake Landis
cc6bbc2afd
update c2id/c2id-server-demo docker image to support ARM (#91144)
This commit updates the c2id docker image to the latest released version.
This commit also introduces a multi-stage build with the openjdk image that
supports ARM architectures. So our oidc tests now supports multiple archtectures.

related: #89526
part of: #71378
2022-11-02 17:08:11 -05:00
Jake Landis
b557d20ff4
Update OIDC test fixture (#89526)
This commit updates the OIDC test fixture to use the latest demo docker image
from https://connect2id.com.  As part of this change some of the docker image demo 
login has changed from prior versions and the test code is updated accordingly. 

fixes #89477
reverts #89478 / e949dff.
2022-08-23 09:29:24 -05:00
Mark Vieira
e949dff8d6
Disable openid connect tests due to missing fixture (#89478)
Relates to https://github.com/elastic/elasticsearch/issues/89477. For
now just disable these tests since they are guaranteed to fail.
2022-08-19 07:30:57 +09:30
Justin Cranford
5d331d2ded
Remove JWT realm feature flag. (#84845) 2022-03-24 16:10:52 -04:00
Mark Vieira
0c6f131fbf
Remove usages of elasticsearch.build plugin in non-production projects (#84890) 2022-03-14 11:27:24 -07:00
Tim Vernum
aaf66f9e29
Add integration test for JWT realm with c2id OP (#84691)
We have an existing QA test and fixture that integrates the OIDC realm
with the c2id OIDC server.

This commit extends that test suite and fixture to also test that the
JWT id tokens generated by c2id can be used to authenticate to the
Elasticsearch JWT realm

Co-authored-by: Justin Cranford <89857999+justincr-elastic@users.noreply.github.com>
2022-03-08 17:57:35 +11:00
Ioannis Kakavas
81f5632bb3
Enforce Transport TLS check on all licenses. (#79602)
Historically, we haven't enabled the transport TLS bootstrap
check for trial licenses because:
- We wanted to make the experience of trial license users as
easy as possible and configuring transport TLS was considered
cumbersome.
- Trial licenses have a limited lifetime so that minimizes the
impact of this potentially insecure configuration.

With security on by default project we are:
- Enabling security by default for basic and trial licenses
- We offer an easy, automated way for users to configure
transport TLS
- Enabling by default this bootstrap check for basic licenses.

It doesn't make much sense for us to enforce the bootstrap check
on basic licenses but not on trial and given that the concerns
that were driving the original decision are not there or have been
partly alleviated, this commit changes our behavior so that we
enable the TLS bootstrap check regardless of the license level.
2021-10-25 12:28:03 +03:00
Mark Vieira
dfdbb758e1
Ensure docker test fixture preProcess task is always executed (#78421) 2021-09-29 08:07:50 -07:00
Rene Groeschke
e609e07cfe
Remove internal build logic from public build tool plugins (#72470)
Extract usage of internal API from TestClustersPlugin and PluginBuildPlugin and related plugins and build logic

This includes a refactoring of ElasticsearchDistribution to handle types
better in a way we can differentiate between supported Elasticsearch
Distribution types supported in TestCkustersPlugin and types only supported
in internal plugins.

It also introduces a set of internal versions of public plugins.

As part of this we also generate the plugin descriptors now.

As a follow up on this we can actually move these public used classes into 
an extra project (declared as included build)

We keep LoggedExec and VersionProperties effectively public And workaround for RestTestBase
2021-05-06 14:02:35 +02:00
Rene Groeschke
5bcd02cb4d
Restructure build tools java packages (#72030)
Related to #71593 we move all build logic that is for elasticsearch build only into
the org.elasticsearch.gradle.internal* packages

This makes it clearer if build logic is considered to be used by external projects
Ultimately we want to only expose TestCluster and PluginBuildPlugin logic
to third party plugin authors.

This is a very first step towards that direction.
2021-04-26 14:53:55 +02:00
Przemko Robakowski
308aee283d
Update GeoIP processor documentation (#71211)
This PR adds documentation for GeoIPv2 auto-update feature.
It also changes related settings names from geoip.downloader.* to ingest.geoip.downloader to have the same convention as current setting.

Relates to #68920

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-04-15 13:47:09 +02:00
Przemko Robakowski
39eb12a972
Enable GeoIP downloader by default (#71505)
This change enables GeoIP downloader by default.
It removes feature flag but adds flag that is used by tests to disable it again (as we don't want to hammer GeoIP database service with every test cluster we spin up).

Relates to #68920
2021-04-15 12:28:37 +02:00
Rene Groeschke
24adbbca41
Remove OSS specific distribution packaging (#69775)
* Remove OSS projects from distribution packaging
* Remove OSS flavor from ElasticsearchDistribution
* Remove OSS handling from docker build setup
2021-03-03 13:39:29 +01:00
Ioannis Kakavas
a4986b30bc
Renew samba fixture expired test certificates (#68985)
Renew our smb-fixture expired test certificates that are in use in the
fixture and in various tests for LDAP and AD. 
Add a README file for how these certificates can be renewed in the
future, when the need arises again.
2021-02-15 16:39:37 +02:00
Mark Vieira
a92a647b9f Update sources with new SSPL+Elastic-2.0 license headers
As per the new licensing change for Elasticsearch and Kibana this commit
moves existing Apache 2.0 licensed source code to the new dual license
SSPL+Elastic license 2.0. In addition, existing x-pack code now uses
the new version 2.0 of the Elastic license. Full changes include:

 - Updating LICENSE and NOTICE files throughout the code base, as well
   as those packaged in our published artifacts
 - Update IDE integration to now use the new license header on newly
   created source files
 - Remove references to the "OSS" distribution from our documentation
 - Update build time verification checks to no longer allow Apache 2.0
   license header in Elasticsearch source code
 - Replace all existing Apache 2.0 license headers for non-xpack code
   with updated header (vendored code with Apache 2.0 headers obviously
   remains the same).
 - Replace all Elastic license 1.0 headers with new 2.0 header in xpack.
2021-02-02 16:10:53 -08:00
Rene Groeschke
eee6e11883
Port all task definitions to task avoidance api (#66738)
This finishes porting all tasks created in gradle build scripts and plugins to use 
the task avoidance api (see #56610)

* Port all task definitions to task avoidance api
* Fix last task created during configuration
* Fix test setup in  :modules:reindex
* Declare proper task inputs
2021-01-04 12:32:19 +01:00
Rene Groeschke
defaa93902
Avoid tasks materialized during configuration phase (#65922)
* Avoid tasks materialized during configuration phase
* Fix RestTestFromSnippet testRoot setup
2020-12-12 16:14:17 +01:00
Mark Vieira
9245dd9120
Disable composePull task on idp-fixture project due to error (#62510) 2020-09-17 08:55:19 -07:00
Ioannis Kakavas
5d341dc28e
Oidc additional client auth types (#58708)
The OpenID Connect specification defines a number of ways for a
client (RP) to authenticate itself to the OP when accessing the
Token Endpoint. We currently only support `client_secret_basic`.

This change introduces support for 2 additional authentication
methods, namely `client_secret_post` (where the client credentials
are passed in the body of the POST request to the OP) and
`client_secret_jwt` where the client constructs a JWT and signs
it using the the client secret as a key.

Support for the above, and especially `client_secret_jwt` in our
integration tests meant that the OP we use ( Connect2id server )
should be able to validate the JWT that we send it from the RP.
Since we run the OP in docker and it listens on an ephemeral port
we would have no way of knowing the port so that we can configure
the ES running via the testcluster to know the "correct" Token
Endpoint, and even if we did, this would not be the Token Endpoint
URL that the OP would think it listens on. To alleviate this, we
run an ES single node cluster in docker, alongside the OP so that
we can configured it with the correct hostname and port within
the docker network.
2020-09-14 16:16:23 +10:00
Ioannis Kakavas
e0ec9ac13a
Add SAML AuthN request signing tests (#48444)
- Add a unit test for our signing code
- Change SAML IT to use signed authentication requests for Shibboleth to consume
2020-08-26 17:06:36 +03:00
Ioannis Kakavas
a9338672c5
Add http proxy support for OIDC realm (#57039)
This change introduces support for using an http proxy for egress
communication of the OpenID Connect realm.
2020-06-03 09:36:23 +03:00
Rory Hunter
d77dfb6296 Revert "Use LTS version of Ubuntu in Dockerfiles (#55327)"
This reverts commit cc09e245fe.
2020-04-16 20:04:12 +01:00
Rory Hunter
cc09e245fe
Use LTS version of Ubuntu in Dockerfiles (#55327)
We have some Dockerfiles that reference Ubuntu 19.04, which is not an LTS
version and has now appears to have been retired from the Ubuntu repositories.
Switch to 18.04, which is the current long-term support version. Also change a
usage of 16.04 to 18.04, for consistency.
2020-04-16 19:46:21 +01:00
Ioannis Kakavas
f68b036a7b
Document SAML APIs (#45105)
* Document SAML APIs

This change adds documentation for the SAML APIs in Elasticsearch
and adds simple instructions on how these APIs can be used to
authenticate a user with SAML by a custom web application other
than Kibana.

Resolves: #40352

* typo

* fix links

* fix more links

* [DOCS] Fixes broken link

* Add metadata file with shorter names for docs, fix typos and mute tests

* [DOCS] Reformats the SAML APIs to match API template

* Apply suggestions from code review

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Address feedback and add small section on IdP-initiated SSO handling

* address feedback

* moar feedback

* Clarifications and addressing feedback

* properly resolve conflicts

* address feedback

* fix doc links

* minor fixes

* Fix reference
2019-10-11 15:30:21 +03:00
Jason Tedor
a9f351556f
Remove client feature tracking (#44929)
This commit removes the infrastructure for client feature tracking. We
introduced this functionality to support clients that do not necessarily
understand all the features that the server might support, for example,
customs in the cluster state provided by plugins that a client might not
have. This can arise in situations such as rolling upgrades from the OSS
distribution to the default distribution. With the removal of the
transport client, this infrastructure is no longer needed. This commit
removes client feature tracking from the server in 8.0.0.
2019-07-28 19:00:38 +09:00
Mark Vieira
12d583dbf6
Remove unnecessary usage of Gradle dependency substitution rules (#42773) 2019-06-03 16:18:45 -07:00
Mark Vieira
323f312bbc
Replace usages RandomizedTestingTask with built-in Gradle Test (#40978)
This commit replaces the existing RandomizedTestingTask and supporting code with Gradle's built-in JUnit support via the Test task type. Additionally, the previous workaround to disable all tasks named "test" and create new unit testing tasks named "unitTest" has been removed such that the "test" task now runs unit tests as per the normal Gradle Java plugin conventions.
2019-04-08 14:13:59 -07:00
Mark Vieira
b439127be5
Revert "Replace usages RandomizedTestingTask with built-in Gradle Test (#40564)"
This reverts commit 2b2a3f50
2019-04-04 21:52:47 -07:00
Mark Vieira
2b2a3f5086
Replace usages RandomizedTestingTask with built-in Gradle Test (#40564)
This commit replaces the existing RandomizedTestingTask and supporting code with Gradle's built-in JUnit support via the Test task type. Additionally, the previous workaround to disable all tasks named "test" and create new unit testing tasks named "unitTest" has been removed such that the "test" task now runs unit tests as per the normal Gradle Java plugin conventions
2019-04-04 19:51:13 -07:00
Ioannis Kakavas
d029a131ba
Add an OpenID Connect authentication realm (#40674)
This commit adds an OpenID Connect authentication realm to
elasticsearch. Elasticsearch (with the assistance of kibana or
another web component) acts as an OpenID Connect Relying
Party and supports the Authorization Code Grant and Implicit
flows as described in http://ela.st/oidc-spec. It adds support
for consuming and verifying signed ID Tokens, both RP
initiated and 3rd party initiated Single Sign on and RP
initiated signle logout.
It also adds an OpenID Connect Provider in the idp-fixture to
be used for the associated integration tests.

The code in this commit has been tracked in a feature branch
and has been previously reviewed and approved in :

#37009
#37787
#38474
#38475
#40262
2019-04-04 17:24:41 +03:00
Jay Modi
834cc35193
Use ephemeral ports for idp-fixture (#40333)
This change removes the use of hardcoded port values for the
idp-fixture in favor of the mapped ephemeral ports. This should prevent
failures due to port conflicts in CI.
2019-03-26 08:40:00 -06:00
Jason Tedor
78f1588d8f
Update feature aware check ASM to 7.1 (#40389)
This commit updates the feature aware check ASM dependency to ASM
7.1. This gives us JDK 13 compatibility.
2019-03-23 12:55:48 -04:00
Ioannis Kakavas
7fa59c7175
Adjust ldap timeout for idp fixture (#40102)
This change adjusts the LDAP connection timeout for retrieving
attributes while performing the SAML IT to 5 seconds, from 5 ms
that it previously was.
Resolves: #40025
2019-03-17 11:45:58 +02:00
Ioannis Kakavas
6c6c44e182
Replace Vagrant with Docker for idp-fixture (#39948)
The change replaces the Vagrant box based fixture with a fixture
based on docker compose and 2 docker images, one for an openldap
server and one for a Shibboleth SAML Identity Provider.

The configuration of both openldap and shibboleth is identical to
the previous one, in order to minimize required changes in the
tests
2019-03-12 23:54:23 +02:00
Alpar Torok
4e08cca6bc
Ground work to start up the docker image in the build (#37754)
This change adds a docker compose configuration that's used with
the `elasticsearch.test.fixtures` plugin to start up the image
and check that the TCP ports are up.

We can build on this to add other checks for culster health,
run REST tests, etc.

We can add multiple containers and configurations to the compose
file (e.x. test different env vars) and form clusters.
2019-01-24 17:26:42 +02:00