This project is a Python wrapper around the HCL AppScan on Cloud SAClient utility. The SAClient.py script will aid in automation workflows where HCL does not have out-of-the box plug-ins or integrations.
- Have an HCL AppScan on Cloud account with API Key
- Install the SAClientUtil and add /bin to the path (tested with SAClient Version 8.0.1387)
- Install Python 3 (tested on 3.9.0)
- Have an application to scan
Start with the example script SAST_Automation_Example.py. This script will step through a simple static analysis automation workflow. An example credentials file is available in the example directory.
- Login to the ASoC service.
- Verify that the provided AppId exists in your ASoC subscription.
- Generate an IRX file using the provided appscan-config.xml file.
- Submit the IRX file for analysis, using the provided scan name.
- Monitor the scan progress and wait for it to complete.
- Download the scan summary as a json file and print some info about the scan.
- Download the scan report to a desired location.
To see some additional information in the stdout, set debug=True.
The war file, included in the example directory is the Altoro Mutual (altoromutual.war). This is an application specifically designed to be scanned using HCL AppScan. It is publicly available at:
https://github.com/hclproducts/AltoroJ
Print the help and usage information
python SAST_Automation_Example.py --help
usage: SAST_Automation_Example.py [-h] [-c CONFIG] [-s SCAN] [-t TARGET] credentials_file app
positional arguments:
credentials_file Path to file that contains ASoC API Key.
app ID or Name of the application in ASoC to associate the scan with.
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Path to AppScan Config XML File. If the config file resides in the target scan directory, this
option is not required.
-s SCAN, --scan SCAN Scan Name for the ASoC Portal. If not specified, a generic name is used.
-t TARGET, --target TARGET
Directory to target for the scan. If not specified, the working directory is used.
File format for credentials file: {"keyid": "<KEYID>", "keysecret": "<KEYSECRET">}
Run the example workflow
py SAST_Automation_Example.py example/example_creds.json -t example
HCL AppScan on Cloud Help Center
All files found in this project are licensed under the Apache License 2.0.