Configuring and Using the Proxy Server
You can use the AppScan Presence Proxy Server to record traffic, save it as a DAST.CONFIG file, and import it to run an ASoC scan. You can optionally encrypt this file, as described in a sub-section below.
Configuring the proxy server connection
About this task
“
becomes \”
and
\
becomes \\
internalConfiguration
settings in this file.Procedure
- PEM:
- A PEM certificate requires two files (full paths)
- Do not forget to escape characters as needed both in file paths and password, for instance a password such as abc!”123 would become abc!\”123 (the “ symbol is escaped)
- PKCS12:
- In the command line,
run:
.\Java\jre\bin\java.exe -jar .\DastProxy.jar -sc "C:\Path\to\certificate.pfx"
- When prompted, enter the certificate’s password and press Enter.
- In the command line,
run:
openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt
Example
using openssl to convert the PEM certificate to PKCS12
certificate:openssl pkcs12 -export -out certificate.pfx -inkey key.pem -in server.crt
Example
using Java’s keygen tool to convert a JKS certificate to PKCS12
certificate:keytool -importkeystore -srckeystore certificate.jks -srcstoretype JKS -destkeystore certificate.p12 -deststoretype PKCS12
Using the proxy server
Procedure
-
If the site is secured (HTTPS), you can avoid SSL warnings by doing
this:
- Use the REST API to download the self-signed Root Certificate Authority, used by the AppScan Proxy Server, as a PEM file.
- Install the certificate on the browser used for the Explore, or wherever needed (depending on where the traffic is sent from).
-
To start a proxy, use the REST API request:
StartProxy
, and define the recording port (to which you want to send the traffic).Note: If the proxy server does not have direct access to the site, you can also define an upstream (chained) proxy with this REST API.Note: If you need to define more than one chained proxy, or exceptions to the proxy, use the chained proxy rules file (proxy.chain
) found in the installation folder.Note: If traffic is not encrypted (see sub-section below), you can encrypt the traffic file (DAST.CONFIG) for an individual recording using:Query param Example: /StartProxy/<recordingPort>?encrypted=true
- Send your traffic via the defined recording port.
-
When done, send the REST API request:
StopProxy
(note thatStopProxy/0
is not allowed). -
Download the recorded traffic file by sending the REST API request:
Traffic
The traffic file has extension.dast.config
Note: When you download the traffic file, the traffic data is deleted from the Proxy Server.You can use the DAST.CONFIG file to update the Explore data of an existing job, using the ASoC REST API. You can
Encrypt DAST.CONFIG file
- To upload your file for encryption, use:
EncryptDastConfig
- To download the encrypted file, use:
DownloadEncryptedDastConfig
Encrypt traffic
"encryptDastConfig"
key in the
Settings.json
file, found in the installation folder, to
true
.Set proxy inactivity timeout
The default inactivity timeout for recording proxy
instances is 60 minutes. You can change this value in the
Settings.json
file, saved in the installation folder.
Chained proxy
The default inactivity timeout for recording proxy
instances is 60 minutes. You can change this value in the
Settings.json
file, saved in the installation folder.
Configure the Root Certificate
- Install the certificate generated by the proxy on your machine(s):
- Use the REST API to download the self-signed Root Certificate Authority, used by the AppScan Proxy Server, as a PEM file.
- Install it on the browser used for the Explore, or wherever needed (depending on where the traffic is sent from).
- Import your own root certificate to the proxy server. Supported certificate
formats are PKCS12 (.P12, .PFX), JKS:
- Open a command line window and navigate to the installation folder
of the Proxy Server on the AppScan Presence machine. Default
location:
<AppScanPresenceInstallFolder>\Automation
- Run the following
command:
..\Java\jre\bin\java -jar DastProxy.jar -irc [path to certificate file] -ircp [password]
..\Java\jre\bin\java -jar DastProxy.jar
- Open a command line window and navigate to the installation folder
of the Proxy Server on the AppScan Presence machine. Default
location:
ProxyServerDemoScript.py
, can be
found in (default
location);<AppScanPresenceInstallFolder>\Automation