Skip to content

Commit de150b2

Browse files
author
elasticsearchmachine
committed
Merge remote-tracking branch 'origin/main' into lucene_snapshot
2 parents 15651f4 + 1714247 commit de150b2

File tree

60 files changed

+1418
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1418
-337
lines changed

docs/changelog/119233.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 119233
2+
summary: Fixing `GetDatabaseConfigurationAction` response serialization
3+
area: Ingest Node
4+
type: bug
5+
issues: []

docs/changelog/119474.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 119474
2+
summary: "Add ES|QL cross-cluster query telemetry collection"
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/reference/cluster/stats.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Returns cluster statistics.
2525

2626
* If the {es} {security-features} are enabled, you must have the `monitor` or
2727
`manage` <<privileges-list-cluster,cluster privilege>> to use this API.
28-
2928
[[cluster-stats-api-desc]]
3029
==== {api-description-title}
3130

@@ -1397,7 +1396,7 @@ as a human-readable string.
13971396
13981397
13991398
`_search`:::
1400-
(object) Contains the information about the <<modules-cross-cluster-search, {ccs}>> usage in the cluster.
1399+
(object) Contains information about <<modules-cross-cluster-search, {ccs}>> usage.
14011400
+
14021401
.Properties of `_search`
14031402
[%collapsible%open]
@@ -1528,7 +1527,11 @@ This may include requests where partial results were returned, but not requests
15281527
15291528
=======
15301529

1530+
15311531
======
1532+
`_esql`:::
1533+
(object) Contains information about <<esql-cross-clusters,{esql} {ccs}>> usage.
1534+
The structure of the object is the same as the `_search` object above.
15321535
15331536
=====
15341537

docs/reference/indices/index-templates.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ applying the templates, do one or more of the following:
6161
6262
- Use a non-overlapping index pattern.
6363
64-
- Assign templates with an overlapping pattern a `priority` higher than `200`.
64+
- Assign templates with an overlapping pattern a `priority` higher than `500`.
6565
For example, if you don't use {fleet} or {agent} and want to create a template
6666
for the `logs-*` index pattern, assign your template a priority of `500`. This
6767
ensures your template is applied instead of the built-in template for

