Bug 966160 - Server should only listen to external/public bind addresses when absolutely necessary
Server should only listen to external/public bind addresses when absolutely n...
Product: JBoss Operations Network
Classification: JBoss
Component: Core Server (Show other bugs)
JON 3.1.2
All All
high Severity high
: ER01
: JON 3.2.0
Assigned To: John Mazzitelli
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2013-05-22 12:35 EDT by Marc Shirley
Modified: 2014-01-02 15:36 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-02 15:36:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
eap5.1.2.log (20.16 KB, text/x-log)
2013-09-30 10:41 EDT, Armine Hovsepyan
no flags Details
publicBindAddress (230.83 KB, image/png)
2013-10-08 10:48 EDT, Armine Hovsepyan
no flags Details

  None (edit)
Description Marc Shirley 2013-05-22 12:35:31 EDT
Description of problem:
The server listens to all ports on the bind address supplied (default even though this results in security risks.  Instead, the server should only bind to an external public facing interface when needed (such as the port 7080/7443 ports for client/agent connectivity).

Version-Release number of selected component (if applicable):
JBoss ON 3.1.2

How reproducible:

Steps to Reproduce:
1. Install server
2. Start server
3. Review netstat data to see that all ports are listening on all interfaces.

Actual results:
By default the server opens all ports on all interfaces.

Expected results:
The server should be configured to listen only on necessary ports externally (ie, 7080/7443), and the rest should be disabled or configured to the localhost/ address so that they are not externally accessible.

Additional info:
Reconfigured and tested with only the 7080/7443 ports listening on a public interface by modifying the jboss-server.xml file and did not see any obvious issues with the server functions, so this could possibly be resolved by adding an additional configuration option for an internal service bind address defaulting to
Comment 1 John Mazzitelli 2013-05-28 11:10:32 EDT
The management interfaces in AS7.1.1.Final and EAP 6.1.x are now, by default, only bound to the local loopback IP ( so this means they are not available to any remote machine. You can only access it from the local machine.

You can see this in RHQ Server's standalone-full.xml:

            <native-interface security-realm="ManagementRealm">
                <socket-binding native="management-native"/>
            <http-interface security-realm="ManagementRealm">
                <socket-binding http="management-http"/>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:}"/>

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:6999}"/>
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:6990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:6443}"/>
Comment 2 Larry O'Leary 2013-05-28 13:36:11 EDT
But what about the other miscellaneous ports? In AS 4 we had web services, JMX, JNP, RMI, and XA. Essentially, what this comes down to is what does netstat return:

    netstat -anp | grep LISTEN | grep "<RHQ JMV PID>/java"

All required public services (that needs to be reachable outside of localhost) should be<port> and all required private services (that only need to be reachable from localhost) should be<port>. And no services should be listening that are not required. Furthermore, we should know what all services relate to and their purpose.
Comment 3 John Mazzitelli 2013-05-31 12:42:59 EDT
This is what I see (host:port from netstat) from my latest master build: (jacorb port - i think we can get rid of this service) (http/rest admin port) (native admin port) (messaging - hornetq netty connector - can probably bind this to 127) (messaging-throughput - hornetq netty connector - can probably bind this to 127) (our public HTTP/non-secure web port) (our public HTTPS/secure web port) (remoting connector - looks used by ejb3 for remote clients AND remote JMX - can probably bind this to 127 since we may need the jmx connector for the plugin)
Comment 4 John Mazzitelli 2013-05-31 12:54:38 EDT
not sure how easy it will be to remove jacorb - see https://issues.jboss.org/browse/WFLY-1034 and its associated forum thread https://community.jboss.org/message/754423#754423

maybe that we just bind it to
Comment 5 John Mazzitelli 2013-05-31 13:15:30 EDT
according to brian s., jacorb is also used by JTS - since we need transactioning, I don't want to risk blowing up by removing jacorb entirely. Will bind it to instead
Comment 6 John Mazzitelli 2013-05-31 15:20:26 EDT
with changes that I will commit soon, this is now the bindings - notice that only two are now bound to by default - the http and https web endpoints.

tcp        0      0    *                   LISTEN      28958/java          
tcp        0      0    *                   LISTEN      28958/java          
tcp        0      0    *                   LISTEN      28958/java          
tcp        0      0      *                   LISTEN      28958/java          
tcp        0      0    *                   LISTEN      28958/java          
tcp        0      0      *                   LISTEN      28958/java          
tcp        0      0    *                   LISTEN      28958/java          
tcp        0      0    *                   LISTEN      28958/java     

all these services cannot be removed (jacorb required by JTS, messaging needed for JMS/hornetq and remoting needed for managing the server itself via rhq plugins and JMX)

but now all these services are bound to the local loopback so they are not remotely accessible.

will continue to test to make sure this doesn't break anything and will commit when things look good.
Comment 7 John Mazzitelli 2013-05-31 17:05:23 EDT
git commit to master: cf58fce
Comment 8 Larry O'Leary 2013-09-06 10:32:55 EDT
As this is MODIFIED or ON_QA, setting milestone to ER1.
Comment 9 Armine Hovsepyan 2013-09-30 10:40:27 EDT

port 4455 is required for EAP5.1.2 - start of eap5.1.2 with offset (Djboss.socket.binding.port-offset=100) doesn't help.

Please get log attached
Comment 10 Armine Hovsepyan 2013-09-30 10:41:12 EDT
Created attachment 805241 [details]
Comment 11 Armine Hovsepyan 2013-09-30 10:42:51 EDT
checked version: JON 3.2 ER1
OS: Linux x86_64
Comment 12 Armine Hovsepyan 2013-10-08 10:48:45 EDT
Created attachment 809334 [details]
Comment 13 Armine Hovsepyan 2013-10-08 10:49:40 EDT
bz #1016703 filed for comment #9

bind addresses verified
find screen-shot attached

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