Sample 1: Sample Script Written using JavaScript
These samples provide an example of what you can do with the Application Security Management REST APIs.
Before you begin
About this task
- asm_api_summaries_issues_appfilter.js: This example shows how to log in, get basic summary information about issues using application attributes as part of the query, and log out.
- asm_api_summaries_issues_daterange.js: This example shows how to log in, get basic summary information about issues using a date range query, and log out.
- asm_sample_avg_issues_found_per_app_by_month.js: This example demonstrates a way to get the average number of issues found per application by month.
- asm_sample_count_issues_by_app_over_time.js: This example demonstrates a way to enumerate, month by month, the list of applications for which new issues have been discovered.
- asm_sample_overdue_issues.js: This example demonstrates a way to identify 'Overdue Issues'.
Procedure
- Unzip the samples zip file anywhere on your hard drive. Then copy the json2.js helper library into the .\\3rdParty\\json2.js sub-folder.
- Edit the _your_connection_info.js file
to specify the location of your AppScan Enterprise Server and the
user credentials.Note: The common_functions.js file contains shared functions used by the various samples. Do not run it directly.
- Run any of the other asm_xxxxx.js files
by using cscript from the command line. For example,
c:/> cscript asm_api_summaries_issues_appfilter.js
. - Alternatively, double-click the runAll.bat file to run all of the samples.