Release 1.1.0.0 API
November 25, 2024
What's New?
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 to Execute API Using the above JWT Token and it's sample responseSample API Request to Execute API Using the above JWT Token and it's sample response
API Request
curl --location ' <qualys_base_url>/ot/v1/host/list?filter=asset.assetUuid%3A%22af338503-ce5a-376b-b337-1ed9958abc8f%22' --header 'Authorization: Bearer <access_token from above response>'
Response
{ "assets": [ { "name": "<asset_name>", "address": "<IP_address>", "hardware": { "category2": <category2>, "vendor": "<vendor_name>", "model": "<model>", "class": "Unknown" }, "interfaces": [ { "address": "<IP_address>", "firstSeen": "2024-10-04T08:04:20.308Z", "lastSeen": "2024-10-04T08:04:20.308Z" } ], "assetId": <Asset_id>, "tags": [ { "tagId": <tag_id>, "name": "<tag_name>" }, ], "lastUpdated": "2024-10-04T08:04:20.308Z", "created": "2024-10-04T08:04:20.308Z", "firmwareVersion": "<version>", "purdueLevel": "Unknown", "assetUuid": "<asset_uuid>", "serialNumber": "<serial_number>", "inventory": { "fileHash": "<filehash>", "fileName": "<file_name>", "source": "Industrial OCA" }, "operatingSystem": "<operating_system>", "qAssetId": <qasset_id> } ] }