libs/entitlement/bridge/src/main/java/org/elasticsearch/entitlement/bridge/EntitlementChecker.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ public interface EntitlementChecker {
2626

2727
void check$java_lang_Runtime$halt(Class<?> callerClass, Runtime runtime, int status);
2828

29+
// ClassLoader ctor
30+
void check$java_lang_ClassLoader$(Class<?> callerClass);
31+
32+
void check$java_lang_ClassLoader$(Class<?> callerClass, ClassLoader parent);
33+
34+
void check$java_lang_ClassLoader$(Class<?> callerClass, String name, ClassLoader parent);
35+
36+
// SecureClassLoader ctor
37+
void check$java_security_SecureClassLoader$(Class<?> callerClass);
38+
39+
void check$java_security_SecureClassLoader$(Class<?> callerClass, ClassLoader parent);
40+
41+
void check$java_security_SecureClassLoader$(Class<?> callerClass, String name, ClassLoader parent);
42+
2943
// URLClassLoader constructors
3044
void check$java_net_URLClassLoader$(Class<?> callerClass, URL[] urls);
3145

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.elasticsearch.entitlement.instrumentation.Transformer;
2121
import org.elasticsearch.entitlement.runtime.api.ElasticsearchEntitlementChecker;
2222
import org.elasticsearch.entitlement.runtime.policy.CreateClassLoaderEntitlement;
23+
import org.elasticsearch.entitlement.runtime.policy.Entitlement;
2324
import org.elasticsearch.entitlement.runtime.policy.ExitVMEntitlement;
2425
import org.elasticsearch.entitlement.runtime.policy.Policy;
2526
import org.elasticsearch.entitlement.runtime.policy.PolicyManager;
@@ -93,9 +94,17 @@ private static PolicyManager createPolicyManager() throws IOException {
9394
// TODO(ES-10031): Decide what goes in the elasticsearch default policy and extend it
9495
var serverPolicy = new Policy(
9596
"server",
96-
List.of(new Scope("org.elasticsearch.server", List.of(new ExitVMEntitlement(), new CreateClassLoaderEntitlement())))
97+
List.of(
98+
new Scope("org.elasticsearch.base", List.of(new CreateClassLoaderEntitlement())),
99+
new Scope("org.elasticsearch.xcontent", List.of(new CreateClassLoaderEntitlement())),
100+
new Scope("org.elasticsearch.server", List.of(new ExitVMEntitlement(), new CreateClassLoaderEntitlement()))
101+
)
97102
);
98-
return new PolicyManager(serverPolicy, pluginPolicies, EntitlementBootstrap.bootstrapArgs().pluginResolver(), ENTITLEMENTS_MODULE);
103+
// agents run without a module, so this is a special hack for the apm agent
104+
// this should be removed once https://github.com/elastic/elasticsearch/issues/109335 is completed
105+
List<Entitlement> agentEntitlements = List.of(new CreateClassLoaderEntitlement());
106+
var resolver = EntitlementBootstrap.bootstrapArgs().pluginResolver();
107+
return new PolicyManager(serverPolicy, agentEntitlements, pluginPolicies, resolver, ENTITLEMENTS_MODULE);
99108
}
100109

101110
private static Map<String, Policy> createPluginPolicies(Collection<EntitlementBootstrap.PluginData> pluginData) throws IOException {
@@ -120,12 +129,12 @@ private static Policy loadPluginPolicy(Path pluginRoot, boolean isModular, Strin
120129

121130
// TODO: should this check actually be part of the parser?
122131
for (Scope scope : policy.scopes) {
123-
if (moduleNames.contains(scope.name) == false) {
132+
if (moduleNames.contains(scope.moduleName) == false) {
124133
throw new IllegalStateException(
125134
Strings.format(
126135
"Invalid module name in policy: plugin [%s] does not have module [%s]; available modules [%s]; policy file [%s]",
127136
pluginName,
128-
scope.name,
137+
scope.moduleName,
129138
String.join(", ", moduleNames),
130139
policyFile
131140
)

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/api/ElasticsearchEntitlementChecker.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* The trampoline module loads this object via SPI.
2828
*/
2929
public class ElasticsearchEntitlementChecker implements EntitlementChecker {
30+
3031
private final PolicyManager policyManager;
3132

3233
public ElasticsearchEntitlementChecker(PolicyManager policyManager) {
@@ -43,6 +44,36 @@ public ElasticsearchEntitlementChecker(PolicyManager policyManager) {
4344
policyManager.checkExitVM(callerClass);
4445
}
4546

47+
@Override
48+
public void check$java_lang_ClassLoader$(Class<?> callerClass) {
49+
policyManager.checkCreateClassLoader(callerClass);
50+
}
51+
52+
@Override
53+
public void check$java_lang_ClassLoader$(Class<?> callerClass, ClassLoader parent) {
54+
policyManager.checkCreateClassLoader(callerClass);
55+
}
56+
57+
@Override
58+
public void check$java_lang_ClassLoader$(Class<?> callerClass, String name, ClassLoader parent) {
59+
policyManager.checkCreateClassLoader(callerClass);
60+
}
61+
62+
@Override
63+
public void check$java_security_SecureClassLoader$(Class<?> callerClass) {
64+
policyManager.checkCreateClassLoader(callerClass);
65+
}
66+
67+
@Override
68+
public void check$java_security_SecureClassLoader$(Class<?> callerClass, ClassLoader parent) {
69+
policyManager.checkCreateClassLoader(callerClass);
70+
}
71+
72+
@Override
73+
public void check$java_security_SecureClassLoader$(Class<?> callerClass, String name, ClassLoader parent) {
74+
policyManager.checkCreateClassLoader(callerClass);
75+
}
76+
4677
@Override
4778
public void check$java_net_URLClassLoader$(Class<?> callerClass, URL[] urls) {
4879
policyManager.checkCreateClassLoader(callerClass);

0 commit comments

Comments
 (0)