Skip to content

Commit 372b8a1

Browse files
committed
[Entitlements] Add missing entitlements for trust store
1 parent 67dc199 commit 372b8a1

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import java.util.HashMap;
5757
import java.util.List;
5858
import java.util.Map;
59+
import java.util.Optional;
5960
import java.util.Set;
6061
import java.util.concurrent.ExecutorService;
6162
import java.util.function.Function;
@@ -204,6 +205,12 @@ private static PolicyManager createPolicyManager() {
204205
new LoadNativeLibrariesEntitlement(),
205206
new FilesEntitlement(List.of(FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE)))
206207
)
208+
),
209+
new Scope(
210+
"org.bouncycastle.fips.tls",
211+
List.of(
212+
new FilesEntitlement(Optional.ofNullable(trustStorePath()).stream().map(ts -> FileData.ofPath(ts, READ)).toList())
213+
)
207214
)
208215
)
209216
);
@@ -230,6 +237,11 @@ private static Path getUserHome() {
230237
return PathUtils.get(userHome);
231238
}
232239

240+
private static Path trustStorePath() {
241+
String trustStore = System.getProperty("javax.net.ssl.trustStore");
242+
return trustStore != null ? Path.of(trustStore) : null;
243+
}
244+
233245
private static Stream<InstrumentationService.InstrumentationInfo> fileSystemProviderChecks() throws ClassNotFoundException,
234246
NoSuchMethodException {
235247
var fileSystemProviderClass = FileSystems.getDefault().provider().getClass();

muted-tests.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ tests:
312312
issue: https://github.com/elastic/elasticsearch/issues/122377
313313
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.HdfsRepositoryAnalysisRestIT
314314
issue: https://github.com/elastic/elasticsearch/issues/122378
315-
- class: org.elasticsearch.telemetry.apm.ApmAgentSettingsIT
316-
issue: https://github.com/elastic/elasticsearch/issues/122546
317315
- class: org.elasticsearch.xpack.inference.mapper.SemanticInferenceMetadataFieldsRecoveryTests
318316
method: testSnapshotRecovery {p0=false p1=false}
319317
issue: https://github.com/elastic/elasticsearch/issues/122549
@@ -398,14 +396,6 @@ tests:
398396
- class: org.elasticsearch.indices.recovery.IndexRecoveryIT
399397
method: testSourceThrottling
400398
issue: https://github.com/elastic/elasticsearch/issues/122712
401-
- class: org.elasticsearch.entitlement.qa.EntitlementsDeniedNonModularIT
402-
issue: https://github.com/elastic/elasticsearch/issues/122569
403-
- class: org.elasticsearch.entitlement.qa.EntitlementsAllowedNonModularIT
404-
issue: https://github.com/elastic/elasticsearch/issues/122568
405-
- class: org.elasticsearch.entitlement.qa.EntitlementsAllowedIT
406-
issue: https://github.com/elastic/elasticsearch/issues/122680
407-
- class: org.elasticsearch.entitlement.qa.EntitlementsDeniedIT
408-
issue: https://github.com/elastic/elasticsearch/issues/122566
409399

410400
# Examples:
411401
#

0 commit comments

Comments
 (0)