- 08 Sep 2023
- 3 Minutes to read
- Print
- DarkLight
- PDF
JBoss
- Updated on 08 Sep 2023
- 3 Minutes to read
- Print
- DarkLight
- PDF
Variables %JBOSS_HOME% and $JBOSS_HOME used throughout this article refer to the root directory where WildFly Application Server is installed in Windows and Linux operating systems respectively. Some sample values are provided below:
- %JBOSS_HOME% - D:\JBoss-EAP-7.2.0\
- $JBOSS_HOME - /opt/JBoss-EAP-7.2.0/
Windows
Auto Instrumentation
This section describes the steps involved when Auto-Instrumentation method is opted for Probe installation
- Application Deployment Folder
- Log in to the Virtual Machine where JBoss is installed
- Utilize the below path as Application Deployment Folder
%JBOSS_HOME%\standalone\deployments - Example: D:\JBoss-EAP-7.2.0\standalone\deployments
- Startup Script File Path
- Provide the below path as Startup Script File Path
%JBOSS_HOME%\bin\standalone.conf.bat OR
%JBOSS_HOME%\bin\domain.conf.bat - Example: D:\JBoss-EAP-7.2.0\bin\standalone.conf.bat
- Provide the below path as Startup Script File Path
Manual Instrumentation
This section describes the steps involved when Auto-Instrumentation method is not possible. Follow either Method 1 or Method 2 described below
Method 1:
- Shut down JBoss Server (if it is running)
- Add the content below to file standalone.conf.bat in the directory %JBOSS_HOME%/bin. Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section
@echo off ECHO.%JAVA_TOOL_OPTIONS%| FIND /I "instrumentation.jar">Nul || ( set JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS% -javaagent:"%VSP_HOME_WEB_MEM%"\iae-java\instrumentation.jar -Dvirsec_appcontextpath=<AppCollectiveID>
- Save the modified file standalone.conf.bat
- Start the JBoss Server
Method 2:
This method can be used for VSP instrumentation in Domain Mode deployment
- Log in to Virtual Machine where JBoss is installed
- Stop the JBoss service if it is running
- Modify the file %JBOSS_HOME%\domain\configuration\host-slave.xml to include the following entries for the server to be instrumented. In the below example, arguments are configured for JVM “server-one”
Before Change:
After change: Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section<servers> <server name="server-one" group="main-server-group"/> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> </server> </servers>
<servers> <server name="server-one" group="main-server-group"/> <jvm name="default"> <jvm-options> <option value="-javaagent:c:\PROGRA~2\Virsec\virsec-web-mem\iae-java\instrumentation.jar"/> <option value="-Dvirsec_appcontextpath="/> <option value="-DVSP_HOME_WEB_MEM=c:\PROGRA~2\Virsec\virsec-web-mem\"/> jvm-options> jvm> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> server> servers>
- Start the JBoss service
- Application Deployment Folder
- Log in to the Virtual Machine where JBoss is installed
- Utilize the below path as Application Deployment Folder
%JBOSS_HOME%\domain - Example: D:\JBoss-EAP-7.2.0\domain
- Startup Script File Path
- As the VSP-JVM arguments are configured manually, create a dummy file and provide the file path as Start Up Script File Path in the CMS
Linux
Auto Instrumentation
This section describes the steps involved when Auto-Instrumentation method is opted for Probe installation
- Application Deployment Folder
- Log in to the Virtual Machine where JBoss is installed
- Utilize the below path as Application Deployment Folder
$JBOSS_HO,ME/standalone/deployments - Example: /opt/JBoss-EAP-7.2.0/standalone/deployments
- Startup Script File Path
- Provide the below path as Startup Script File Path
$JBOSS_HOME/bin/standalone.conf OR $JBOSS_HOME/bin/domain.conf - Example: /opt/JBoss-EAP-7.2.0/bin/standalone.conf
- Provide the below path as Startup Script File Path
Manual Instrumentation
This section describes the steps involved when Auto-Instrumentation method is not possible. Follow either Method 1 or Method 2 described below
Method 1:
- Shut down JBoss Server (if it is running)
- Add the content below to file standalone.conf in the directory $JBOSS_HOME/bin. Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration sectionShell
export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -javaagent:/opt/virsec-web-mem/iae-java/instrumentation.jar -DVSP_HOME_WEB_MEM=/opt/virsec-web-mem -Dvirsec_appcontextpath="
- Save the modified file standalone.conf
- Start the JBoss Server
Method 2:
This method can be used for VSP instrumentation in Domain Mode deployment
- Log in to Virtual Machine where JBoss is installed
- Stop the JBoss service if it is running
- Modify the file $JBOSS_HOME\domain\configuration\host-slave.xml to include the following entries for the server to be instrumented
In this example, arguments are configured for JVM “server-one”
Before Change:
After Change: Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section<servers> <server name="server-one" group="main-server-group"/> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> </server> </servers>
<servers> <server name="server-one" group="main-server-group"/> <jvm name="default"> <jvm-options> <option value="-javaagent:/opt/virsec-web-mem/iae-java/instrumentation.jar"/> <option value="-Dvirsec_appcontextpath=<AppCollectiveID>"/> <option value="-DVSP_HOME_WEB_MEM=/opt/virsec-web-mem"/> </jvm-options> </jvm> <server name="server-two" group="other-server-group"> <socket-bindings port-offset="150"/> </server> </servers>
- Start the JBoss instance using the below command:
$JBOSS_HOME/bin/standalone.sh
- Application Deployment Folder
- Log in to the Virtual Machine where JBoss is installed
- Utilize the below path as Application Deployment Folder
$JBOSS_HOME/domain - Example: /opt/JBoss-EAP-7.2.0/domain
- Startup Script File Path
- As the VSP-JVM arguments are configured manually, create a dummy file and provide the file path as Start Up Script File Path in the CMS