Deploying a PHP IAST agent

You can deploy an IAST agent on the application server that supports Java, .NET, Node.js or PHP based applications. This section explains how to create a PHP agent type on your web server.

Deploying a PHP agent in Windows

About this task

The Windows agent is installed as a dll file that is added as an extension to your PHP project.

Procedure

  1. Download the ASoC PHP Windows agent, as described here.
  2. Extract the contents of the ZIP file.
  3. Locate hcl_agent-win.dll in the extracted ZIP files.
  4. Generate a key for the PHP agent through the ASoC user interface.
  5. On your web server:
    1. Locate the PHP extension directory. You can run 'php -i | findstr "extension_dir"' in the command prompt.
    2. Copy the downloaded hcl_agent-win.dll to the PHP extensions directory you located in step a.
    3. Locate the php.ini file. You can find the location of the php.ini file by running 'php --ini | findstr "Loaded Configuration File"' in the command prompt.
    4. Add a new line 'extension=hcl_agent-win.dll' to the end of the php.ini file you located in step c.
    5. Save the php.ini file.
    6. Add the environment variable: IAST_ACCESS_TOKEN = [key]. You can add it by running 'setx IAST_ACCESS_TOKEN [key]' in the command prompt.
    7. To make the agent available, you need to restart your web server (e.g. Apache or Nginx).

Deploying a PHP agent in Linux (Ubuntu)

About this task

The Ubuntu agent is installed as a deb package.

Procedure

  1. Download the ASoC PHP Ubuntu agent, as described here.
  2. Extract the contents of the ZIP file.
  3. Locate hcl_agent.deb in the extracted ZIP files.
  4. Generate a key for the PHP agent through the ASoC user interface.
  5. On your web server:
    1. Open a terminal window on your Linux system.
    2. Install the dpkg package by running 'apt-get update && apt-get install dpkg' or 'apk update && apk add dpkg'.
    3. Navigate to the directory where the .deb file is located using the cd command.
    4. Run the command 'dpkg -i hcl_agent.deb'. Make sure that php is in this path.
    5. Add the environment variable: Run 'export IAST_ACCESS_TOKEN=[key]'
    6. To make the agent available, you need to restart your web server (e.g. Apache or Nginx)

Deploying a PHP agent in Linux (RedHat)

About this task

The RedHat agent is installed as an rpm package.

Procedure

  1. Download the ASoC PHP RedHat agent, as described here.
  2. Extract the contents of the ZIP file.
  3. Locate hcl_agent.rpm in the extracted ZIP files.
  4. Generate a key for the PHP agent through the ASoC user interface.
  5. On your web server:
    1. Open a terminal window on your Linux system.
    2. Install the rpm package by running 'yum install rpm'.
    3. Navigate to the directory where the .rpm file is located using the cd command.
    4. Run the command 'rpm -i hcl_agent.rpm'.
    5. Add the environment variable: Run 'export IAST_ACCESS_TOKEN=[key]'
    6. To make the agent available, you need to restart your web server (e.g. Apache or Nginx)

What to do next

The agent is now installed. As you use or test your application (by running functional tests, a dynamic scan, or exploring the application manually), the IAST agent will monitor requests and report any security issues it finds.