Skip to content

Commit 56462ba

Browse files
committed
Silly APM Agent fake file permissions
1 parent 60a2f1b commit 56462ba

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,15 @@ private static PolicyManager createPolicyManager() {
240240
var serverPolicy = new Policy("server", serverScopes);
241241
// agents run without a module, so this is a special hack for the apm agent
242242
// this should be removed once https://github.com/elastic/elasticsearch/issues/109335 is completed
243-
List<Entitlement> agentEntitlements = List.of(new CreateClassLoaderEntitlement(), new ManageThreadsEntitlement());
243+
List<Entitlement> agentEntitlements = List.of(
244+
new CreateClassLoaderEntitlement(),
245+
new ManageThreadsEntitlement(),
246+
new FilesEntitlement(
247+
List.of(
248+
FileData.ofPath(Path.of("/co/elastic/apm/agent/"), READ),
249+
FileData.ofPath(Path.of("/agent/co/elastic/apm/agent/"), READ)
250+
)
251+
));
244252
var resolver = EntitlementBootstrap.bootstrapArgs().pluginResolver();
245253
return new PolicyManager(
246254
serverPolicy,

0 commit comments

Comments
 (0)