Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze future impact of Java SecurityManager removal on tests #743

Open
scottmarlow opened this issue Sep 15, 2021 · 12 comments
Open

Analyze future impact of Java SecurityManager removal on tests #743

scottmarlow opened this issue Sep 15, 2021 · 12 comments

Comments

@scottmarlow
Copy link
Contributor

scottmarlow commented Sep 15, 2021

As per jakartaee/platform#406, analyze our options for running TCK tests against a future Java SE version that does not contain the SecurityManager classes.

One output from this issue should be analysis of how we could:

  1. Remove SecurityManager references from TCK tests without losing non-SecurityManager aspects of those tests.
  2. Or make the SecurityManager tests optional but still require any non-SecurityManager aspects of tests to be run.
  3. Do not change any SecurityManager tests and instead allow test failures caused by SecurityManager classes being removed/stubbed out from future Java SE version to be ignored (e.g. certification compatibility request can contain test failures caused by JDK changes to SecurityManager).

For reference, see https://openjdk.java.net/jeps/411

@scottmarlow scottmarlow added the 10.0 Issues related to the Jakarta EE 10 Platform TCK release label Sep 15, 2021
@scottmarlow scottmarlow added this to Unassigned in Platform TCK 10 Sep 15, 2021
@scottmarlow scottmarlow changed the title Remove use of Java SecurityManager in tests Analyze future impact of Java SecurityManager removal on tests Oct 6, 2021
@scottmarlow scottmarlow removed this from Unassigned in Platform TCK 10 Jan 12, 2022
@scottmarlow
Copy link
Contributor Author

scottmarlow commented Mar 8, 2022

Update: I will soon attach new test logs from running the EE 9.1 Platform TCK test failures with an older WildFly that is purely Jakarta EE 9.1 based without the Security Manager. Thanks @brideck for noticing!

Attached are 103 EE 9.1 Platform TCK test failures when running WildFly (with some EE 10 changes) without the Security Manager:

15 Connector failures connector_logs.zip

Source link: https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/connector/permissiondd

18 servlet failures servlet_logs.zip

Source links:
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/servlet/ee/platform/cdi/filter
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/servlet/ee/platform/cdi/listener
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/servlet/ee/platform/cdi/servlet
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/servlet/ee/spec/security/permissiondd

12 ejb30/sec failures ejb30_sec_logs.zip

Source link: https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/ejb30/sec/permsxml

58 securityapi failures securityapi_logs.zip

Source links:
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/ham/customform/base
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/ham/customform/expression
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/basic
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/customhandler
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/basic
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/hashalgorithm
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/hashalgorithmparam
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/invalidcallerquery
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/invaliddatasource
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/invalidgroupsquery
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/invalidhashalgorithmparam
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/invalidpriorityuseforexpr
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/useforgroup
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/database/useforvalidation
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/idstorepermission
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/basic
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/binddn
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/groupmemberof
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/groupmemberofnotexist
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidbinddn
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidbinddnpassword
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidcallerbasedn
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidcallernameattr
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidcallersearchbase
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidcallersearchfilter
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidgroupmemberattr
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidgroupnameattr
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidgroupsearchbase
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidgroupsearchfilter
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidsearchscopeexpr
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/invalidurl
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/notvalidated
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/priorityuseforexpr
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/searchscopebothonelevel
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/searchscopebothsubtree
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/searchscopecalleronelevelgroupsubtree
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/searchscopecallersubtreegrouponelevel
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/searchscopeexpr
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/useforgroup
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/ldap/useforvalidation
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/multi
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/multiauthz
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/useforgroup
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/idstore/useforvalidation
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/securitycontext/authenticate
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/securitycontext/ejb
https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/securityapi/securitycontext/getprincipalsbytype

@arjantijms
Copy link
Contributor

Thanks, much appreciated!

@brideck
Copy link
Contributor

brideck commented Mar 12, 2022

Running the EE 9.1 Platform TCK with Open Liberty and Java 18, we immediately hit a problem with the JavaTest harness that prevents any tests from running:

[javatest.batch] java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
[javatest.batch] 	at java.base/java.lang.System.setSecurityManager(System.java:416)
[javatest.batch] 	at com.sun.javatest.JavaTestSecurityManager.install(JavaTestSecurityManager.java:84)
[javatest.batch] 	at com.sun.javatest.tool.Main.run(Main.java:291)
[javatest.batch] 	at com.sun.javatest.tool.Main.main0(Main.java:150)
[javatest.batch] 	at com.sun.javatest.tool.Main.main(Main.java:130)

There is a property (javatest.security.noSecurityManager=true) that skips the call to setSecurityManager, but there is not currently a hook in the TCK automation to set it. I've hacked in the change for now to get past it and am re-running the TCK. I will share the results when it is complete.

