Skip to content

Commit 686d35e

Browse files
committed
Merge branch 'master' into retention-leases-version
* master: Replace awaitBusy with assertBusy in atLeastDocsIndexed (elastic#38190) Adjust SearchRequest version checks (elastic#38181) AwaitsFix testClientSucceedsWithVerificationDisabled (elastic#38213) Zen2ify RareClusterStateIT (elastic#38184) ML: Fix error race condition on stop _all datafeeds and close _all jobs (elastic#38113) AwaitsFix PUT mapping with _doc on an index that has types (elastic#38204) Allow built-in monitoring_user role to call GET _xpack API (elastic#38060) Update geo_shape docs to include unsupported features (elastic#38138) [ML] Remove "8" prefixes from file structure finder timestamp formats (elastic#38016) Disable bwc tests while backporting elastic#38104 (elastic#38182) Enable TLSv1.3 by default for JDKs with support (elastic#38103) Fix _host based require filters (elastic#38173) RestoreService should update primary terms when restoring shards of existing indices (elastic#38177) Throw if two inner_hits have the same name (elastic#37645)
2 parents 7cf145c + f64b203 commit 686d35e

File tree

38 files changed

+422
-225
lines changed

38 files changed

+422
-225
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ task verifyVersions {
160160
* after the backport of the backcompat code is complete.
161161
*/
162162
final boolean bwc_tests_enabled = false
163-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/37951" /* place a PR link here when committing bwc changes */
163+
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/37951,https://github.com/elastic/elasticsearch/pull/38180" /* place a PR link here when committing bwc changes */
164164
if (bwc_tests_enabled == false) {
165165
if (bwc_tests_disabled_issue.isEmpty()) {
166166
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

docs/reference/mapping/types/geo-shape.asciidoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type.
2121
|=======================================================================
2222
|Option |Description| Default
2323

24-
|`tree |deprecated[6.6, PrefixTrees no longer used] Name of the PrefixTree
24+
|`tree` |deprecated[6.6, PrefixTrees no longer used] Name of the PrefixTree
2525
implementation to be used: `geohash` for GeohashPrefixTree and `quadtree`
2626
for QuadPrefixTree. Note: This parameter is only relevant for `term` and
2727
`recursive` strategies.
@@ -127,6 +127,20 @@ the `tree` or `strategy` parameters according to the appropriate
127127
<<geo-shape-mapping-options>>. Note that these parameters are now deprecated
128128
and will be removed in a future version.
129129

130+
*IMPORTANT NOTES*
131+
132+
The following features are not yet supported with the new indexing approach:
133+
134+
* `geo_shape` query with `MultiPoint` geometry types - Elasticsearch currently prevents searching
135+
geo_shape fields with a MultiPoint geometry type to avoid a brute force linear search
136+
over each individual point. For now, if this is absolutely needed, this can be achieved
137+
using a `bool` query with each individual point.
138+
139+
* `CONTAINS` relation query - when using the new default vector indexing strategy, `geo_shape`
140+
queries with `relation` defined as `contains` are not yet supported. If this query relation
141+
is an absolute necessity, it is recommended to set `strategy` to `quadtree` and use the
142+
deprecated PrefixTree strategy indexing approach.
143+
130144
[[prefix-trees]]
131145
[float]
132146
==== Prefix trees

docs/reference/migration/migrate_7_0/settings.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ used.
138138

139139
TLS version 1.0 is now disabled by default as it suffers from
140140
https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols[known security issues].
141-
The default protocols are now TLSv1.2 and TLSv1.1.
141+
The default protocols are now TLSv1.3 (if supported), TLSv1.2 and TLSv1.1.
142142
You can enable TLS v1.0 by configuring the relevant `ssl.supported_protocols` setting to include `"TLSv1"`, for example:
143143
[source,yaml]
144144
--------------------------------------------------
145-
xpack.security.http.ssl.supported_protocols: [ "TLSv1.2", "TLSv1.1", "TLSv1" ]
145+
xpack.security.http.ssl.supported_protocols: [ "TLSv1.3", "TLSv1.2", "TLSv1.1", "TLSv1" ]
146146
--------------------------------------------------
147147

148148
[float]

docs/reference/ml/apis/find-file-structure.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,11 @@ If the request does not encounter errors, you receive the following result:
606606
},
607607
"tpep_dropoff_datetime" : {
608608
"type" : "date",
609-
"format" : "8yyyy-MM-dd HH:mm:ss"
609+
"format" : "yyyy-MM-dd HH:mm:ss"
610610
},
611611
"tpep_pickup_datetime" : {
612612
"type" : "date",
613-
"format" : "8yyyy-MM-dd HH:mm:ss"
613+
"format" : "yyyy-MM-dd HH:mm:ss"
614614
},
615615
"trip_distance" : {
616616
"type" : "double"
@@ -624,7 +624,7 @@ If the request does not encounter errors, you receive the following result:
624624
"field" : "tpep_pickup_datetime",
625625
"timezone" : "{{ beat.timezone }}",
626626
"formats" : [
627-
"8yyyy-MM-dd HH:mm:ss"
627+
"yyyy-MM-dd HH:mm:ss"
628628
]
629629
}
630630
}
@@ -1398,7 +1398,7 @@ this:
13981398
"field" : "timestamp",
13991399
"timezone" : "{{ beat.timezone }}",
14001400
"formats" : [
1401-
"8yyyy-MM-dd'T'HH:mm:ss,SSS"
1401+
"yyyy-MM-dd'T'HH:mm:ss,SSS"
14021402
]
14031403
}
14041404
},
@@ -1558,7 +1558,7 @@ this:
15581558
"field" : "timestamp",
15591559
"timezone" : "{{ beat.timezone }}",
15601560
"formats" : [
1561-
"8yyyy-MM-dd'T'HH:mm:ss,SSS"
1561+
"yyyy-MM-dd'T'HH:mm:ss,SSS"
15621562
]
15631563
}
15641564
},

docs/reference/settings/security-settings.asciidoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ and `full`. Defaults to `full`.
480480
See <<ssl-tls-settings,`ssl.verification_mode`>> for an explanation of these values.
481481

482482
`ssl.supported_protocols`::
483-
Supported protocols for TLS/SSL (with versions). Defaults to `TLSv1.2,TLSv1.1`.
483+
Supported protocols for TLS/SSL (with versions). Defaults to `TLSv1.3,TLSv1.2,TLSv1.1` if
484+
the JVM supports TLSv1.3, otherwise `TLSv1.2,TLSv1.1`.
484485

485486
`ssl.cipher_suites`:: Specifies the cipher suites that should be supported when
486487
communicating with the LDAP server.
@@ -724,7 +725,8 @@ and `full`. Defaults to `full`.
724725
See <<ssl-tls-settings,`ssl.verification_mode`>> for an explanation of these values.
725726

726727
`ssl.supported_protocols`::
727-
Supported protocols for TLS/SSL (with versions). Defaults to `TLSv1.2, TLSv1.1`.
728+
Supported protocols for TLS/SSL (with versions). Defaults to `TLSv1.3,TLSv1.2,TLSv1.1` if
729+
the JVM supports TLSv1.3, otherwise `TLSv1.2,TLSv1.1`.
728730

729731
`ssl.cipher_suites`:: Specifies the cipher suites that should be supported when
730732
communicating with the Active Directory server.
@@ -1132,7 +1134,8 @@ Defaults to `full`.
11321134
See <<ssl-tls-settings,`ssl.verification_mode`>> for a more detailed explanation of these values.
11331135

11341136
`ssl.supported_protocols`::
1135-
Specifies the supported protocols for TLS/SSL.
1137+
Specifies the supported protocols for TLS/SSL. Defaults to `TLSv1.3,TLSv1.2,TLSv1.1` if
1138+
the JVM supports TLSv1.3, otherwise `TLSv1.2,TLSv1.1`.
11361139

11371140
`ssl.cipher_suites`::
11381141
Specifies the
@@ -1206,7 +1209,8 @@ settings. For more information, see
12061209

12071210
`ssl.supported_protocols`::
12081211
Supported protocols with versions. Valid protocols: `SSLv2Hello`,
1209-
`SSLv3`, `TLSv1`, `TLSv1.1`, `TLSv1.2`. Defaults to `TLSv1.2`, `TLSv1.1`.
1212+
`SSLv3`, `TLSv1`, `TLSv1.1`, `TLSv1.2`, `TLSv1.3`. Defaults to `TLSv1.3,TLSv1.2,TLSv1.1` if
1213+
the JVM supports TLSv1.3, otherwise `TLSv1.2,TLSv1.1`.
12101214
+
12111215
--
12121216
NOTE: If `xpack.security.fips_mode.enabled` is `true`, you cannot use `SSLv2Hello`

docs/reference/settings/ssl-settings.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ endif::server[]
1111

1212
+{ssl-prefix}.ssl.supported_protocols+::
1313
Supported protocols with versions. Valid protocols: `SSLv2Hello`,
14-
`SSLv3`, `TLSv1`, `TLSv1.1`, `TLSv1.2`. Defaults to `TLSv1.2`, `TLSv1.1`.
14+
`SSLv3`, `TLSv1`, `TLSv1.1`, `TLSv1.2`, `TLSv1.3`. Defaults to `TLSv1.3,TLSv1.2,TLSv1.1` if
15+
the JVM supports TLSv1.3, otherwise `TLSv1.2,TLSv1.1`.
1516

1617

1718
ifdef::server[]

libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/SslConfiguration.java

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@
2424
import javax.net.ssl.X509ExtendedTrustManager;
2525
import java.nio.file.Path;
2626
import java.security.GeneralSecurityException;
27-
import java.util.Arrays;
27+
import java.security.NoSuchAlgorithmException;
2828
import java.util.Collection;
2929
import java.util.Collections;
3030
import java.util.HashSet;
31+
import java.util.LinkedHashMap;
3132
import java.util.List;
33+
import java.util.Map;
34+
import java.util.Map.Entry;
3235
import java.util.Objects;
3336
import java.util.Set;
3437

@@ -40,6 +43,30 @@
4043
*/
4144
public class SslConfiguration {
4245

46+
/**
47+
* An ordered map of protocol algorithms to SSLContext algorithms. The map is ordered from most
48+
* secure to least secure. The names in this map are taken from the
49+
* <a href="https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#sslcontext-algorithms">
50+
* Java Security Standard Algorithm Names Documentation for Java 11</a>.
51+
*/
52+
static final Map<String, String> ORDERED_PROTOCOL_ALGORITHM_MAP;
53+
static {
54+
LinkedHashMap<String, String> protocolAlgorithmMap = new LinkedHashMap<>();
55+
try {
56+
SSLContext.getInstance("TLSv1.3");
57+
protocolAlgorithmMap.put("TLSv1.3", "TLSv1.3");
58+
} catch (NoSuchAlgorithmException e) {
59+
// ignore since we support JVMs that do not support TLSv1.3
60+
}
61+
protocolAlgorithmMap.put("TLSv1.2", "TLSv1.2");
62+
protocolAlgorithmMap.put("TLSv1.1", "TLSv1.1");
63+
protocolAlgorithmMap.put("TLSv1", "TLSv1");
64+
protocolAlgorithmMap.put("SSLv3", "SSLv3");
65+
protocolAlgorithmMap.put("SSLv2", "SSL");
66+
protocolAlgorithmMap.put("SSLv2Hello", "SSL");
67+
ORDERED_PROTOCOL_ALGORITHM_MAP = Collections.unmodifiableMap(protocolAlgorithmMap);
68+
}
69+
4370
private final SslTrustConfig trustConfig;
4471
private final SslKeyConfig keyConfig;
4572
private final SslVerificationMode verificationMode;
@@ -124,12 +151,13 @@ private String contextProtocol() {
124151
if (supportedProtocols.isEmpty()) {
125152
throw new SslConfigException("no SSL/TLS protocols have been configured");
126153
}
127-
for (String tryProtocol : Arrays.asList("TLSv1.2", "TLSv1.1", "TLSv1", "SSLv3")) {
128-
if (supportedProtocols.contains(tryProtocol)) {
129-
return tryProtocol;
154+
for (Entry<String, String> entry : ORDERED_PROTOCOL_ALGORITHM_MAP.entrySet()) {
155+
if (supportedProtocols.contains(entry.getKey())) {
156+
return entry.getValue();
130157
}
131158
}
132-
return "SSL";
159+
throw new SslConfigException("no supported SSL/TLS protocol was found in the configured supported protocols: "
160+
+ supportedProtocols);
133161
}
134162

135163
@Override

libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/SslConfigurationLoader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
import java.security.NoSuchAlgorithmException;
2727
import java.util.ArrayList;
2828
import java.util.Arrays;
29+
import java.util.Collections;
2930
import java.util.List;
3031
import java.util.Objects;
3132
import java.util.function.Function;
3233
import java.util.stream.Collectors;
3334

3435
import static org.elasticsearch.common.ssl.KeyStoreUtil.inferKeyStoreType;
36+
import static org.elasticsearch.common.ssl.SslConfiguration.ORDERED_PROTOCOL_ALGORITHM_MAP;
3537
import static org.elasticsearch.common.ssl.SslConfigurationKeys.CERTIFICATE;
3638
import static org.elasticsearch.common.ssl.SslConfigurationKeys.CERTIFICATE_AUTHORITIES;
3739
import static org.elasticsearch.common.ssl.SslConfigurationKeys.CIPHERS;
@@ -68,7 +70,9 @@
6870
*/
6971
public abstract class SslConfigurationLoader {
7072

71-
static final List<String> DEFAULT_PROTOCOLS = Arrays.asList("TLSv1.2", "TLSv1.1");
73+
static final List<String> DEFAULT_PROTOCOLS = Collections.unmodifiableList(
74+
ORDERED_PROTOCOL_ALGORITHM_MAP.containsKey("TLSv1.3") ?
75+
Arrays.asList("TLSv1.3", "TLSv1.2", "TLSv1.1") : Arrays.asList("TLSv1.2", "TLSv1.1"));
7276
static final List<String> DEFAULT_CIPHERS = loadDefaultCiphers();
7377
private static final char[] EMPTY_PASSWORD = new char[0];
7478

modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,13 @@ protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws I
460460
@Override
461461
protected void extractInnerHitBuilders(Map<String, InnerHitContextBuilder> innerHits) {
462462
if (innerHitBuilder != null) {
463+
String name = innerHitBuilder.getName() != null ? innerHitBuilder.getName() : type;
464+
if (innerHits.containsKey(name)) {
465+
throw new IllegalArgumentException("[inner_hits] already contains an entry for key [" + name + "]");
466+
}
467+
463468
Map<String, InnerHitContextBuilder> children = new HashMap<>();
464469
InnerHitContextBuilder.extractInnerHits(query, children);
465-
String name = innerHitBuilder.getName() != null ? innerHitBuilder.getName() : type;
466470
InnerHitContextBuilder innerHitContextBuilder =
467471
new ParentChildInnerHitContextBuilder(type, true, query, innerHitBuilder, children);
468472
innerHits.put(name, innerHitContextBuilder);

modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,13 @@ protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws I
285285
@Override
286286
protected void extractInnerHitBuilders(Map<String, InnerHitContextBuilder> innerHits) {
287287
if (innerHitBuilder != null) {
288+
String name = innerHitBuilder.getName() != null ? innerHitBuilder.getName() : type;
289+
if (innerHits.containsKey(name)) {
290+
throw new IllegalArgumentException("[inner_hits] already contains an entry for key [" + name + "]");
291+
}
292+
288293
Map<String, InnerHitContextBuilder> children = new HashMap<>();
289294
InnerHitContextBuilder.extractInnerHits(query, children);
290-
String name = innerHitBuilder.getName() != null ? innerHitBuilder.getName() : type;
291295
InnerHitContextBuilder innerHitContextBuilder =
292296
new ParentChildInnerHitContextBuilder(type, false, query, innerHitBuilder, children);
293297
innerHits.put(name, innerHitContextBuilder);

0 commit comments

Comments
 (0)