Skip to content

Commit a407e99

Browse files
committed
instrument JarURLConnection
1 parent 6579182 commit a407e99

File tree

6 files changed

+214
-122
lines changed

6 files changed

+214
-122
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,34 @@ void checkPathRegister(
10821082

10831083
void check$sun_net_www_protocol_file_FileURLConnection$getInputStream(Class<?> callerClass, java.net.URLConnection that);
10841084

1085+
void check$java_net_JarURLConnection$getManifest(Class<?> callerClass, java.net.JarURLConnection that);
1086+
1087+
void check$java_net_JarURLConnection$getJarEntry(Class<?> callerClass, java.net.JarURLConnection that);
1088+
1089+
void check$java_net_JarURLConnection$getAttributes(Class<?> callerClass, java.net.JarURLConnection that);
1090+
1091+
void check$java_net_JarURLConnection$getMainAttributes(Class<?> callerClass, java.net.JarURLConnection that);
1092+
1093+
void check$java_net_JarURLConnection$getCertificates(Class<?> callerClass, java.net.JarURLConnection that);
1094+
1095+
void check$sun_net_www_protocol_jar_JarURLConnection$getJarFile(Class<?> callerClass, java.net.JarURLConnection that);
1096+
1097+
void check$sun_net_www_protocol_jar_JarURLConnection$getJarEntry(Class<?> callerClass, java.net.JarURLConnection that);
1098+
1099+
void check$sun_net_www_protocol_jar_JarURLConnection$connect(Class<?> callerClass, java.net.JarURLConnection that);
1100+
1101+
void check$sun_net_www_protocol_jar_JarURLConnection$getInputStream(Class<?> callerClass, java.net.JarURLConnection that);
1102+
1103+
void check$sun_net_www_protocol_jar_JarURLConnection$getContentLength(Class<?> callerClass, java.net.JarURLConnection that);
1104+
1105+
void check$sun_net_www_protocol_jar_JarURLConnection$getContentLengthLong(Class<?> callerClass, java.net.JarURLConnection that);
1106+
1107+
void check$sun_net_www_protocol_jar_JarURLConnection$getContent(Class<?> callerClass, java.net.JarURLConnection that);
1108+
1109+
void check$sun_net_www_protocol_jar_JarURLConnection$getContentType(Class<?> callerClass, java.net.JarURLConnection that);
1110+
1111+
void check$sun_net_www_protocol_jar_JarURLConnection$getHeaderField(Class<?> callerClass, java.net.JarURLConnection that, String name);
1112+
10851113
////////////////////
10861114
//
10871115
// Thread management

libs/entitlement/src/main/java/org/elasticsearch/entitlement/bootstrap/EntitlementBootstrap.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public record BootstrapArgs(
4040
Path[] sharedRepoDirs,
4141
Path configDir,
4242
Path libDir,
43+
Path modulesDir,
4344
Path pluginsDir,
4445
Path logsDir,
4546
Path tempDir,
@@ -57,6 +58,7 @@ public record BootstrapArgs(
5758
requireNonNull(sharedRepoDirs);
5859
requireNonNull(configDir);
5960
requireNonNull(libDir);
61+
requireNonNull(modulesDir);
6062
requireNonNull(pluginsDir);
6163
requireNonNull(logsDir);
6264
requireNonNull(tempDir);
@@ -81,6 +83,7 @@ public static BootstrapArgs bootstrapArgs() {
8183
* @param sharedRepoDirs shared repository directories for Elasticsearch
8284
* @param configDir the config directory for Elasticsearch
8385
* @param libDir the lib directory for Elasticsearch
86+
* @param modulesDir the directory where Elasticsearch modules are
8487
* @param pluginsDir the directory where plugins are installed for Elasticsearch
8588
* @param tempDir the temp directory for Elasticsearch
8689
* @param logsDir the log directory for Elasticsearch
@@ -95,6 +98,7 @@ public static void bootstrap(
9598
Path[] sharedRepoDirs,
9699
Path configDir,
97100
Path libDir,
101+
Path modulesDir,
98102
Path pluginsDir,
99103
Path logsDir,
100104
Path tempDir,
@@ -113,6 +117,7 @@ public static void bootstrap(
113117
sharedRepoDirs,
114118
configDir,
115119
libDir,
120+
modulesDir,
116121
pluginsDir,
117122
logsDir,
118123
tempDir,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ private static PolicyManager createPolicyManager() {
153153
serverModuleFileDatas,
154154
// Base ES directories
155155
FileData.ofPath(bootstrapArgs.pluginsDir(), READ),
156+
FileData.ofPath(bootstrapArgs.modulesDir(), READ),
156157
FileData.ofPath(bootstrapArgs.configDir(), READ),
157158
FileData.ofPath(bootstrapArgs.logsDir(), READ_WRITE),
159+
FileData.ofPath(bootstrapArgs.libDir(), READ),
158160
FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE),
159161
FileData.ofRelativePath(Path.of(""), SHARED_REPO, READ_WRITE),
160162

0 commit comments

Comments
 (0)