@LanceAndersen
Copy link

LanceAndersen commented Mar 12, 2022 via email

@brideck
Copy link
Contributor

brideck commented Mar 12, 2022

What version of javatest are you using? You probably need a more recent build of javatest

I'm not sure that a newer version of JavaTest would matter, unless they've changed the default behavior to not set a security manager. The property we need is there already, it's just that the invocation in the TCK's Ant scripts doesn't use it at present.

Also, you depending on the test(s), you may need to include: -Djava.security.manager=allow

I'm not trying to get all of the tests to pass with Java 18. Similar to what Scott did above, I'm trying to see what fails, so that we can be prepared for when there is a Java level that no longer lets you set this property to allow at all.

@scottmarlow
Copy link
Contributor Author

scottmarlow commented Mar 14, 2022

My test results above are from running with Java 17.

Good idea to look at Java 18. I wonder which JavaTest version is needed to support Java 18 and possibly up to Java 21.

@brideck
Copy link
Contributor

brideck commented Mar 14, 2022

Good idea to look at Java 18. I wonder which JavaTest version is needed to support Java 18 and possibly up to Java 21.

We shouldn't need a new version of JavaTest. I'll create a PR to show the kind of change in the TCK scripts that would be needed for this.

@brideck
Copy link
Contributor

brideck commented Mar 14, 2022

I've run tests with Open Liberty three ways now: (1) Java 17 with -Djava.security.manager=disallow, (2) Java 17 with the EE security permissions setup in our OL automation disabled, and (3) Java 18. In each run, I got the same set of 33 failures -- a subset of what Scott reported upthread.

connector/permissiondd - 6 failures (testValidateLocalPermsInvalidName & testValidateMissingPermFails)
ejb30/sec/permsxml - 12 failures
securityapi/idstore/idstorepermission - 1 failure
servlet/ee/spec/security/permissiondd - 14 failures

The only surprising part to me (without having looked more closely yet) is that I would have expected more of the connector/permissiondd tests to fail. I'll look into that some more.

@scottmarlow
Copy link
Contributor Author

From my updated test run with EE 9.1 (using the WildFly Preview 26.x branch which is actually EE 9.1):

connector has 15 failure(s)
ejb30_sec has 12 failure(s)
securityapi has 1 failure(s)
servlet has 14 failure(s)

I'll attach test jtr + logs soon.

@scottmarlow
Copy link
Contributor Author

Running the EE 9.1 Platform TCK with Open Liberty and Java 18, we immediately hit a problem with the JavaTest harness that prevents any tests from running:

[javatest.batch] java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
[javatest.batch] 	at java.base/java.lang.System.setSecurityManager(System.java:416)
[javatest.batch] 	at com.sun.javatest.JavaTestSecurityManager.install(JavaTestSecurityManager.java:84)
[javatest.batch] 	at com.sun.javatest.tool.Main.run(Main.java:291)
[javatest.batch] 	at com.sun.javatest.tool.Main.main0(Main.java:150)
[javatest.batch] 	at com.sun.javatest.tool.Main.main(Main.java:130)

There is a property (javatest.security.noSecurityManager=true) that skips the call to setSecurityManager, but there is not currently a hook in the TCK automation to set it. I've hacked in the change for now to get past it and am re-running the TCK. I will share the results when it is complete.

#904 could benefit from the jakartaee-tck/pull/894 as well I think.

@brideck
Copy link
Contributor

brideck commented Mar 22, 2022

#904 could benefit from the jakartaee-tck/pull/894 as well I think.

Agreed. Shall I turn 894 into a real PR and have folks review it? The new version of JavaTest would also resolve this, but I'm not sure when it might be getting out of Beta releases.

@scottmarlow
Copy link
Contributor Author

#904 could benefit from the jakartaee-tck/pull/894 as well I think.

Agreed. Shall I turn 894 into a real PR and have folks review it?

Yes, please do turn i894 into a real PR.

The new version of JavaTest would also resolve this, but I'm not sure when it might be getting out of Beta releases.

@scottmarlow scottmarlow removed the 10.0 Issues related to the Jakarta EE 10 Platform TCK release label Jun 7, 2022
scottmarlow added a commit to scottmarlow/specifications that referenced this issue Mar 19, 2024
…m-tck#894 change to address jakartaee/platform-tck#743 which didn't get released with jakarta-xml-ws-tck-4.0.0.zip

Signed-off-by: Scott Marlow <smarlow@redhat.com>
ivargrimstad pushed a commit to jakartaee/specifications that referenced this issue Mar 19, 2024
…m-tck#894 change to address jakartaee/platform-tck#743 which didn't get released with jakarta-xml-ws-tck-4.0.0.zip (#708)

Signed-off-by: Scott Marlow <smarlow@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants