Get the Details of Scripts from Library API

This API lets you get the details of scripts from library

GET/sm/v1/script-library/{id}

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

id

Mandatory

String

Provide Library ID for which you want to fetch the details from the script library

Authorization

Mandatory

String

Authorization token to authenticate to Qualys Enterprise TruRisk™ Platform

Sample: Get the details of script from script librarySample: Get the details of script from script library

API Request

 curl -X GET https://<qualys_base_url>/sm/v1/scriptlibrary/<Library-id> 
--header 'Content-Type: application/json' 
--header 'Authorization: Bearer <authToken>' 
--data '{"filter":"includeScriptContent" : true}'

Response

{
"body": 
{
 
 "id": 18711,
 
 "title": "QID 91566 CVE-2019-9512 HTTPv2 Server Dos Vuln.ps1",
 
 "description": "To be fully protected from the vulnerabilities, 
an administrator needs to configure their server to limit the 
number of HTTPv2 packets accepted by registry key modification.
This script performs the required post patch action as per MSRC.",
 "disclaimer": "THIS SCRIPT IS PROVIDED TO YOU \"AS IS.\" TO THE 
EXTENT PERMITTED BY LAW, QUALYS HEREBY DISCLAIMS ALL WARRANTIES
AND LIABILITY FOR THE PROVISION OR USE OF THIS SCRIPT. IN NO EVENT 
SHALL THESE SCRIPTS BE DEEMED TO BE CLOUD SERVICES AS PROVIDED BY 
QUALYS",
 "category": 
{
 "id": 0,
 "name": "Post Patch"
 },
 "platform": "WINDOWS",
 "lastUpdatedDateTime": 1688550457688,
 "severity": 0,
 "threshold": 0,
 "type": {
 "id": 1,
 "name": "Custom Script"
 },
 "language": {
 "id": 4,
 "name": "PowerShell-Script"
 },
 "created": {
 "dateTime": 1688550457688
 },
 "content": 
"JHJlZ2lzdHJ5UGF0aCA9ICJIS0xNOlxTWVNURU1cQ3VycmVudENvbnRyb2xTZXRcU
2VydmljZXNcSFRUUFxQYXJhbWV0ZXJzIgokbmFtZSA9ICJIdHRwMk1heFBpbmdzUGV
yTWludXRlIgokdmFsdWUgPSAiMCIKCiRyZWdpc3RyeVBhdGgxID0gIkhLTE06XFNZU
1RFTVxDdXJyZW50Q29udHJvbFNldFx
.
.
.
AkbmFtZTYgYW5kIHZhbHVlICR2YWx1ZTYgYWxyZWFkeSBhZGRlZCIKICAgICAgICAg
ICAgfQogICAgfQoJfQo=",
 "versions": [
 {
 "version": "1",
 "path": "VMDR/Post Patch/Custom 
Script/Windows/PowerShell-Script/1/QID 91566 CVE-2019-9512 HTTPv2 
Server Dos Vuln/QID 91566 CVE-2019-9512 HTTPv2 Server Dos 
Vuln.ps1",
 "sha": "a19327ce3132382f3ac0df1b8ac7fa2fae5cc181"
 }
 ],
 "importedFromScriptLibrary": true,
"moduleCode": "VMDR",
 "vmdrScriptMetadata":
 {
 "name": "QID 91566 CVE-2019-9512 HTTPv2 Server Dos Vuln.ps1",
 "disclaimer": "THIS SCRIPT IS PROVIDED TO YOU \"AS IS.\" TO THE 
EXTENT PERMITTED BY LAW, QUALYS HEREBY DISCLAIMS ALL WARRANTIES
AND LIABILITY FOR THE PROVISION OR USE OF THIS SCRIPT. IN NO EVENT 
SHALL THESE SCRIPTS BE DEEMED TO BE CLOUD SERVICES AS PROVIDED BY 
QUALYS",
 
 "description": "To be fully protected from the vulnerabilities, 
an administrator needs to configure their server to limit the 
number of HTTPv2 packets accepted by registry key modification.
This script performs the required post patch action as per MSRC.",
 "subType": "Post Patch",
 "detectionLogic": "Use Script",
 "qid": "91566",
 "returnCode": "1",
 "status": "Active",
 "severity": "5",
 "threshold": "500",
 "thresholdTimeUnit": null,
 "technology": null
 }
 }
}

To know the details of the response codes, refer to Appendix.