Downloading and deploying Java IAST agent on the Web server
You must download and deploy an IAST agent on the tested application's web server to monitor traffic sent during runtime and report vulnerabilities it finds.
Before you begin
- The tested application should be installed on the web server.
- You must create an application in the Portfolio tab of the Monitor view in AppScan Enterprise. For more information on creating an application in AppScan Enterprise, see Creating an application.
About this task
Procedure
- Log in to AppScan Enterprise Server.
- Go to the Monitor page > Portfolio tab to view the list of applications available.
-
Click the application to which you want to download an IAST agent.
The application page is displayed. For more information on creating an application, see Creating an application
-
On the left pane, click the IAST Agents.
The IAST agents page is displayed on the right pane.
-
Click Create a new Agent.
The Getting started with IAST page is displayed.
-
Click Create a new Agent.
The IAST agent creation page is displayed.
-
From the Agent Type drop-down list, select the language using which
the testing application is developed.
Note: IAST feature supports Java, .NET, and Node.js based applications.
- In the Agent Name box, enter a unique name for the agent you are creating for the application. The agent name can contain alphanumeric and special characters with a length of a maximum of 30 characters.
- Click Download Agent. The Check your downloads folder message is displayed and the AppScanIASTAgent file is downloaded to the system’s default download folder.
- Extract the AppScanIASTAgent file to a folder.
-
You can deploy the Java IAST agent using either of the following types of files:
Note: For a Java IAST agent both the JAR and WAR files have the same communication token, so both agents will communicate to the same IAST session. This helps in scenarios where some of the applications use WAR and others use JAR.
-
If both the compile-time and the runtime Java versions are 9 or later, add the following
Java property to the Java run command:
–Djava.lang.invoke.stringConcat=BC_SB
Results
Deploying the Java IAST Agent using a WAR file
Procedure
- Deploy the Secagent.war file on the tested application's web server.
-
Interact (run functional tests, run a Dynamic scan, or explore the application manually)
with the tested application for the IAST agent to monitor the requests and report the security
issues.
Note: An IAST scan does not send its requests. It can discover issues only if the requests are sent to the application you are testing through system tests, manual explores, or a DAST scan, and so on.
-
Go to the application's tab view and click All Issues on the left-pane to view the
list of issues related to security vulnerabilities discovered.
Note: You can use the filter Discovery Method=IAST to view only IAST issues in the application.
Deploying the Java IAST Agent using a JAR file
Procedure
- In the jar_deployment folder, locate the Secagent.jar file
- Copy the Secagent.jar file to the root directory of the application.
-
Add the following flag to your app command line:
-Djavaagent:<path to secagent.jar>
Example:For a shopping website:
java -javaagent:secagent.jar -jar ./shopping/target/shopping-0.9.0-SNAPSHOT.jar
Results
Running a Java agent with security manager
About this task
You can run the Java agent with security manager:
- As a war file on Tomcat or
- As a jar file on servers other than Tomcat. Contact the AppScan support team for guidance.
To run the Java agent with security manager as war on Tomcat:
Procedure
-
Locate the catalina.policy file.
The catalina.policy file is usually located in the Tomcat installation configuration directory. The exact path might vary depending on your operating system and Tomcat version.
- Open the catalina.policy file in a text editor.
-
Locate the "grant" block.
Look for a block starting with the keyword "grant" followed by one or more "permission" statements.
-
Add the required permissions as follows:
- Save the catalina.policy file.
- Restart the Tomcat server to apply the changes.