Commit graph

9343 commits

Author SHA1 Message Date
Niels Bauman
3fa1e0a045
Fixing the reference time so that age does not change during a test (#116900)
This change makes it so that the reference time from which the "age" field of the IndexLifecycleExplainResponse
object is derived does not change for the duration of testConcurrentToXContent().

Co-authored-by: Keith Massey <keith.massey@elastic.co>
2024-11-18 15:17:18 +01:00
Tim Vernum
04736f8f56
Update allowed error messages in SSL test (#115900)
Different JRE vendors/version produce slightly different error
messages. We don't care which one we receive, just accept any of them.

Resolves: #115016
2024-10-31 11:12:44 +11:00
Athena Brown
41bf511f46
Update expected error message for slightly changed format (#115709) 2024-10-28 17:20:32 -06:00
Mark Vieira
21df4f545c
Update spotless (#115349) 2024-10-22 10:49:29 -07:00
Simon Cooper
f9b6b57d1d
[7.17] Add a size limit to outputs from mustache (#114002) (#114705)
Backport #114002 to 7.17
2024-10-14 16:56:47 +01:00
Nicole Albee
7ba4a9d33c
Update "Securing Clients and integrations" to include Fleet (#113731) (#114685) 2024-10-14 08:35:23 -06:00
Simon Cooper
926f234e53
Use english locale for tests and docs (#113671)
English doesn't change between JDK 22 and 23
2024-09-27 16:51:04 +01:00
Luigi Dell'Aquila
63098be403
[7.17] SQL: make date format functions more strict (#112140) (#112546) 2024-09-05 14:26:04 +02:00
Nick Tindall
fcf25fff74 Fix SearchableSnapshotsPrewarmingIntegTests (Backport #101203)
Closes #112422
2024-09-04 13:44:37 +10:00
Slobodan Adamović
6e057bde09
Increase ephemeral ports range for ServerTransportFilterIntegrationTests (#112279)
This PR increases client's port range for `ServerTransportFilterIntegrationTests`
which are executed on Windows. This is needed in order to avoid failures
due to some port ranges being excluded from use.
The larger ports range (300) is chosen based on the observation where a
random consecutive range of 200 ports can be excluded on Windows test workers.
2024-08-29 09:34:24 +02:00
Albert Zaharovits
5361235011
Update apache.santuario.xmlsec dep from 2.1.4 to 2.2.6 (#112022)
apache.santuario.xmlsec version 2.1.4 is documented vulnerable.
We should update to mitigate the vulnerabilities.
But apache.santuario.xmlsec is a dependency of opensaml version 3.*.

However, in a patch release of elasticsearch (i.e. 7.17.*) it's best we avoid updating dependencies across major versions (i.e. opensaml from version 3.* to version 4.*), particularly for such a complex dependency as opensaml (we did update the opensaml dep in this way, but in a minor elasticsearch 8.* release, i.e. #98199). The latest opensaml 3.* release (i.e. 3.4.6) still requires a vulnerable apache.santuario.xmlsec dep: https://mvnrepository.com/artifact/org.opensaml/opensaml-xmlsec-impl/3.4.6).

In this case, our best hope is to find a non-vulnerable version of apache.santuario.xmlsec that is still on the same major version as the version listed in the deps of opensaml (i.e. 2.*). That's version 2.2.6: https://mvnrepository.com/artifact/org.apache.santuario/xmlsec/2.2.6 , which is not vulnerable

This PR updates apache.santuario.xmlsec from the existing 2.1.4 version to the 2.2.6 version. The release notes of the 2.2.0 version from https://santuario.apache.org/javareleasenotes.html look simple, and the dependencies differences (from https://mvnrepository.com/artifact/org.apache.santuario/xmlsec/2.1.4) are minimal as well (hopefully optional dependencies, which we don't pull in, stay optional in the same way in the new version).
So, it looks to me that the dep update is relatively safe (and it also passes CI)!
2024-08-23 14:36:52 +03:00
Athena Brown
231b61660f
Improve security-crypto threadpool overflow handling (#111369) (#111567)
Prior to this PR, when the security-crypto threadpool queue overflows and rejects API key hashing submissions, a toxic value (specifically, a future which will never be completed) is added to the API key auth cache. This toxic cache value causes future authentication attempts with that API key to fail by timeout, because they will attempt to wait for the toxic future, until that value is invalidated and removed from the cache. Additionally, this will hold on to memory for each request that waits on the toxic future, even after the request has timed out.

This PR adds a unit test to replicate this case, and adjusts the code which submits the key hashing task to the security-crypto threadpool to properly handle this point of failure by invalidating the cached future and notifying waiting handlers that the computation has failed.
2024-08-05 14:05:45 -06:00
Tim Vernum
07296d596a
Respect --pass option in certutil csr mode (#109834)
elasticsearch-certutil csr generates a private key and a certificate
signing request (CSR) file. It has always accepted the "--pass" command
line option, but ignore it and always generated an unencrypted private
key.

This commit fixes the utility so the --pass option is respected and the
private key is encrypted.

Backport of: #106105
2024-06-18 14:42:03 +10:00
Tim Vernum
4aafcb6136
Extend assertion expiry in SAML auth tests (#109652)
Sometimes buildkite seems to swallow time. This commit extends some of
the authentication/session expiry times to compensate.

Relates: #109299
Backport of: #109607
2024-06-13 10:48:45 +10:00
Jake Landis
00632845d2
Reintroduce 7.17 Backport for DLS changes (#109494)
* Reapply "[7.17] Backport DLS changes (#108330)" (#109349)

This reverts commit 692a1a2448.

* re-implement excludeDeleteDocs as hack

* Revert "re-implement excludeDeleteDocs as hack"

This reverts commit 6006031692.

* re-implement serialization with metadata

* use correct xContent

* fix unmodifiable exception

* [review comments] use constant and underscore prefix
2024-06-13 09:05:25 +10:00
Jake Landis
692a1a2448
Revert "[7.17] Backport DLS changes (#108330)" (#109349)
This reverts commit 4e08df5 (#108330)
This commit also fixes #109273 in 7.17.
2024-06-04 10:20:58 -05:00
Jake Landis
4e08df5bda
[7.17] Backport DLS changes (#108330)
This commit introduced stricter DLS rules and is a manual backport of #105709 and #105714 
with additional node level settings to optionally disable the stricter DLS rules. 
Since these settings are not present in 8.x the needed deprecation info API entries have also 
been added to help inform any users that may have set these values to remove them before upgrading.
2024-06-03 10:58:38 -05:00
Albert Zaharovits
b6dad2b7ff
2 @Before methods, not a good idea (#108502)
Fixes IpFilterRemoteAddressFilterTests testThatFilteringWorksByIp. There
were 2 "@ Before"-annotated methods that didn't play well together.

Fixes: #108441
2024-05-13 06:01:22 -04:00
Mark Vieira
572ce11c1b
AwaitsFix #108441 2024-05-09 16:54:27 -07:00
Athena Brown
766ba1c6c8
[7.17] Align all usages of protobuf to be 3.21.9 (#95431)
Updating repository-hdfs, repository-gcs, and vector-tile to all use the same more recent protobuf.

Co-authored-by: Keith Massey <keith.massey@elastic.co>
2024-05-08 14:59:53 -06:00
Albert Zaharovits
9df8e28464
[7.17] Fix lingering license warning header (#108408)
* Backport done

* Get port range

* Fix code license
2024-05-08 09:12:19 -04:00
Bogdan Pintea
99a68a8b58
SQL: Fix JdbcPreparedStatementIT.testDatetimeWithNanos (#107629) (#107687)
Fixes #105677
2024-04-22 08:02:03 -04:00
Bogdan Pintea
b65a3d00ff
SQL: Limit how much space some string functions can use (#107333) (#107632)
* SQL: Limit how much space some string functions can use (#107333)

This will check and fail if certain functions would generate a result
exceeding a certain fixed byte size.

This prevents an operation/query to fail the entire VM.

(cherry picked from commit f1bcb338ec)

* Fix use of forbidden APIs

* Style
2024-04-18 14:27:37 -04:00
Rene Groeschke
8ce680ff4a
Mute SamlAuthenticationIT on 7.17 branch (#106993) 2024-04-02 14:51:40 +02:00
Slobodan Adamović
59f0e6f091
[Test] Fix SslMultiPortTests by increasing the number of ephemeral ports on windows (#106540)
This PR increases client's port ranges for tests which are executed on
Windows in order to avoid failures due to some port ranges being
excluded from use. The larger ports range (300) is chosen based on the
observation where a random consecutive range of 200 ports can be
excluded on Windows test workers.

Relates to https://github.com/elastic/elasticsearch/pull/103894, which
fixed similar issues but this one seems to have been missed.

Resolves: https://github.com/elastic/elasticsearch/issues/106537
2024-03-20 08:28:03 -04:00
Niels Bauman
1175fc6cc8
Fix default search timeout in watcher docs (#106404) (#106504) 2024-03-19 15:07:03 -04:00
Youhei Sakurai
057843e7d6
[7.17] Handling exceptions on watcher reload (#105442) (#106209) 2024-03-13 15:54:38 -05:00
Jake Landis
334d7f5026
OIDC doc - mention client secret needs a restart (#106088) (#106090) 2024-03-07 16:21:14 -05:00
Moritz Mack
63eeed8374
Fix random timezone id selection to be consistent with DateUtilsTests.testTimezoneIds (#105989) 2024-03-06 07:35:15 +01:00
David Roberts
edea203e7c
[ML] Detect 8.x ML nodes correctly (#105653)
It's possible that a 7.17 master node needs to assign ML jobs
to 8.x ML nodes. Currently this does not work, as the 7.x mechanism
for detecting ML nodes does not work with 8.x ML nodes. Currently
a 7.17 master node will not assign jobs to 8.x ML nodes, so the
jobs sit in limbo until the master node is upgraded to 8.x, and
then they get assigned and pick up where they left off.

This change allows the 7.17 master node to correctly identify 8.x
ML nodes in the cluster, allowing the ML jobs to be reassigned
more quickly during a rolling upgrade from 7.17 to 8.x where
master nodes are upgraded last (as recommended).
2024-02-20 13:42:46 +00:00
Brian Seeders
2ccd7bf00e
Renew samba fixture expired test certificates (#105561) (#105568)
(cherry picked from commit 15877f5593)
2024-02-15 10:43:53 -05:00
Jake Landis
6e0679d6d1
[7x] upgrade aws client depdencies (#104346)
This commit bumps the aws client dependencies from from 1.11.749 to
1.12.270.  This aligns the versions used in 7.17.x with main. 

(partial) backport of
https://github.com/elastic/elasticsearch/pull/88932
2024-01-22 10:52:12 -05:00
Jake Landis
2aeecfd084
[7.17] Manual backport of 103944 (#104016)
* Manual backport of 103944

* copy RegisteredDomainProcessorTests#testBasic from main
2024-01-08 11:31:01 -05:00
Jake Landis
77bf12f0a0
Upgrade Bouncy Castle jars (except for the FIPS jars) (#103818)
This commit upgrades the non-FIPS jars to the lastest available versions for 7.17.

Bouncy Castle slightly changed their naming as evident by bouncycastle.org/latest_releases.html
They no longer maintain a jdk15on library and instead use strategy for [1.5->1.8) and [1.8 -> ). This commit
adopts the jdk18on libraries with the latest version.

related: #100923
2024-01-05 16:32:05 -06:00
Slobodan Adamović
68e2508349
[7.17] [Test] Use larger client ports range for tests running on Windows (#103894) (#103914)
* [Test] Use larger client ports range for tests running on Windows (#103894)

This PR increases client's port ranges for tests which are executed
on Windows in order to avoid failures due to some port ranges being
excluded from use. The larger ports range (300) is chosen based on
the observation where a random consecutive range of 200 ports can
be excluded on Windows test workers.

Closes #102349

(cherry picked from commit bdf5c7fc38)

# Conflicts:
#	modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/transport/netty4/Netty4TransportMultiPortIntegrationIT.java
#	x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java

* Fix compilation error
2024-01-04 10:00:23 -05:00
Mary Gouseti
253f1f430f
[7.17] [ILM] More resilient when a policy is added to searchable snapshot (#102741) (#103070)
* Backport #102741
2023-12-06 20:08:15 +02:00
Przemysław Witek
b9fe9073e5
[Transform] Ensure transform updates only modify the expected transform task (#102934) (#102941)
(cherry picked from commit 67ab4b46ea)

# Conflicts:
#	x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformActionRequestTests.java
2023-12-04 14:06:18 -05:00
Jake Landis
5bb05c343a
Remove verbose debug logger (#102318) (#102421)
This commit removes a debug logger which can be overly verbose.

(cherry picked from commit 19a762b8f5)
2023-11-21 11:18:39 -05:00
David Turner
8206af4c8f AwaitsFix for #101462 2023-11-03 17:28:11 +00:00
Athena Brown
36e5d261b9
Unmute PkiAuthDelegationIntegTests (#101280) (#101351)
These tests were muted both at the suite level as well as at the test level
for reasons I don't fully understand, and then were unmuted at one level
but not the other. They don't appear to fail after a few thousand runs,
so this PR unmutes them the rest of the way.
2023-10-25 17:51:31 -04:00
Brian Seeders
92682277ba
[buildkite] Remove idp-fixture docker-compose wait and bump check task agent memory (#101059) (#101075) 2023-10-18 12:04:18 -04:00
Mary Gouseti
b249462795
[7.17] WaitForSnapshotStep verifies if the index belongs to the latest snapshot of that SLM policy (#100911) (#101030)
* `WaitForSnapshotStep` verifies if the index belongs to the latest snapshot of that SLM policy (#100911)

The `WaitForSnapshotStep` used to check if the SLM policy has been
executed after the index has entered the delete phase, but it did not
check if the SLM policy included this index.

The result of this is that if the user used an SLM policy that did not
include this index, when the index would enter the
`WaitForSnapshotStep`, it would wait for a snapshot to be taken, a
snapshot that would not include the index, and then ILM would delete the
index.

See the exact reproduction path:
https://github.com/elastic/elasticsearch/issues/57809

**Solution** This PR, after it finds a successful SLM run, it verifies
if the snapshot taken by SLM contains this index. If not it throws an
error, otherwise it proceeds.

ILM explain will report:

```
"step_info": {
        "type": "illegal_state_exception",
        "reason": "the last successful snapshot of policy 'hourly-snapshots' does not include index '.ds-my-other-stream-2023.10.16-000001'"
      }
```

**Backwards compatibility concerns** In this PR, the
`WaitForSnapshotStep` changed from `ClusterStateWaitStep` to
`AsyncWaitStep`. We do not think this is gonna cause an issue. This was
tested manually by the following steps: - Run a master node with the old
version. - When ILM is executing `wait-for-snapshot`, we shutdown the
node - We start the node again with the new version os ES - ES was able
to pick up the step and continue with the new code.

We believe that this covers bwc concerns.

Fixes: https://github.com/elastic/elasticsearch/issues/57809
(cherry picked from commit 5697fcf594)
2023-10-18 12:33:22 +03:00
Rene Groeschke
468bef1b9e
[7.17] Update gradle wrapper to 8.4 (#99856) (#100926)
* Remove deprecated forConfigurationTime usage
2023-10-17 13:44:48 +02:00
Rene Groeschke
a080bb2bbe
[7.17] Update gradle wrapper to 8.3 (#97838) (#100715)
* Update gradle wrapper to 8.3 (#97838)

Gradle now fully supports compiling, testing and running on Java 20.
Among other general performance improvements this release introduces --test-dry-run command line option that allows checking if tests are filtered or not by gradle.
Required updating nebula ospackage plugin as setuid was broken in gradle 8.3.

(cherry picked from commit b23e000c30)

# Conflicts:
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/LegacyYamlRestCompatTestPluginFuncTest.groovy
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaModulePathPlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build-tools-internal/src/main/resources/minimumGradleVersion
#	gradle/verification-metadata.xml
#	gradle/wrapper/gradle-wrapper.jar
#	gradlew
#	x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java

* [7.17] Use patched nebula os package gradle plugin

* Update testingconvention precommit integ test
2023-10-16 06:18:08 -04:00
Brian Seeders
7ef9572438
Add healthcheck for shibboleth-idp in idp-fixture (again) (#100461) (#100525)
(cherry picked from commit d0c263bfa6)

# Conflicts:
#	x-pack/test/idp-fixture/build.gradle
2023-10-09 16:53:43 -04:00
Ed Savage
baad6f6e6a
[7.17][ML] defend against negative datafeed start times (#100332)
* [ML] Defend against negative datafeed start times (#100284)

A negative start time in the datafeed can cause significant disruption
to an entire cluster. This PR checks that the start time is greater
than or equal to 0 and throws an exception otherwise.

* Adjust backported test for 7.17
2023-10-05 08:03:00 -04:00
James Baiera
eaef3a9d1d
Validate enrich index before completing policy execution (#100106) (#100160)
This PR adds a validation step to the end of an enrich policy run to ensure the integrity of the
enrich index that is about to be promoted.

(cherry picked from commit 225db3190a)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-10-03 11:25:43 -04:00
James Baiera
364c340a73
Show concrete error when enrich index not exist rather than NPE (#99604) (#100155)
There should be NullPointerException check and throw index not found exception to the response
so the user can understand what happens with the enrich index

---------

Co-authored-by: James Baiera <james.baiera@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit ccc896d128)

# Conflicts:
#	x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichCache.java
#	x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichCacheTests.java

Co-authored-by: puppylpg <shininglhb@163.com>
2023-10-02 16:54:07 -04:00
Rene Groeschke
5afd06ae57
[7.17] Update Gradle Wrapper to 8.2 (#96686) (#97484)
* Update Gradle Wrapper to 8.2 (#96686)

- Convention usage has been deprecated and was fixed in our build files
- Fix test dependencies and deprecation
2023-09-27 08:46:44 +02:00
Volodymyr Krasnikov
00b68250ab
Add some debug logs to IT test (#98461)
* Add some debug logs to IT test

* Output available index dirs on the node
2023-09-13 13:40:03 -07:00