Wildfly

This article includes information regarding a modification to the WildFly server's standalone script when running Protect's Microagent.

Prerequisites

We assume that you have successfully installed Inspect onto your WildFly server and can analyze your applications using Inspect.

You must also be able to access the shiftleft.json file that Inspect created upon analyzing your application.

Finally, make sure that you have set the $HOME and $JBOSS_HOME environment variables properly.

Modifying the Configuration

The easiest way to proceed is to modify standalone.sh (or if present, standalone.conf) as follows (be sure to back up the file you plan to modify before proceeding):

  1. Add a call to sl update java-agent to make sure that the latest version of the ShiftLeft Java Microagent library is present in $HOME/.shiftleft

  2. Set the SHIFTLEFT_CONFIG environment variable by running export SHIFTLEFT_CONFIG=<full_path_to_shiftleft.json>

  3. Set JAVA_OPTS using the following script (note that there are interactions between the Microagent and WildFly's logging configuration which the script handles):

SL_OPTS=-javaagent:$HOME/.shiftleft/sl-microagent-latest.jar
‚Äč
export JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.4.Final.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager $SL_OPTS"

Make sure to point the flag to the location of the current ShiftLeft Microagent .jar file (i.e., "-javaagent:$HOME/.shiftleft/sl-microagent-latest.jar").