Skip to content

Commit 211a372

Browse files
committed
First pass at entitlement policy review
1 parent 79c388a commit 211a372

File tree

6 files changed

+17
-0
lines changed

6 files changed

+17
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
grant {
2+
// PD: Doesn't actually appear to use this. Contains no callers to anything that calls checkSetFactory
23
permission java.lang.RuntimePermission "setFactory";
34

45
// ApacheXMLSecurityInitializer
6+
// PD: Done
57
permission java.util.PropertyPermission "org.apache.xml.security.ignoreLineBreaks", "read,write";
8+
// PD: Dup!
69
permission java.security.SecurityPermission "org.apache.xml.security.register";
710

11+
// PD: TODO Not sure how to check this one
812
// needed during initialization of OpenSAML library where xml security algorithms are registered
913
// see https://github.com/apache/santuario-java/blob/e79f1fe4192de73a975bc7246aee58ed0703343d/src/main/java/org/apache/xml/security/utils/JavaUtils.java#L205-L220
1014
// and https://git.shibboleth.net/view/?p=java-opensaml.git;a=blob;f=opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/signature/impl/SignatureMarshaller.java;hb=db0eaa64210f0e32d359cd6c57bedd57902bf811#l52
1115
// which uses it in the opensaml-xmlsec-impl
1216
permission java.security.SecurityPermission "org.apache.xml.security.register";
1317

1418
// needed for multiple server implementations used in tests
19+
// PD: TODO: Why aren't tests failing?
1520
permission java.net.SocketPermission "*", "accept,connect";
1621
};

x-pack/plugin/inference/src/main/plugin-metadata/plugin-security.policy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,29 @@
88
grant {
99
// required by: com.google.api.client.json.JsonParser#parseValue
1010
// also required by AWS SDK for client configuration
11+
// PD: Always granted
1112
permission java.lang.RuntimePermission "accessDeclaredMembers";
13+
// PD: Always granted
1214
permission java.lang.RuntimePermission "getClassLoader";
1315

1416
// required by: com.google.api.client.json.GenericJson#<init>
1517
// also by AWS SDK for Jackson's ObjectMapper
18+
// PD: TODO: What entitlement does this map to?
1619
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
1720

1821
// required to add google certs to the gcs client trustore
22+
// PD: Done
1923
permission java.lang.RuntimePermission "setFactory";
2024

2125
// gcs client opens socket connections for to access repository
2226
// also, AWS Bedrock client opens socket connections and needs resolve for to access to resources
27+
// PD: TODO Add outgoing network
2328
permission java.net.SocketPermission "*", "connect,resolve";
2429

2530
// AWS Clients always try to access the credentials and config files, even if we configure otherwise
31+
// PD: TODO Add these
2632
permission java.io.FilePermission "${user.home}/.aws/credentials", "read";
2733
permission java.io.FilePermission "${user.home}/.aws/config", "read";
34+
// PD: Always granted
2835
permission java.util.PropertyPermission "http.proxyHost", "read";
2936
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
grant {
22
// needed for multiple server implementations used in tests
3+
// PD: TODO: Why aren't tests failing?
34
permission java.net.SocketPermission "*", "accept,connect";
45
};

x-pack/plugin/ml-package-loader/src/main/plugin-metadata/plugin-security.policy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
*/
77

88
grant {
9+
// PD: TODO outgoing network?
910
permission java.net.SocketPermission "*", "connect";
1011
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Needed for painless script to run
22
grant {
33
// needed to create the classloader which allows plugins to extend other plugins
4+
// PD: We think this isn't doing anything. https://elastic.slack.com/archives/C07HQL9TNP6/p1740683230530729?thread_ts=1740683097.110529&cid=C07HQL9TNP6
45
permission java.lang.RuntimePermission "createClassLoader";
56
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
grant {
22
// needed for Windows named pipes in machine learning
3+
// PD: Done
34
permission java.io.FilePermission "\\\\.\\pipe\\*", "read,write";
45

56
// needed for ojalgo linear programming solver
7+
// PD: Always granted
68
permission java.lang.RuntimePermission "accessDeclaredMembers";
79
};

0 commit comments

Comments
 (0)