Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -59,6 +59,7 @@
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ;
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ_WRITE;

/**
Expand Down Expand Up @@ -149,8 +150,26 @@ private static PolicyManager createPolicyManager() {
new ManageThreadsEntitlement(),
new FilesEntitlement(
List.of(
FilesEntitlement.FileData.ofPath(EntitlementBootstrap.bootstrapArgs().tempDir(), READ_WRITE),
FilesEntitlement.FileData.ofPath(EntitlementBootstrap.bootstrapArgs().logsDir(), READ_WRITE)
FileData.ofPath(bootstrapArgs.tempDir(), READ_WRITE),
FileData.ofPath(bootstrapArgs.logsDir(), READ_WRITE),
// OS release on Linux
FileData.ofPath(Path.of("/etc/os-release"), READ),
FileData.ofPath(Path.of("/etc/system-release"), READ),
FileData.ofPath(Path.of("/usr/lib/os-release"), READ),
// read max virtual memory areas
FileData.ofPath(Path.of("/proc/sys/vm/max_map_count"), READ),
FileData.ofPath(Path.of("/proc/meminfo"), READ),
// load averages on Linux
FileData.ofPath(Path.of("/proc/loadavg"), READ),
// control group stats on Linux. cgroup v2 stats are in an unpredicable
// location under `/sys/fs/cgroup`, so unfortunately we have to allow
// read access to the entire directory hierarchy.
FileData.ofPath(Path.of("/proc/self/cgroup"), READ),
FileData.ofPath(Path.of("/sys/fs/cgroup/"), READ),
// // io stats on Linux
FileData.ofPath(Path.of("/proc/self/mountinfo"), READ),
FileData.ofPath(Path.of("/proc/diskstats"), READ),
FileData.ofPath(Path.of("/etc/os-release"), READ)
)
)
)
Expand Down
8 changes: 0 additions & 8 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,6 @@ tests:
- class: org.elasticsearch.entitlement.runtime.policy.PolicyParserFailureTests
method: testEntitlementAbsolutePathWhenRelative
issue: https://github.com/elastic/elasticsearch/issues/122666
- class: org.elasticsearch.entitlement.qa.EntitlementsAllowedNonModularIT
issue: https://github.com/elastic/elasticsearch/issues/122568
- class: org.elasticsearch.entitlement.qa.EntitlementsDeniedIT
issue: https://github.com/elastic/elasticsearch/issues/122566
- class: org.elasticsearch.entitlement.qa.EntitlementsDeniedNonModularIT
issue: https://github.com/elastic/elasticsearch/issues/122569
- class: org.elasticsearch.entitlement.qa.EntitlementsAllowedIT
issue: https://github.com/elastic/elasticsearch/issues/122680
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
method: test {yaml=reference/snapshot-restore/apis/get-snapshot-api/line_408}
issue: https://github.com/elastic/elasticsearch/issues/122681
Expand Down