Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
new CreateClassLoaderEntitlement(),
new FilesEntitlement(
List.of(
// TODO: what in es.base is accessing shared repo?
// necessary due to lack of delegation ES-12382
FilesEntitlement.FileData.ofBaseDirPath(SHARED_REPO, READ_WRITE),
FilesEntitlement.FileData.ofBaseDirPath(SHARED_DATA, READ_WRITE),
FilesEntitlement.FileData.ofBaseDirPath(DATA, READ_WRITE)
)
)
Expand Down Expand Up @@ -122,6 +123,7 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
new FilesEntitlement(
List.of(
FilesEntitlement.FileData.ofBaseDirPath(CONFIG, READ),
FilesEntitlement.FileData.ofBaseDirPath(SHARED_DATA, READ_WRITE),
FilesEntitlement.FileData.ofBaseDirPath(DATA, READ_WRITE)
)
)
Expand All @@ -130,7 +132,12 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
new Scope(
"org.apache.lucene.misc",
List.of(
new FilesEntitlement(List.of(FilesEntitlement.FileData.ofBaseDirPath(DATA, READ_WRITE))),
new FilesEntitlement(
List.of(
FilesEntitlement.FileData.ofBaseDirPath(SHARED_DATA, READ_WRITE),
FilesEntitlement.FileData.ofBaseDirPath(DATA, READ_WRITE)
)
),
new ReadStoreAttributesEntitlement()
)
),
Expand All @@ -145,7 +152,12 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
"org.elasticsearch.nativeaccess",
List.of(
new LoadNativeLibrariesEntitlement(),
new FilesEntitlement(List.of(FilesEntitlement.FileData.ofBaseDirPath(DATA, READ_WRITE)))
new FilesEntitlement(
List.of(
FilesEntitlement.FileData.ofBaseDirPath(SHARED_DATA, READ_WRITE),
FilesEntitlement.FileData.ofBaseDirPath(DATA, READ_WRITE)
)
)
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ private static BaseDir parseBaseDir(String baseDir) {
case "config" -> BaseDir.CONFIG;
case "data" -> BaseDir.DATA;
case "home" -> BaseDir.USER_HOME;
case "shared_data" -> BaseDir.SHARED_DATA;
// it would be nice to limit this to just ES modules, but we don't have a way to plumb that through to here
// however, we still don't document in the error case below that shared_repo is valid
// however, we still don't document in the error case below that shared_repo and shared_data is valid
case "shared_repo" -> BaseDir.SHARED_REPO;
default -> throw new PolicyValidationException(
"invalid relative directory: " + baseDir + ", valid values: [config, data, home]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ ALL-UNNAMED:
- relative_path: "indices/"
relative_to: data
mode: read_write
- relative_path: ""
relative_to: shared_data
mode: read_write
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ org.elasticsearch.searchablesnapshots:
- relative_path: indices
relative_to: data
mode: read_write
- relative_path: ""
relative_to: shared_data
mode: read_write