Downloading and deploying PHP IAST agents
Use this procedure to download the AppScan Enterprise PHP IAST agent and deploy it to your application server environment (Windows, Ubuntu, or Red Hat). The PHP IAST agent monitors your running web application during runtime testing (manual or automated) and reports vulnerabilities to AppScan Enterprise.
Before you begin
- Ensure you have AppScan Enterprise access with permissions to manage applications and IAST agents.
- Identify the target application in AppScan Enterprise.
- Verify you have administrative privileges on the target PHP application server (Windows, Ubuntu, or Red Hat).
- Verify your PHP version is 8.1.0 or later.
About this task
ase-config.json file included in the
download package. You must configure specific environment variables on your server for the
agent to connect to AppScan Enterprise.Part 1: Download the PHP agent
Procedure
- Log in to the AppScan Enterprise.
- From the application list, navigate to the target application.
- Select the Application tab, then click IAST Agents.
- Click Create a new Agent.
-
From the Agent type list, select the option that matches your PHP application's
deployment environment:
- PHP - Windows
- PHP - Ubuntu
- PHP - Red Hat
- In the Agent name box, enter a descriptive name for this agent instance.
-
Click Download agent.
The agent ZIP package downloads automatically.
Part 2: Understand the downloaded package
Procedure
- Locate the downloaded ZIP file.
-
Understand its contents:
- Agent binary:
- Windows:
hcl_agent.dll - Ubuntu:
hcl_agent.deb - Red Hat:
hcl_agent.rpm
- Windows:
ase-config.json: A file containing configuration details specific to this agent instance, including theaccessTokenandhostvalues needed for manual server configuration.- License File: Contains license agreement information (e.g.,
HCL Master License Agreement).
- Agent binary:
Part 3: Deploy the agent (select the section for your OS)
Deploying on Windows:
Procedure
- Extract the contents of the downloaded agent ZIP file to a temporary location on the server.
-
Configure PHP to load the agent extension:
-
Find your PHP extension directory. Open a command prompt and run:
php -i | findstr "extension_dir". -
Copy the
hcl_agent.dllfile (from the extracted files) into the PHP extension directory found in step 2a. -
Find your active
php.iniconfiguration file. In the command prompt, run:php --ini | findstr "Loaded Configuration File". -
Edit the
php.inifile found in step 2c using a text editor. -
Add the following line at the end of the file:
extension=hcl_agent.dll. -
Save and close the
php.inifile.
-
Find your PHP extension directory. Open a command prompt and run:
-
Configure environment variables. Retrieve the
accessTokenandhostvalues from thease-config.jsonfile.Note:- The
IAST_ACCESS_TOKENandIAST_HOSTcan be set locally on the server. For example, on an XAMPP server, they can be set in thehttpd.conffile. - If other agents (Java, .NET, Node.js) are installed on the same machine, you must set the variables at the server level (Method B) instead of the system level.
Method A: System level (default)
Open a command prompt as Administrator and run the following commands:setx IAST_ACCESS_TOKEN "your_accessToken_from_ase-config.json" /M setx IAST_HOST "your_host_from_ase-config.json" /MMethod B: Server level (XAMPP example)
Edit your XAMPP server'shttpd.conffile and add the following lines, typically within the<Directory>section for your web root:SetEnv IAST_HOST "your_host_from_ase-config.json" SetEnv IAST_ACCESS_TOKEN "your_accessToken_from_ase-config.json" - The
- Restart your web server (e.g., Apache service, IIS) to apply the changes.
Deploying on Ubuntu:
Procedure
- Extract the contents of the downloaded agent ZIP file to a temporary location on the server.
-
Install the agent package:
-
Configure environment variables. Retrieve the
accessTokenandhostvalues from thease-config.jsonfile.Note:- For the agent to function correctly with the web server service, the environment
variables must be set persistently for that service. Using
exportin a terminal will only set them for the current session. - A recommended method is to add the
SetEnvdirectives to your Apache configuration file (e.g.,httpd.confor a virtual host configuration file).
Edit your Apache configuration file and add the following lines:
SetEnv IAST_HOST "your_host_from_ase-config.json" SetEnv IAST_ACCESS_TOKEN "your_accessToken_from_ase-config.json" - For the agent to function correctly with the web server service, the environment
variables must be set persistently for that service. Using
-
Restart your web server (e.g.,
sudo service apache2 restartorsudo service nginx restart) to apply the changes.
Deploying on Red Hat:
Procedure
- Extract the contents of the downloaded agent ZIP file to a temporary location on the server.
-
Install the agent package:
- Open a terminal window.
-
Ensure
rpmis available. If not, install it (e.g.,sudo yum install rpm). -
Navigate (
cd) to the directory containing the extractedhcl_agent.rpmfile. -
Run the installation command:
sudo rpm -ivh hcl_agent.rpm.
-
Configure environment variables. Retrieve the
accessTokenandhostvalues from thease-config.jsonfile.Note:- For the agent to function correctly with the web server service, the environment
variables must be set persistently for that service. Using
exportin a terminal will only set them for the current session. - A recommended method is to add the
SetEnvdirectives to your Apache configuration file (e.g.,httpd.confor a virtual host configuration file).
Edit your Apache configuration file and add the following lines:
SetEnv IAST_HOST "your_host_from_ase-config.json" SetEnv IAST_ACCESS_TOKEN "your_accessToken_from_ase-config.json" - For the agent to function correctly with the web server service, the environment
variables must be set persistently for that service. Using
-
Restart your web server (e.g.,
sudo systemctl restart httpdorsudo systemctl restart nginx) to apply the changes.
Results
Next Steps:
Procedure
- In AppScan Enterprise, navigate to and confirm the new agent shows a "Connected" status.
- Run tests against your application (e.g., functional tests, manual exploration, DAST scan). The IAST agent monitors this traffic.
- View reported vulnerabilities in the AppScan Enterprise as the agent finds them.