Skip to content

Commit

Permalink
Merge branch 'main' into esql-delete-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Jan 3, 2025
2 parents f33e19c + a268dee commit f626974
Show file tree
Hide file tree
Showing 77 changed files with 1,941 additions and 449 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/119054.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 119054
summary: "[Security Solution] allows `kibana_system` user to manage .reindexed-v8-*\
\ Security Solution indices"
area: Authorization
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/119233.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 119233
summary: Fixing `GetDatabaseConfigurationAction` response serialization
area: Ingest Node
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/119474.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 119474
summary: "Add ES|QL cross-cluster query telemetry collection"
area: ES|QL
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/119495.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 119495
summary: Add mapping for `event_name` for OTel logs
area: Data streams
type: enhancement
issues: []
7 changes: 5 additions & 2 deletions docs/reference/cluster/stats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Returns cluster statistics.

* If the {es} {security-features} are enabled, you must have the `monitor` or
`manage` <<privileges-list-cluster,cluster privilege>> to use this API.

[[cluster-stats-api-desc]]
==== {api-description-title}

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


======
`_esql`:::
(object) Contains information about <<esql-cross-clusters,{esql} {ccs}>> usage.
The structure of the object is the same as the `_search` object above.
=====

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/index-templates.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ applying the templates, do one or more of the following:
- Use a non-overlapping index pattern.
- Assign templates with an overlapping pattern a `priority` higher than `200`.
- Assign templates with an overlapping pattern a `priority` higher than `500`.
For example, if you don't use {fleet} or {agent} and want to create a template
for the `logs-*` index pattern, assign your template a priority of `500`. This
ensures your template is applied instead of the built-in template for
Expand Down
7 changes: 5 additions & 2 deletions docs/reference/inference/service-elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ For the most up-to-date API details, refer to {api-es}/group/endpoint-inference[

Creates an {infer} endpoint to perform an {infer} task with the `elasticsearch` service.

NOTE: If you use the ELSER or the E5 model through the `elasticsearch` service, the API request will automatically download and deploy the model if it isn't downloaded yet.

[NOTE]
====
* Your {es} deployment contains <<default-enpoints,preconfigured ELSER and E5 {infer} endpoints>>, you only need to create the enpoints using the API if you want to customize the settings.
* If you use the ELSER or the E5 model through the `elasticsearch` service, the API request will automatically download and deploy the model if it isn't downloaded yet.
====

[discrete]
[[infer-service-elasticsearch-api-request]]
Expand Down
11 changes: 7 additions & 4 deletions docs/reference/inference/service-elser.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ For the most up-to-date API details, refer to {api-es}/group/endpoint-inference[
Creates an {infer} endpoint to perform an {infer} task with the `elser` service.
You can also deploy ELSER by using the <<infer-service-elasticsearch>>.

NOTE: The API request will automatically download and deploy the ELSER model if
it isn't already downloaded.
[NOTE]
====
* Your {es} deployment contains <<default-enpoints,a preconfigured ELSER {infer} endpoint>>, you only need to create the enpoint using the API if you want to customize the settings.
* The API request will automatically download and deploy the ELSER model if it isn't already downloaded.
====

[WARNING]
.Deprecated in 8.16
====
The elser service is deprecated and will be removed in a future release.
Use the <<infer-service-elasticsearch>> instead, with model_id included in the service_settings.
The `elser` service is deprecated and will be removed in a future release.
Use the <<infer-service-elasticsearch>> instead, with `model_id` included in the `service_settings`.
====

[discrete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ public interface EntitlementChecker {

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

// ClassLoader ctor
void check$java_lang_ClassLoader$(Class<?> callerClass);

void check$java_lang_ClassLoader$(Class<?> callerClass, ClassLoader parent);

void check$java_lang_ClassLoader$(Class<?> callerClass, String name, ClassLoader parent);

// SecureClassLoader ctor
void check$java_security_SecureClassLoader$(Class<?> callerClass);

void check$java_security_SecureClassLoader$(Class<?> callerClass, ClassLoader parent);

void check$java_security_SecureClassLoader$(Class<?> callerClass, String name, ClassLoader parent);

// URLClassLoader constructors
void check$java_net_URLClassLoader$(Class<?> callerClass, URL[] urls);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.elasticsearch.entitlement.instrumentation.Transformer;
import org.elasticsearch.entitlement.runtime.api.ElasticsearchEntitlementChecker;
import org.elasticsearch.entitlement.runtime.policy.CreateClassLoaderEntitlement;
import org.elasticsearch.entitlement.runtime.policy.Entitlement;
import org.elasticsearch.entitlement.runtime.policy.ExitVMEntitlement;
import org.elasticsearch.entitlement.runtime.policy.Policy;
import org.elasticsearch.entitlement.runtime.policy.PolicyManager;
Expand Down Expand Up @@ -93,9 +94,17 @@ private static PolicyManager createPolicyManager() throws IOException {
// TODO(ES-10031): Decide what goes in the elasticsearch default policy and extend it
var serverPolicy = new Policy(
"server",
List.of(new Scope("org.elasticsearch.server", List.of(new ExitVMEntitlement(), new CreateClassLoaderEntitlement())))
List.of(
new Scope("org.elasticsearch.base", List.of(new CreateClassLoaderEntitlement())),
new Scope("org.elasticsearch.xcontent", List.of(new CreateClassLoaderEntitlement())),
new Scope("org.elasticsearch.server", List.of(new ExitVMEntitlement(), new CreateClassLoaderEntitlement()))
)
);
return new PolicyManager(serverPolicy, pluginPolicies, EntitlementBootstrap.bootstrapArgs().pluginResolver(), ENTITLEMENTS_MODULE);
// agents run without a module, so this is a special hack for the apm agent
// this should be removed once https://github.com/elastic/elasticsearch/issues/109335 is completed
List<Entitlement> agentEntitlements = List.of(new CreateClassLoaderEntitlement());
var resolver = EntitlementBootstrap.bootstrapArgs().pluginResolver();
return new PolicyManager(serverPolicy, agentEntitlements, pluginPolicies, resolver, ENTITLEMENTS_MODULE);
}

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

// TODO: should this check actually be part of the parser?
for (Scope scope : policy.scopes) {
if (moduleNames.contains(scope.name) == false) {
if (moduleNames.contains(scope.moduleName) == false) {
throw new IllegalStateException(
Strings.format(
"Invalid module name in policy: plugin [%s] does not have module [%s]; available modules [%s]; policy file [%s]",
pluginName,
scope.name,
scope.moduleName,
String.join(", ", moduleNames),
policyFile
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* The trampoline module loads this object via SPI.
*/
public class ElasticsearchEntitlementChecker implements EntitlementChecker {

private final PolicyManager policyManager;

public ElasticsearchEntitlementChecker(PolicyManager policyManager) {
Expand All @@ -43,6 +44,36 @@ public ElasticsearchEntitlementChecker(PolicyManager policyManager) {
policyManager.checkExitVM(callerClass);
}

@Override
public void check$java_lang_ClassLoader$(Class<?> callerClass) {
policyManager.checkCreateClassLoader(callerClass);
}

@Override
public void check$java_lang_ClassLoader$(Class<?> callerClass, ClassLoader parent) {
policyManager.checkCreateClassLoader(callerClass);
}

@Override
public void check$java_lang_ClassLoader$(Class<?> callerClass, String name, ClassLoader parent) {
policyManager.checkCreateClassLoader(callerClass);
}

@Override
public void check$java_security_SecureClassLoader$(Class<?> callerClass) {
policyManager.checkCreateClassLoader(callerClass);
}

@Override
public void check$java_security_SecureClassLoader$(Class<?> callerClass, ClassLoader parent) {
policyManager.checkCreateClassLoader(callerClass);
}

@Override
public void check$java_security_SecureClassLoader$(Class<?> callerClass, String name, ClassLoader parent) {
policyManager.checkCreateClassLoader(callerClass);
}

@Override
public void check$java_net_URLClassLoader$(Class<?> callerClass, URL[] urls) {
policyManager.checkCreateClassLoader(callerClass);
Expand Down
Loading

0 comments on commit f626974

Please sign in to comment.