[JBoss JIRA] (WFLY-9059) Many org.jboss.as.test.integration.ejb.security.**.* tests fail with security manager
by Chao Wang (JIRA)
[ https://issues.jboss.org/browse/WFLY-9059?page=com.atlassian.jira.plugin.... ]
Chao Wang reassigned WFLY-9059:
-------------------------------
Assignee: Chao Wang
> Many org.jboss.as.test.integration.ejb.security.**.* tests fail with security manager
> -------------------------------------------------------------------------------------
>
> Key: WFLY-9059
> URL: https://issues.jboss.org/browse/WFLY-9059
> Project: WildFly
> Issue Type: Bug
> Components: Test Suite
> Affects Versions: 11.0.0.Beta1
> Reporter: Ondrej Kotek
> Assignee: Chao Wang
> Labels: security-manager
>
> Many tests in {{org.jboss.as.test.integration.ejb.security}} package and subpackages fail or result in error with missing permission "("org.wildfly.security.permission.ElytronPermission" "getSecurityDomain")", e.g.:
> {noformat}
> java.security.AccessControlException: WFSM000001: Permission check failed (permission "("org.wildfly.security.permission.ElytronPermission" "getSecurityDomain")" in code source "(vfs:/content/ejb3-security-partial-dd-test.jar <no signer certificates>)" of "ModuleClassLoader for Module "deployment.ejb3-security-partial-dd-test.jar" from Service Module Loader")
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:278)
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175)
> at org.wildfly.security.auth.server.SecurityDomain.getCurrent(SecurityDomain.java:155)
> ...
> {noformat}
> Following test cases are affected:
> * {{AnnotationAuthorizationTestCase}}
> * {{EJBInWarDefaultSecurityDomainTestCase}}
> * {{LifecycleTestCase}}
> * {{MixedSecurityAnnotationAuthorizationTestCase}}
> * {{RunAsPrincipalTestCase}}
> * {{SecurityDDOverrideTestCase}}
> * {{asynchronous.AsynchronousSecurityTestCase}}
> * {{callerprincipal.GetCallerPrincipalTestCase}}
> * {{missingmethodpermission.*}}
> ** require also {{RuntimePermission("getClassLoader")}} and {{RuntimePermission("setContextClassLoader")}} permissions
> * {{rolelink.SecurityRoleLinkTestCase}}
> * {{runas.RunAsTestCase}}
> * {{singleton.SingletonSecurityTestCase}}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (WFLY-9060) ServletUnitTestCase fails with security manager
by Chao Wang (JIRA)
[ https://issues.jboss.org/browse/WFLY-9060?page=com.atlassian.jira.plugin.... ]
Chao Wang reassigned WFLY-9060:
-------------------------------
Assignee: Chao Wang
> ServletUnitTestCase fails with security manager
> -----------------------------------------------
>
> Key: WFLY-9060
> URL: https://issues.jboss.org/browse/WFLY-9060
> Project: WildFly
> Issue Type: Bug
> Components: Test Suite
> Affects Versions: 11.0.0.Beta1
> Reporter: Ondrej Kotek
> Assignee: Chao Wang
> Labels: security-manager
>
> {{ServletUnitTestCase}} fails with security manager because of missing permission "("org.wildfly.security.permission.ElytronPermission" "getSecurityDomain")":
> {noformat}
> javax.servlet.ServletException: Failed to call EJBs/Session30 through remote and local interfaces
> at org.jboss.as.test.integration.ejb.servlet.EJBServlet.processRequest(EJBServlet.java:73)
> at org.jboss.as.test.integration.ejb.servlet.EJBServlet.doGet(EJBServlet.java:82)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> ...
> Caused by: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("org.wildfly.security.permission.ElytronPermission" "getSecurityDomain")" in code source "(vfs:/content/ejb3-servlet.war/WEB-INF/classes <no signer certificates>)" of "ModuleClassLoader for Module "deployment.ejb3-servlet.war" from Service Module Loader")
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:278)
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175)
> at org.wildfly.security.auth.server.SecurityDomain.getCurrent(SecurityDomain.java:155)
> ...
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (DROOLS-1654) Don'ing a Map-Based Fact Loses the Fact
by KimJohn Quinn (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1654?page=com.atlassian.jira.plugi... ]
KimJohn Quinn commented on DROOLS-1654:
---------------------------------------
All right, I am pretty much about to toss in the towel with this.
_I've attached a zip of my latest test case as well as all the corresponding DRL files (latest-with-traits.zip). _
Either I am doing something drastically wrong or this is potentially a bug with traits when applied to maps or map-based objects.
All I want to do is use a 'trait' to create strongly-type facts against a map-based model. The map-based model is a large bucket of key-value pairs but using traits would give me the ability to create some structure/hierarchy that can be used in the rules rather than trying to constrain against a bunch of map properties directly. My approach was to use the model itself to "prep" or "populate" values initially and then don one to many traits against that model for later use.
What I am tending to see, using your own example or mine is the following:
* Using a type that 'extends' map does not seem to work - I lose that type after the don is performed.
* Using a map directly gets me closer but there are multiple map facts in WM after the don is performed.
* Using a pure type works fine.
* Using a wrapper gives me the same results as #2.
In all cases that do work, the resulting trait is updating the backed model fact as well. In fact, my test cases would pass because the expected 'bmi' result was correct. It was not until I started to apply rules after the don that I realized the problems.
-----------------------------
Here are the latest results of my outputs from each of the tests:
*1. Using the TraitMapCoreTest from Drools: I see multiple Maps in WM after running. Also, until I constrained the 'Don' rule, it fired multiple times but there was only one PersonMap trait in WM - I would of thought that there would be multiple traits in WM from that.*
{quote}Donned
(@org.drools.traits.test.PersonMap.org.drools.core.factmodel.MapCore_Proxy) : [name=john, age=18, height=null]
(@org.drools.traits.test.PersonMap.org.drools.core.factmodel.MapCore_Proxy) : [name=john, height=184.0, age=18]
Model: 2
Trait: 1
Model: MapCore{__$$dynamic_properties_map$$={name=john, age=18, height=184.0}}
Model: MapCore{__$$dynamic_properties_map$$={name=john, age=18, height=184.0}}{quote}
*2. Don'ing a strongly-typed class (with getters/setters) - this is the only example I can get to work as I would expect.*
{quote}Rule 1
Rule 2A: 1.0 (before don)
Rule 2B: 1.0 (after don)
Rule 2C: 1.0
Rule 3: 1.0
Rule 4A: 2.0
Rule 4B: 1.0
Rule 5: 3.0
Model: 1
Trait: 1{quote}
*3. Don'ing with a pure Map. Similar to #1, I see multiple maps in WM after the don. The end result is correct but the multiple maps, which are the same value, worry me for later rules.*
{quote}Rule 1
Rule 2A: 1.0 (before don)
Rule 2B: 1.0 (after don)
Rule 2C: 1.0
Rule 2D: 1
Rule 3: 1.0
Rule 3A: 2
Rule 4A: 2.0
Rule 4B: 1.0
Rule 4A: 2.0
Rule 4B: 1.0
Rule 5: 3.0
Rule 3: 1.0
Rule 3A: 2
Rule 4A: 2.0
Rule 4B: 1.0
Model: 2
Trait: 1
Model: MapCore{__$$dynamic_properties_map$$={weight=1.0, height=2.0, bmi=3.0}}
Model: MapCore{__$$dynamic_properties_map$$={weight=1.0, height=2.0, bmi=3.0}}{quote}
*4. Don'ing using a type that extends Map. This is really the scenario I am shooting for and what started this. The model that I am don'ing against disappears after the don rule and not of the rules after fire because the constraints are not being met.*
{quote}Rule 1
Rule 2A: 1.0 (before don)
Rule 2B: 1.0 (after don)
Rule 2C: 1.0
Rule 3A: 1.0
Rule 3B: (@drools.MyTrait.org.drools.core.factmodel.MapCore_Proxy) : [weight=1.0, height=2.0, bmi=null]
Model: 0
Trait: 1 {quote}
*5. Don'ing using a wrapper which contains the model inside. This gets me close, albeit a lot more effort, but demonstrates the same results. I lose my actual model during the process and eventually need to fall back to getting the model out of the wrapper, even though I insert it from the wrapper early on, to use it. This all happens after performing the don.*
{quote}Rule 0 : {weight=1.0}
Rule 1 : {weight=1.0, height=2.0}
Rule 2A: {weight=1.0, height=2.0} (before don)
Rule 2B: {weight=1.0, height=2.0, bmi=null} (after don)
Rule 2C: (@drools.MyTrait.org.drools.core.factmodel.MapCore_Proxy) : [weight=1.0, height=2.0, bmi=null]
Rule 3 : (@drools.MyTrait.org.drools.core.factmodel.MapCore_Proxy) : [weight=1.0, height=2.0, bmi=null]
Rule 4 : {weight=1.0, height=2.0, bmi=null}
Rule 5 : {weight=1.0, height=2.0, bmi=3.0}
Wrapper: 1
Model : 0
Map : 2
Trait : 1 {quote}
> Don'ing a Map-Based Fact Loses the Fact
> ---------------------------------------
>
> Key: DROOLS-1654
> URL: https://issues.jboss.org/browse/DROOLS-1654
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * Alpine Linux (in a Docker container)
> * Oracle JDK 8
> * Drools 7.0.0.Final
> * Spring Boot v1.5.4.RELEASE (though testing without any Spring)
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Labels: traits
> Attachments: TraitDonningTest.java, latest-with-traits.zip, traits-with-class.drl, traits-with-maps.drl, traits-with-model.drl, traits.drl
>
>
> It appears that after don'ing the trait the map-based fact it is proxying disappears (or gets retracted).
> There does not seem to be any issue using the trait properties to access the model properties.
> We are trying to use the model, mostly for constraints and updates, then within the rules apply and use traits to give us a stronger-typed fact and easier rule constraining.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (DROOLS-1654) Don'ing a Map-Based Fact Loses the Fact
by KimJohn Quinn (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1654?page=com.atlassian.jira.plugi... ]
KimJohn Quinn updated DROOLS-1654:
----------------------------------
Attachment: latest-with-traits.zip
> Don'ing a Map-Based Fact Loses the Fact
> ---------------------------------------
>
> Key: DROOLS-1654
> URL: https://issues.jboss.org/browse/DROOLS-1654
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * Alpine Linux (in a Docker container)
> * Oracle JDK 8
> * Drools 7.0.0.Final
> * Spring Boot v1.5.4.RELEASE (though testing without any Spring)
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Labels: traits
> Attachments: TraitDonningTest.java, latest-with-traits.zip, traits-with-class.drl, traits-with-maps.drl, traits-with-model.drl, traits.drl
>
>
> It appears that after don'ing the trait the map-based fact it is proxying disappears (or gets retracted).
> There does not seem to be any issue using the trait properties to access the model properties.
> We are trying to use the model, mostly for constraints and updates, then within the rules apply and use traits to give us a stronger-typed fact and easier rule constraining.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (DROOLS-1654) Don'ing a Map-Based Fact Loses the Fact
by KimJohn Quinn (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1654?page=com.atlassian.jira.plugi... ]
KimJohn Quinn edited comment on DROOLS-1654 at 7/8/17 10:58 AM:
----------------------------------------------------------------
I've documented more details on Google Groups @ https://groups.google.com/forum/?fromgroups=#!topic/drools-usage/S27hlbLoXeM.
I have attached my latest DRL test files. The test case is relatively the same with the exception of passing in my custom map, a class, or just a HashMap directly.
It seems that if I use a HashMap directly I can make progress but after don'ing I have 2 map facts in WM vs. the 1 I would expect.
Output using a Map directly:
{quote}Rule 1
Rule 2A: 1.0 (before don)
Rule 2B: 1.0 (after don)
Rule 2C: 1.0
Rule 2D: 1
Rule 3: 1.0
Rule 3A: 2
Rule 4A: 2.0
Rule 4B: 1.0
Rule 4A: 2.0
Rule 4B: 1.0
Rule 5: 3.0
Rule 3: 1.0
Rule 3A: 2
Rule 4A: 2.0
Rule 4B: 1.0
*Model: 2*
Trait: 1{quote}
At this point, I am completely out of ideas...
was (Author: kj.quinn):
I've documented more details on Google Groups @ https://groups.google.com/forum/?fromgroups=#!topic/drools-usage/S27hlbLoXeM.
I have attached my latest DRL test files. The test case is relatively the same with the exception of passing in my custom map, a class, or just a HashMap directly.
It seems that if I use a HashMap directly I can make progress but after don'ing I have 2 map facts in WM vs. the 1 I would expect.
At this point, I am completely out of ideas...
> Don'ing a Map-Based Fact Loses the Fact
> ---------------------------------------
>
> Key: DROOLS-1654
> URL: https://issues.jboss.org/browse/DROOLS-1654
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * Alpine Linux (in a Docker container)
> * Oracle JDK 8
> * Drools 7.0.0.Final
> * Spring Boot v1.5.4.RELEASE (though testing without any Spring)
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Labels: traits
> Attachments: TraitDonningTest.java, traits-with-class.drl, traits-with-maps.drl, traits-with-model.drl, traits.drl
>
>
> It appears that after don'ing the trait the map-based fact it is proxying disappears (or gets retracted).
> There does not seem to be any issue using the trait properties to access the model properties.
> We are trying to use the model, mostly for constraints and updates, then within the rules apply and use traits to give us a stronger-typed fact and easier rule constraining.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (DROOLS-1654) Don'ing a Map-Based Fact Loses the Fact
by KimJohn Quinn (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1654?page=com.atlassian.jira.plugi... ]
KimJohn Quinn updated DROOLS-1654:
----------------------------------
Attachment: traits-with-class.drl
traits-with-maps.drl
traits-with-model.drl
> Don'ing a Map-Based Fact Loses the Fact
> ---------------------------------------
>
> Key: DROOLS-1654
> URL: https://issues.jboss.org/browse/DROOLS-1654
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * Alpine Linux (in a Docker container)
> * Oracle JDK 8
> * Drools 7.0.0.Final
> * Spring Boot v1.5.4.RELEASE (though testing without any Spring)
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Labels: traits
> Attachments: TraitDonningTest.java, traits-with-class.drl, traits-with-maps.drl, traits-with-model.drl, traits.drl
>
>
> It appears that after don'ing the trait the map-based fact it is proxying disappears (or gets retracted).
> There does not seem to be any issue using the trait properties to access the model properties.
> We are trying to use the model, mostly for constraints and updates, then within the rules apply and use traits to give us a stronger-typed fact and easier rule constraining.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (DROOLS-1654) Don'ing a Map-Based Fact Loses the Fact
by KimJohn Quinn (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1654?page=com.atlassian.jira.plugi... ]
KimJohn Quinn edited comment on DROOLS-1654 at 7/8/17 10:55 AM:
----------------------------------------------------------------
I've documented more details on Google Groups @ https://groups.google.com/forum/?fromgroups=#!topic/drools-usage/S27hlbLoXeM.
I have attached my latest DRL test files. The test case is relatively the same with the exception of passing in my custom map, a class, or just a HashMap directly.
It seems that if I use a HashMap directly I can make progress but after don'ing I have 2 map facts in WM vs. the 1 I would expect.
At this point, I am completely out of ideas...
was (Author: kj.quinn):
I've documented more details on Google Groups @ https://groups.google.com/forum/?fromgroups=#!topic/drools-usage/S27hlbLoXeM.
It seems that if I use a HashMap directly I can make progress but after don'ing I have 2 map facts in WM vs. the 1 I would expect.
At this point, I am completely out of ideas...
> Don'ing a Map-Based Fact Loses the Fact
> ---------------------------------------
>
> Key: DROOLS-1654
> URL: https://issues.jboss.org/browse/DROOLS-1654
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * Alpine Linux (in a Docker container)
> * Oracle JDK 8
> * Drools 7.0.0.Final
> * Spring Boot v1.5.4.RELEASE (though testing without any Spring)
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Labels: traits
> Attachments: TraitDonningTest.java, traits.drl
>
>
> It appears that after don'ing the trait the map-based fact it is proxying disappears (or gets retracted).
> There does not seem to be any issue using the trait properties to access the model properties.
> We are trying to use the model, mostly for constraints and updates, then within the rules apply and use traits to give us a stronger-typed fact and easier rule constraining.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (DROOLS-1654) Don'ing a Map-Based Fact Loses the Fact
by KimJohn Quinn (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1654?page=com.atlassian.jira.plugi... ]
KimJohn Quinn commented on DROOLS-1654:
---------------------------------------
I've documented more details on Google Groups @ https://groups.google.com/forum/?fromgroups=#!topic/drools-usage/S27hlbLoXeM.
It seems that if I use a HashMap directly I can make progress but after don'ing I have 2 map facts in WM vs. the 1 I would expect.
At this point, I am completely out of ideas...
> Don'ing a Map-Based Fact Loses the Fact
> ---------------------------------------
>
> Key: DROOLS-1654
> URL: https://issues.jboss.org/browse/DROOLS-1654
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * Alpine Linux (in a Docker container)
> * Oracle JDK 8
> * Drools 7.0.0.Final
> * Spring Boot v1.5.4.RELEASE (though testing without any Spring)
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Labels: traits
> Attachments: TraitDonningTest.java, traits.drl
>
>
> It appears that after don'ing the trait the map-based fact it is proxying disappears (or gets retracted).
> There does not seem to be any issue using the trait properties to access the model properties.
> We are trying to use the model, mostly for constraints and updates, then within the rules apply and use traits to give us a stronger-typed fact and easier rule constraining.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (DROOLS-1654) Don'ing a Map-Based Fact Loses the Fact
by KimJohn Quinn (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1654?page=com.atlassian.jira.plugi... ]
KimJohn Quinn commented on DROOLS-1654:
---------------------------------------
I tried a few different scenarios and it all seems to come back to the map.
*If I replace the map-based fact with a strong-typed class the output is what I would expect:*
{quote}Rule 1
Rule 2A: 1.0 (before don)
Rule 2B: 1.0 (after don)
Rule 2C: 1.0
Rule 3: 1.0
Rule 4A: 2.0
Rule 4B: 1.0
Rule 5: 3.0
Model: 1
Trait: 1{quote}
If I make that class extend HashMap, even though I have the properties in the trait, it reverts back to the non-working result set.
{quote}Rule 1
Rule 2A: 1.0 (before don)
Rule 2B: 1.0 (after don)
Rule 2C: null
Rule 3: null
Model: 0
Trait: 1{quote}
> Don'ing a Map-Based Fact Loses the Fact
> ---------------------------------------
>
> Key: DROOLS-1654
> URL: https://issues.jboss.org/browse/DROOLS-1654
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * Alpine Linux (in a Docker container)
> * Oracle JDK 8
> * Drools 7.0.0.Final
> * Spring Boot v1.5.4.RELEASE (though testing without any Spring)
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Labels: traits
> Attachments: TraitDonningTest.java, traits.drl
>
>
> It appears that after don'ing the trait the map-based fact it is proxying disappears (or gets retracted).
> There does not seem to be any issue using the trait properties to access the model properties.
> We are trying to use the model, mostly for constraints and updates, then within the rules apply and use traits to give us a stronger-typed fact and easier rule constraining.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (WFCORE-2147) Impossible to use environment variables or system properties in permissions.xml
by Adrian Boangiu (JIRA)
[ https://issues.jboss.org/browse/WFCORE-2147?page=com.atlassian.jira.plugi... ]
Adrian Boangiu commented on WFCORE-2147:
----------------------------------------
This issue is very important. How that nobody takes care about? We cannot migrate our installations from JBoss 7.1.1 to Wildfly because of this for more than one year now.
> Impossible to use environment variables or system properties in permissions.xml
> -------------------------------------------------------------------------------
>
> Key: WFCORE-2147
> URL: https://issues.jboss.org/browse/WFCORE-2147
> Project: WildFly Core
> Issue Type: Feature Request
> Components: Security
> Reporter: Adrian Boangiu
>
> Without this feature it is impossible to migrate "variable" Java file permissions such as:
> {noformat}
> permission java.io.FilePermission "${java.io.tmpdir}","read";
> permission java.io.FilePermission "${jboss.home.dir}${/}bin${/}javamelody${/}-","read,write,delete";
> permission java.io.FilePermission "${app.home.dir}${/}log${/}-","read,write,delete";
> {noformat}
> that were defined in Java policy file in previous verions of JBoss.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months