Skip to content

Commit c2a626c

Browse files
committed
Plugins policies
1 parent 883bbe3 commit c2a626c

File tree

7 files changed

+57
-1
lines changed

7 files changed

+57
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,16 @@ private static PolicyManager createPolicyManager() {
138138
var serverPolicy = new Policy(
139139
"server",
140140
List.of(
141-
new Scope("org.elasticsearch.base", List.of(new CreateClassLoaderEntitlement())),
141+
new Scope("org.elasticsearch.base",
142+
List.of(
143+
new CreateClassLoaderEntitlement(),
144+
new FilesEntitlement(
145+
List.of(
146+
FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE)
147+
)
148+
)
149+
)
150+
),
142151
new Scope("org.elasticsearch.xcontent", List.of(new CreateClassLoaderEntitlement())),
143152
new Scope(
144153
"org.elasticsearch.server",
@@ -175,6 +184,8 @@ private static PolicyManager createPolicyManager() {
175184
// // io stats on Linux
176185
FileData.ofPath(Path.of("/proc/self/mountinfo"), READ),
177186
FileData.ofPath(Path.of("/proc/diskstats"), READ)
187+
188+
//TODO: use FileData.ofPathSetting("repositories.fs.location", READ_WRITE)
178189
)
179190
)
180191
)
@@ -189,6 +200,17 @@ private static PolicyManager createPolicyManager() {
189200
new FilesEntitlement(
190201
List.of(
191202
FileData.ofPath(bootstrapArgs.configDir(), READ),
203+
FileData.ofPath(bootstrapArgs.tempDir(), READ),
204+
FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE)
205+
)
206+
)
207+
)
208+
),
209+
new Scope(
210+
"org.apache.lucene.misc",
211+
List.of(
212+
new FilesEntitlement(
213+
List.of(
192214
FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE)
193215
)
194216
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
org.elasticsearch.ingest.geoip:
2+
- files:
3+
- relative_path: "ingest-geoip"
4+
relative_to: config
5+
mode: read
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
org.elasticsearch.ingest.useragent:
2+
- files:
3+
- relative_path: ingest-user-agent
4+
relative_to: config
5+
mode: read
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
org.elasticsearch.blobcache:
2+
- files:
3+
- relative_path: ""
4+
relative_to: data
5+
mode: read_write

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
org.elasticsearch.xcore:
2+
- files:
3+
- relative_path: ""
4+
relative_to: config
5+
mode: read
6+
org.elasticsearch.sslconfig:
7+
- files:
8+
- relative_path: ""
9+
relative_to: config
10+
mode: read
111
org.apache.httpcomponents.httpclient:
212
- outbound_network # For SamlRealm
313
- manage_threads
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
org.elasticsearch.searchablesnapshots:
2+
- files:
3+
- relative_path: snapshot_cache
4+
relative_to: data
5+
mode: read_write

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
org.elasticsearch.security:
22
- set_https_connection_properties # for CommandLineHttpClient
3+
- files:
4+
- relative_path: ""
5+
relative_to: config
6+
mode: read
37
io.netty.transport:
48
- manage_threads
59
- inbound_network

0 commit comments

Comments
 (0)