Configure Java Agent for Multiple Applications

Configure the Java Agent to monitor multiple applications on the same J2EE application server.

If you have multiple applications deployed on the same J2EE application server, you can bind each application path to a separate project and/or project version. This applies to J2EE servers such as Tomcat, IBM WebSphere, JBoss, or any J2EE server that can host more than one application.

You can define this binding in a Java Agent configuration file agent.json. You can create such file in either of the two locations on an Agent machine:
  • In the <SEEKER_HOME_DIR> folder, if this folder already exists.
  • In the Agent deployment folder, where the seeker-agent.jar is stored.
Note:
  • If you have agent.json files in both locations, the one in <SEEKER_HOME_DIR> takes precedence over the other.
  • If you don't have write permissions in the Agent deployment folder, and don't have a <SEEKER_HOME_DIR> folder, you might need to create it and set the environment variable <SEEKER_HOME_DIR>.
  • Variable settings in the agent.json files take precedence over similar settings in other locations. For details, see Priority Order of Configuration Settings.

You can edit the file as follows:

  • To bind an application path to a separate project and/or project version, add a mapping for each path. For example:
    [
      {
        "contextPath": "/wavsep1",
        "projectKey": "project1",
        "projectVersion": "1.0"
      },
      {
        "contextPath": "/wavsep2",
        "projectKey": "project2",
        "projectVersion": "2.0"
      }
    ]
  • Additionally, you can define project-level custom tags. These tags are handy for identifying the testing environments in which the Agent detected vulnerabilities. For example:
    [
     {
        "contextPath": "/wavsep3",
        "projectKey": "project3",
        "projectVersion": "3.0",
        "customTags": "tag1,tag2",
        "agentName": "My Agent"
      }
    ]