@@ -152,8 +152,8 @@ private static PolicyManager createPolicyManager() {
152152 new CreateClassLoaderEntitlement (),
153153 new FilesEntitlement (
154154 List .of (
155- FileData .ofPath (bootstrapArgs .repoDirResolver ().apply ("" ), READ_WRITE , false ),
156- FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE , false )
155+ FileData .ofPath (bootstrapArgs .repoDirResolver ().apply ("" ), READ_WRITE ),
156+ FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE )
157157 )
158158 )
159159 )
@@ -172,29 +172,29 @@ private static PolicyManager createPolicyManager() {
172172 new FilesEntitlement (
173173 List .of (
174174 // Base ES directories
175- FileData .ofPath (bootstrapArgs .tempDir (), READ_WRITE , false ),
176- FileData .ofPath (bootstrapArgs .configDir (), READ , false ),
177- FileData .ofPath (bootstrapArgs .logsDir (), READ_WRITE , false ),
178- FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE , false ),
179- FileData .ofPath (bootstrapArgs .repoDirResolver ().apply ("" ), READ_WRITE , false ),
175+ FileData .ofPath (bootstrapArgs .tempDir (), READ_WRITE ),
176+ FileData .ofPath (bootstrapArgs .configDir (), READ ),
177+ FileData .ofPath (bootstrapArgs .logsDir (), READ_WRITE ),
178+ FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE ),
179+ FileData .ofPath (bootstrapArgs .repoDirResolver ().apply ("" ), READ_WRITE ),
180180
181181 // OS release on Linux
182- FileData .ofPath (Path .of ("/etc/os-release" ), READ , false ),
183- FileData .ofPath (Path .of ("/etc/system-release" ), READ , false ),
184- FileData .ofPath (Path .of ("/usr/lib/os-release" ), READ , false ),
182+ FileData .ofPath (Path .of ("/etc/os-release" ), READ ),
183+ FileData .ofPath (Path .of ("/etc/system-release" ), READ ),
184+ FileData .ofPath (Path .of ("/usr/lib/os-release" ), READ ),
185185 // read max virtual memory areas
186- FileData .ofPath (Path .of ("/proc/sys/vm/max_map_count" ), READ , false ),
187- FileData .ofPath (Path .of ("/proc/meminfo" ), READ , false ),
186+ FileData .ofPath (Path .of ("/proc/sys/vm/max_map_count" ), READ ),
187+ FileData .ofPath (Path .of ("/proc/meminfo" ), READ ),
188188 // load averages on Linux
189- FileData .ofPath (Path .of ("/proc/loadavg" ), READ , false ),
189+ FileData .ofPath (Path .of ("/proc/loadavg" ), READ ),
190190 // control group stats on Linux. cgroup v2 stats are in an unpredicable
191191 // location under `/sys/fs/cgroup`, so unfortunately we have to allow
192192 // read access to the entire directory hierarchy.
193- FileData .ofPath (Path .of ("/proc/self/cgroup" ), READ , false ),
194- FileData .ofPath (Path .of ("/sys/fs/cgroup/" ), READ , false ),
193+ FileData .ofPath (Path .of ("/proc/self/cgroup" ), READ ),
194+ FileData .ofPath (Path .of ("/sys/fs/cgroup/" ), READ ),
195195 // // io stats on Linux
196- FileData .ofPath (Path .of ("/proc/self/mountinfo" ), READ , false ),
197- FileData .ofPath (Path .of ("/proc/diskstats" ), READ , false )
196+ FileData .ofPath (Path .of ("/proc/self/mountinfo" ), READ ),
197+ FileData .ofPath (Path .of ("/proc/diskstats" ), READ )
198198 )
199199 )
200200 )
@@ -208,25 +208,23 @@ private static PolicyManager createPolicyManager() {
208208 new ManageThreadsEntitlement (),
209209 new FilesEntitlement (
210210 List .of (
211- FileData .ofPath (bootstrapArgs .configDir (), READ , false ),
212- FileData .ofPath (bootstrapArgs .tempDir (), READ , false ),
213- FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE , false )
211+ FileData .ofPath (bootstrapArgs .configDir (), READ ),
212+ FileData .ofPath (bootstrapArgs .tempDir (), READ ),
213+ FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE )
214214 )
215215 )
216216 )
217217 ),
218218 new Scope (
219219 "org.apache.lucene.misc" ,
220- List .of (
221- new FilesEntitlement (List .of (FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE , false )))
222- )
220+ List .of (new FilesEntitlement (List .of (FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE ))))
223221 ),
224222 new Scope ("org.apache.logging.log4j.core" , List .of (new ManageThreadsEntitlement ())),
225223 new Scope (
226224 "org.elasticsearch.nativeaccess" ,
227225 List .of (
228226 new LoadNativeLibrariesEntitlement (),
229- new FilesEntitlement (List .of (FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE , false )))
227+ new FilesEntitlement (List .of (FileData .ofRelativePath (Path .of ("" ), FilesEntitlement .BaseDir .DATA , READ_WRITE )))
230228 )
231229 )
232230 );
@@ -235,17 +233,11 @@ private static PolicyManager createPolicyManager() {
235233 if (trustStorePath != null ) {
236234 Collections .addAll (
237235 serverScopes ,
238- new Scope (
239- "org.bouncycastle.fips.tls" ,
240- List .of (new FilesEntitlement (List .of (FileData .ofPath (trustStorePath , READ , false ))))
241- ),
236+ new Scope ("org.bouncycastle.fips.tls" , List .of (new FilesEntitlement (List .of (FileData .ofPath (trustStorePath , READ ))))),
242237 new Scope (
243238 "org.bouncycastle.fips.core" ,
244239 // read to lib dir is required for checksum validation
245- List .of (
246- new FilesEntitlement (List .of (FileData .ofPath (bootstrapArgs .libDir (), READ , false ))),
247- new ManageThreadsEntitlement ()
248- )
240+ List .of (new FilesEntitlement (List .of (FileData .ofPath (bootstrapArgs .libDir (), READ ))), new ManageThreadsEntitlement ())
249241 )
250242 );
251243 }
@@ -259,8 +251,8 @@ private static PolicyManager createPolicyManager() {
259251 new ManageThreadsEntitlement (),
260252 new FilesEntitlement (
261253 List .of (
262- FileData .ofPath (Path .of ("/co/elastic/apm/agent/" ), READ , false ),
263- FileData .ofPath (Path .of ("/agent/co/elastic/apm/agent/" ), READ , false )
254+ FileData .ofPath (Path .of ("/co/elastic/apm/agent/" ), READ ),
255+ FileData .ofPath (Path .of ("/agent/co/elastic/apm/agent/" ), READ )
264256 )
265257 )
266258 );
0 commit comments