Skip to content

Commit ef539d0

Browse files
committed
Entitlements from CI
1 parent 443ca76 commit ef539d0

File tree

7 files changed

+9
-4
lines changed

7 files changed

+9
-4
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ private static PolicyManager createPolicyManager() {
131131
new Scope("org.apache.httpcomponents.httpclient", List.of(new OutboundNetworkEntitlement())),
132132
new Scope("io.netty.transport", List.of(new InboundNetworkEntitlement(), new OutboundNetworkEntitlement())),
133133
new Scope("org.apache.lucene.core", List.of(new LoadNativeLibrariesEntitlement(), new ManageThreadsEntitlement())),
134+
new Scope("org.apache.logging.log4j.core", List.of(new ManageThreadsEntitlement())),
134135
new Scope("org.elasticsearch.nativeaccess", List.of(new LoadNativeLibrariesEntitlement()))
135136
)
136137
);
137138
// agents run without a module, so this is a special hack for the apm agent
138139
// this should be removed once https://github.com/elastic/elasticsearch/issues/109335 is completed
139-
List<Entitlement> agentEntitlements = List.of(new CreateClassLoaderEntitlement());
140+
List<Entitlement> agentEntitlements = List.of(new CreateClassLoaderEntitlement(), new ManageThreadsEntitlement());
140141
var resolver = EntitlementBootstrap.bootstrapArgs().pluginResolver();
141142
return new PolicyManager(serverPolicy, agentEntitlements, pluginPolicies, resolver, AGENTS_PACKAGE_NAME, ENTITLEMENTS_MODULE);
142143
}

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public void checkFileRead(Class<?> callerClass, Path path) {
256256
Strings.format(
257257
"Not entitled: component [%s], module [%s], class [%s], entitlement [file], operation [read], path [%s]",
258258
entitlements.componentName(),
259-
requestingClass.getModule(),
259+
requestingClass.getModule().getName(),
260260
requestingClass,
261261
path
262262
)
@@ -281,7 +281,7 @@ public void checkFileWrite(Class<?> callerClass, Path path) {
281281
Strings.format(
282282
"Not entitled: component [%s], module [%s], class [%s], entitlement [file], operation [write], path [%s]",
283283
entitlements.componentName(),
284-
requestingClass.getModule(),
284+
requestingClass.getModule().getName(),
285285
requestingClass,
286286
path
287287
)

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/entitlements/ManageThreadsEntitlement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
import org.elasticsearch.entitlement.runtime.policy.ExternalEntitlement;
1313

1414
public record ManageThreadsEntitlement() implements Entitlement {
15-
@ExternalEntitlement
15+
@ExternalEntitlement(esModulesOnly = false)
1616
public ManageThreadsEntitlement {}
1717
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
io.netty.common:
22
- outbound_network
3+
- manage_threads
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ALL-UNNAMED:
2+
- manage_threads
23
- outbound_network
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ALL-UNNAMED:
22
- manage_threads
33
- outbound_network
4+
- load_native_libraries
45
- write_system_properties:
56
properties:
67
- hadoop.home.dir

x-pack/plugin/core/src/main/plugin-metadata/entitlement-policy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ org.apache.httpcomponents.httpcore.nio:
77
org.apache.httpcomponents.httpasyncclient:
88
- manage_threads
99
unboundid.ldapsdk:
10+
- manage_threads
1011
- write_system_properties:
1112
properties:
1213
- java.security.auth.login.config

0 commit comments

Comments
 (0)