Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1035232 - [CCC] (6.3) EAP Domain mode is not working properly with Security manager
[CCC] (6.3) EAP Domain mode is not working properly with Security manager
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Domain Management (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity high
: DR0
: EAP 6.3.0
Assigned To: Brian Stansberry
Petr Kremensky
Lucas Costi
:
Depends On:
Blocks: 1036618 1040480 1044394 1053404
  Show dependency treegraph
 
Reported: 2013-11-27 06:00 EST by Josef Cacek
Modified: 2014-07-20 23:15 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In previous versions of JBoss EAP 6, servers in a managed domain would not launch successfully if they were configured to use a Java Security Manager without specifying the classname of the Security Manager. For example, this is commonly done when using the default Security Manager by specifying `-Djava.security.manager` in either` domain.conf` or as a command line parameter. This issue occurred because a system property without a value was passed by Host Controllers to their managed servers with the value of `true`. This meant that the servers would incorrectly attempt to use a Java Security Manager with the classname of `true`. This issue has been fixed in this release by adding extra checks for host controller system properties so that a system property is passed to the managed servers correctly. As a result, using a managed domain and using the default Security Manager by specifying `-Djava.security.manager` should function as expected.
Story Points: ---
Clone Of:
: 1117290 (view as bug list)
Environment:
Last Closed: 2014-06-28 11:26:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
brian.stansberry: needinfo-


Attachments (Terms of Use)

  None (edit)
Description Josef Cacek 2013-11-27 06:00:55 EST
Process described in the Security Guide and Administration guide doesn't enable security manager for domain mode.
http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/6.2/html-single/Security_Guide/index.html#Run_JBoss_Enterprise_Application_Platform_Within_the_Java_Security_Manager
http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/6.2/html/Administration_and_Configuration_Guide/Run_JBoss_Enterprise_Application_Platform_Within_the_Java_Security_Manager.html

The problem is caused by missing arguments in PROCESS_CONTROLLER_JAVA_OPTS and HOST_CONTROLLER_JAVA_OPTS which don't take  a new line added at the end of domain.conf into account.

If the security manager is configured for a host controller (i.e. -Djava.security.manager used in HOST_CONTROLLER_JAVA_OPTS), then the domain doesn't start.

Log file contains:
09:12:58,931 INFO  [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 3) JBAS012017: Starting process 'Server:server-one'
[Server:server-one] Error occurred during initialization of VM
[Server:server-one] java.lang.InternalError: Could not create SecurityManager: true
[Server:server-one]         at sun.misc.Launcher.<init>(Launcher.java:106)
[Server:server-one]         at sun.misc.Launcher.<clinit>(Launcher.java:57)
[Server:server-one]         at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1489)
[Server:server-one]         at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1474)
[Server:server-one] 
09:12:59,045 INFO  [org.jboss.as.process.Server:server-one.status] (reaper for Server:server-one) JBAS012010: Process 'Server:server-one' finished with an exit status of 1

Steps to reproduce:
1. create /tmp/ permit.policy file with content:
grant {
   permission java.security.AllPermission;
};
2. add following line at the beginning of domain.conf:
JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy==/tmp/permit.policy -Djava.security.debug=failure"
3. run ./domain.sh
Comment 1 JBoss JIRA Server 2013-11-27 09:08:43 EST
Darran Lofthouse <darran.lofthouse@jboss.com> made a comment on jira WFLY-2585

In addition to the access control related changes thoroughly check additional places where the current AccessControlContext is obtained within a PriviledgedAction.

Some places may want a clean AccessControlContext that looses the information about the caller, others may genuinely want the current AccessControlContext but instead accidentally replace it.
Comment 2 JBoss JIRA Server 2013-11-27 13:13:47 EST
Darran Lofthouse <darran.lofthouse@jboss.com> updated the status of jira WFLY-2585 to Coding In Progress
Comment 5 Brian Stansberry 2013-11-27 16:25:49 EST
I filed https://bugzilla.redhat.com/show_bug.cgi?id=1035477 for the incorrect documentation advising setting JAVA_OPTS at the end of domain.conf.
Comment 6 Brian Stansberry 2013-11-27 16:44:35 EST
I found it.

The propagation of system properties from the command line / scripts through the PC/HC and to the server process launch is resulting in:

-Djava.security.manager

becoming

-Djava.security.manager=true

The latter fails.

So this is unrelated to the WFLY-2585 issue.
Comment 7 Brian Stansberry 2013-11-27 19:29:51 EST
Note that -Djava.security.policy==/tmp/permit.policy needs to have one '=' removed or you'll get failures.
Comment 9 Josef Cacek 2013-11-28 02:02:24 EST
Two equal signs '==' is a valid syntax for setting a policy file.

The documentation says:

If you use

    java -Djava.security.manager -Djava.security.policy==someURL SomeApp
(note the double equals) then just the specified policy file will be used; all the ones indicated in the security properties file will be ignored.

cf. http://docs.oracle.com/javase/6/docs/technotes/guides/security/PolicyFiles.html
Comment 10 Kabir Khan 2013-11-28 07:43:16 EST
https://github.com/jbossas/jboss-eap/pull/715 replaces 714, and fixes the double '=' case.
Comment 16 Ondrej Lukas 2014-02-26 04:48:24 EST
Verified on EAP 6.3.0.DR0.
Comment 19 Scott Mumford 2014-05-13 22:28:33 EDT
Minor edits to release notes text
Comment 21 Brian Stansberry 2014-07-07 09:56:59 EDT
Josef: See Scott Mumford's request above. I did not make this private and don't know if the setting should be cleared or not.

Note You need to log in before you can comment on or make changes to this bug.