Release 2.4 API
January 06, 2025
Before understanding the API release highlights, learn more about the API server URL to be used in your API requests by referring to the Know Your Qualys API Server URL section. For this API Release Notes, <qualys_base_url> is mentioned in the sample API requests.
What's New?
This release introduces new APIs to streamline report management, including fetching, generating, downloading, and deleting reports.
New API: Report List API
New or Updated API | New |
API Endpoint | /sm/v1/reports |
Method | GET |
DTD or XSD changes | Not Applicable |
This API is used to fetch the list of reports.
Input ParametersInput Parameters
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
limit | Mandatory | Integer | Specify the number of reports. Default = 50. |
offset | Mandatory | Integer | Specify the number of reports to skip those reports in the response.
For example, if you set the limit to 50 and the offset to 10, the response will include reports from 41 to 50, skipping the first 10. |
Sample: Fetch Reports ListSample: Fetch Reports List
API Request
curl -X GET '<qualys_base_url>/sm/v1/reports?limit=50&offset=0' --header 'Authorization: Bearer <JWT Token>' --header 'Content-Type: application/json'
Response
{ "list": [ { "fileUuid": "4735c320-a0c2-11ef-add9-9be5caf4ae88", "resourceId": "45cfedbb-70dc-460e-b955-364be9ac5bb8", "resourceTag": "Script Job Report", "reportName": "Test Job Report", "fileFormat": "CSV", "templateName": "Script Job Report", "status": "COMPLETED", "fileSize": 674, "expireOn": "2024-12-12T06:49:35.000+00:00", "timezone": null, "description": "Test Job Report", "fileZipped": 0, "isScheduled": 0, "filename": "4735c320-a0c2-11ef-add9- 9be5caf4ae88_2024-11-12_06:49", "createdAt": "2024-11-12T06:49:35.000+00:00", "createdBy": "422036547" } ], "totalCount": 1, "message": "Successfully list fetched." }
New API: Generate Report API
New or Updated API | New |
API Endpoint | /sm/v1/reports |
Method | POST |
DTD or XSD changes | Not Applicable |
This API is used to generate a report using the job name and job ID.
Input ParametersInput Parameters
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
name | Mandatory | String | Specify the report name.
The value supports only alphanumeric characters, underscores (_), dashes, single quotes ('), and brackets ( ) with a maximum of 128 characters are allowed. Avoid using blank spaces at the beginning and end of the report name; spaces between words are allowed. |
jobId | Mandatory | Integer | Specify the job ID for which to generate the report. |
Sample: Generate a ReportSample: Generate a Report
API Request
curl -X POST '<qualys_base_url>/sm/v1/reports' --header 'Authorization: Bearer <JWT Token>' --header 'Content-Type: application/json' --data-raw '{ "name": "Report_Job-1731391205", "jobId": "261332" }'
Response
{ "data": { "fileUuid": "bc3ea460-a0c8-11ef-92e2-eda9848ac1cf" }, "message": "Request successfully created." }
New API: Download Report API
New or Updated API | New |
API Endpoint | /sm/v1/reports/{fileUuid} |
Method | GET |
DTD or XSD changes | Not Applicable |
This API is used to download generated reports using the file UUID.
Input ParametersInput Parameters
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
fileUuid | Mandatory | String | Specify the file Uuid to download the report. |
Sample: Download a ReportSample: Download a Report
API Request
curl -X GET '<qualys_base_url>/sm/v1/reports/c1f45fe0-ae41-11ef-b911-29725dc02f46' --header 'Content-Type: application/octet-stream' --header 'Authorization: Bearer <JWT Token>'
Response
The CSV report is downloaded.
New API: Delete Report API
New or Updated API | New |
API Endpoint | /sm/v1/reports |
Method | DELETE |
DTD or XSD changes | Not Applicable |
This API is used to delete a generated report using the file UUID.
Input ParametersInput Parameters
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
fileUuids | Mandatory | List | Specify the file UUID to delete the report. |
Sample: Delete a ReportSample: Delete a Report
API Request
curl -X DELETE '<qualys_base_url>/sm/v1/reports' --header 'Accept: application/json' --header 'Authorization: Bearer <JWT Token>' --header 'Content-Type: application/json' --data-raw '{ "fileUuids": [ "7a2fce70-b23c-11ef-a9e5-9da3fb45984c" ] }'
The Report is deleted, and the status code returned is 204 (No Content).
Support for OAuth 2.0 and OpenID Connect Authentication Standards
With this release, we have upgraded our API security by incorporating OAuth 2.0 and OpenID Connect for Qualys API authentication and authorization. When OpenID Connect API authentication is implemented along with OAuth 2.0, IdP is used for user authentication and JWT token generation for the Qualys API access.
Key Updates
- Seamless integration of OAuth 2.0 and OpenID Connect to enhance API authentication and authorization measures.
- Compatibility with current identity providers and authentication to facilitate a seamless integration experience.
- This authentication is supported by all Qualys APIs.
- It eliminates the need for users to provide a username and password. This streamlines Qualys API access by allowing users to use JWT tokens, bypassing the hassle associated with usernames and passwords.
Enable OpenID Connect API Authentication
This feature is not available by default. Contact Qualys support to enable it for your subscription. You must follow the onboarding process. This feature requires IdP.
Benefits
- Enhanced API security
OpenID Connect (OIDC) uses tokens to establish a user's identity and grant access.
- Standardized access control
OpenID Connect (OIDC) provides a standardized way to manage user identities and access control
- Centralized Authentication
By enabling IDP-initiated SSO, users can authenticate once through your organization’s Identity Provider (IDP) and gain access to all the necessary APIs without needing to log in again. This simplifies the user experience and reduces password fatigue, making access faster and more secure.
- Compliance and Security
Helps to meet compliance requirements by ensuring that user authentication processes adhere to established security protocols like SAML and OIDC.
Prerequisites
Public signing certificates for verifying the authenticity of SAML responses. Upto 3 certificates can be provided. The certificate must be in X.509 format (usuallyin .pem or .cer files).
- IdP Name
The name of the Identity Provider (IdP) being configured. This can be a customname or provided by the customer.
Example: "TestNameforIDP Qualys Internal" - Entity ID
The unique identifier for the customer’s IdP. Typically, this is a URN or URL that serves as the IdP’s primary identifier during OIDC communications.
Example: "https://example.com/idp" - Single Sign-On (SSO) URL
The URL where authentication requests will be sent. This is the endpoint where users are redirected to authenticate with the customer’s IdP.
Example: "https://example.com/login" - Single Logout (SLO) URL (if applicable)
The URL for handling logout requests. If you support Single Logout, this endpoint will manage the termination of sessions both at the IdP and within Qualys.
Example: "https://example.com/logout" - SSO Exit URL (optional)
The URL where users will be redirected after successful authentication.
- Certificates
Public signing certificates for verifying the authenticity of SAML responses. Upto 3 certificates can be provided. The certificate must be in X.509 format (usuallyin .pem or .cer files).
Onboarding Process
To start using OpenID Connect API authentication, the following onboarding process must be completed.
- Contact Qualys Support (www.qualys.com/support) to request OpenID Connect API authentication activation for your subscription. A CRM ticket is automatically created and is used as a reference and tracking for all discussions concerning the activation.
- Qualys Support replies to the ticket to share and request the required technical information used to enable OIDC. see the Prerequisites for the details.
- Upon receipt of the response, Qualys enables OpenID Connect API authentication support. This process takes approximately one week to complete.
Use OpenID Connect API Authentication
Once the onboarding process is complete and the OpenID Connect API authentication is enabled, you can begin using it. To start using it, you must first generate the JWT token and then use that token to execute the Qualys APIs. The following subsections provide API request and response samples for generating a JWT token and executing APIs using this token.
Sample API Request to Generate JWT Token for API Authentication and its sample responseSample API Request to Generate JWT Token for API Authentication and its sample response
The token generation URL may vary based on the IdP application you are using. The sample below illustrates the request and response for Okta.
API Request
curl --location ' https://qualys.oktapreview.com/oauth2/aus27sviwo8jbrP4T0h8/v1/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=password' --data-urlencode 'username=jdoe@qualysit.com' --data-urlencode 'password= ' --data-urlencode 'client_id=0oa27l586h672nMy90h8' --data-urlencode 'scope=openid profile'
Response
{ "token_type": "Bearer", "expires_in": 3600, "access_token": " ", "scope": "openid profile", "id_token": " " }
Sample API Request using the JWT Token for API Authentication and its sample responseSample API Request using the JWT Token for API Authentication and its sample response
API Request
curl -X GET
'<qualys_base_url>/sm/v1/reports?limit=50&offset=0'
--header 'Authorization: Bearer <access_token from above response>'
--header 'Content-Type: application/json'
Response
{ "list": [ { "fileUuid": "4735c320-a0c2-11ef-add9-9be5caf4ae88", "resourceId": "45cfedbb-70dc-460e-b955-364be9ac5bb8", "resourceTag": "Script Job Report", "reportName": "Test Job Report", "fileFormat": "CSV", "templateName": "Script Job Report", "status": "COMPLETED", "fileSize": 674, "expireOn": "2024-12-12T06:49:35.000+00:00", "timezone": null, "description": "Test Job Report", "fileZipped": 0, "isScheduled": 0, "filename": "4735c320-a0c2-11ef-add9- 9be5caf4ae88_2024-11-12_06:49", "createdAt": "2024-11-12T06:49:35.000+00:00", "createdBy": "422036547" } ], "totalCount": 1, "message": "Successfully list fetched." }