Windows record

/api/2.0/fo/auth/windows/

[POST]

Create, update, list and delete Windows records for authenticating to Windows systems. Vulnerability and Compliance scans are supported (using PC).

Download Qualys User Guide - Windows Authentication (.pdf)

Input Parameters

Parameter

Description

action={action}

(Required) Specify create, update, delete (using POST) or list (using GET or POST). See List Auth Records for type

echo_request={0|1}

(Optional) Specify 1 to view (echo) input parameters in the XML output. By default these are not included.

ids={value}

(Required to update or delete record) Record IDs to update/delete. Specify record IDs and/or ID ranges (for example, 1359-1407). Multiple entries are comma separated.

title={value}

(Required to create record) A title for the record. The title must be unique. Maximum 255 characters (ascii).

comments={value}

(Optional to create or update record) User defined comments. Maximum of 1999 characters.

use_agentless_tracking={0|1}

(Optional to create or update record) Specify 1 to enable Agentless Tracking.

Login Credentials

 

username={value}

(Required to create record, optional to update record) The username for the Windows account to be used for authentication on target hosts. The username may include 1-31 characters (ascii).

password={value}

(To create record password or login_type=vault is required) The password of the Windows account to be used for authentication. Maximum 100 characters (ascii).

login_type={basic|vault}

(To create record password or login_type=vault is required) Set to vault if a third party vault will be used to retrieve password. Vault parameters need to be provided in the record.

Click here for vault parameters

windows_ad_domain={value}

(Optional) The Windows Active Directory domain name for domain level authentication. When specified, we’ll use an Active Directory forest to authenticate to hosts in a certain domain within the framework. You’ll need to enter a Fully Qualified Domain Name (FQDN). See Windows Domains

This parameter and the windows_domain parameter cannot be specified in the same request.

This parameter and the ips parameter cannot be specified in the same request.

windows_domain={value}

(Optional) The Windows NetBIOS domain name for domain level authentication. See Windows Domains

This parameter and the windows_ad_domain parameter cannot be specified in the same request.

When the ips parameter is also specified, the domain type is NetBIOS, User-Selected IPs. We’ll use NetBIOS to authenticate to the IPs in the domain configuration.

When the ips parameter is not specified, the domain type is NetBIOS, Service-Selected IPs. We’ll use NetBIOS to authenticate to hosts in the domain using credentials stored on the domain.

ntlm={0|1}

(Optional) When not specified, NTLM authentication is enabled allowing the scanning engine to try the NTLM authentication protocol when negotiating authentication to target hosts. Specify ntlm=0 if you do not want the NTLM authentication protocol attempted for the hosts defined in the Windows record. This may be the case if the target hosts are running a version of Windows that supports a more secure authentication protocol like Kerberos. When NTLM authentication is disabled, it will not be attempted even if other methods like NTLMSSP and Kerberos fail.

Target Hosts

 

ips={value}

(Optional for create record when asset_type=ips or asset_type is not specified)  When specified, the ips parameter defines an IP list for the authentication record. These are the hosts to be authenticated to with the login credentials. When not specified, the service uses the authentication credentials stored on the domain to authenticate to hosts that are members of the domain.

(Optional for update request)  Overwrites (replaces) the IP list for the authentication record. The IPs you specify are added and any existing IPs are removed.

You may enter a combination of IPs and IP ranges. Multiple entries are comma separated.

This parameter and the add_ips parameter or the remove_ips parameter cannot be specified in the same request.

add_ips={value}

(Optional to update record) IPs to be added to an existing record. Multiple IPs/ranges are comma separated.

This parameter and the ips parameter cannot be specified in the same request.

remove_ips={value}

(Optional to update record) IPs to be removed from your record. You may enter a combination of IPs and ranges. Multiple entries are comma separated.

This parameter and the ips parameter cannot be specified in the same request.

network_id={value}

(Optional to create or update record, and valid when the networks feature is enabled) The network ID for the record.

Target Hosts with Tag Support

Note: Applicable only when you have Asset Tagging and Tag Support for Authentication Records enabled for your subscription.

asset_type={ips|asset_tags|ip_range_tag_rule}

(Optional) Indicates how assets will be defined in the record. Valid values are ips (the default), asset_tags, ip_range_tag_rule. When not specified, we will use asset_type=ips.

ips - Specify this value to assign IP addresses/ranges to the record

asset_tags - Specify this value to add tags to the record for the assets you want included. IP addresses with the selected tags already assigned will be associated with the record.

ip_range_tag_rule - Specify this value to add tags that have IP address ranges defined in the tag rule. All IP addresses defined in the tag rule will be associated with the record, including IPs that do not already have the tag assigned.

tag_set_by={id|name}

(Optional when asset_type=asset_tags or ip_range_tag_rule) Specify "id" (the default) to select a tag set by providing tag ids. Specify "name" to select a tag set by providing tag names.

tags_include={tag1, tag2...}

(Required when asset_type=asset_tags or ip_range_tag_rule) Specify a tag set to include in the record. Hosts that match these tags will be included. You identify the tag set by providing tag names or IDs. Multiple entries are comma-separated. To specify tag names, you must also specify tag_set_by=name.

tags_exclude={tag1, tag2...}

(Optional when asset_type=asset_tags or ip_range_tag_rule) Specify a tag set to exclude in the record. Hosts that match these tags will be excluded. You identify the tag set by providing tag names or IDs. Multiple entries are comma-separated. To specify tag names, you must also specify tag_set_by=name.

tag_include_selector={any|all}

(Optional when asset_type=asset_tags or ip_range_tag_rule) Select "any" (the default) to include hosts that match at least one of the selected tags. Select "all" to include hosts that match all of the selected tags.

tag_exclude_selector={any|all}

(Optional when asset_type=asset_tags or ip_range_tag_rule) Select "any" (the default) to exclude hosts that match at least one of the selected tags. Select "all" to exclude hosts that match all of the selected tags.

ips={value}

(Required to create record when asset_type=ips or asset_type is not specified) The IP address(es) the server will log into using the record’s credentials. Multiple entries are comma separated.

(Optional to update record when asset_type=ips) IPs specified will overwrite existing IPs in the record, and existing IPs will be removed.

This parameter and the add_ips parameter or the remove_ips parameter cannot be specified in the same request.

add_ips={value}

(Optional to update record when asset_type=ips) Add IPs and/or ranges to the IPs list for this record. Multiple IPs/ranges are comma separated.

This parameter and the ips parameter cannot be specified in the same request.

remove_ips={value}

(Optional to update record when asset_type=ips) IPs to be removed from your record. You may enter a combination of IPs and ranges. Multiple entries are comma separated.

This parameter and the ips parameter cannot be specified in the same request.

Protocols

For Windows domain level authentication, all three authentication protocols are supported. Kerberos and NTLMv2 are enabled by default in new records. If NTLM was enabled in a record prior to this release, then NTLMv1 is enabled.

For Windows local host level authentication, NTLMv2 and NTLMv1 protocols are supported. NTLMv2 is enabled by default in new records. If NTLM was enabled in a record prior to this release, then NTLMv1 is enabled.

kerberos={0|1}

(Optional) When not specified, Kerberos is enabled allowing the scanning engine to try Kerberos when negotiating authentication to target hosts. Specify kerberos=0 if you do not want Kerberos attempted.

Kerberos is supported for domain authentication only. When kerberos=1 you must define a domain name for Windows Active Directory (windows_ad_domain) or NetBIOS (windows_domain) for the record.

ntlmv2={0|1}

(Optional) When not specified for a new record, NTLMv2 is enabled allowing the scanning engine to try NTLMv2 when negotiating authentication to target hosts. Specify ntlmv2=0 if you do not want NTLMv2 attempted.

ntlm={0|1}

(Optional) When not specified, NTLMv1 will not be attempted. Specify ntlm=1 to allow the scanning engine to try NTMLv1 when negotiating authentication to target hosts.

SMB Signing

SMB Signing option is disabled by default, meaning SMB signing is not required. This is the recommended setting. When disabled, we can authenticate to any Windows version regardless of how SMB signing is configured on the target. You are not protected, however, against man-in-the-middle (MITM) attacks.

require_smb_signing={0|1}

(Optional) Set to 0 (default) when SMB signing is not required.

Set value to 1 to require SMB signing. Should I require SMB signing? The answer is No in most cases. If you enable this option in your record, we will require each Windows target to support SMB signing. If SMB signing is disabled on a target host, authentication will fail and the host will not be scanned. This option protects against MITM attacks but we won't be able to authenticate to some hosts.

minimum_smb_version={value}

(Optional) The minimum SMB protocol version. Valid values are:

1, 2.0.2, 2.1, 3.0, 3.0.2, 3.1.1, and "" (empty string means no version set)

 

Windows Domains

- Supported doman types: Active Directory, NetBIOS User-Selected IPs, NetBIOS Service-Selected IPs.

- Authentication is performed at the local host level when a domain name is not defined for Active Directory (windows_ad_domain) or NetBIOS (windows_domain).

- Once a Windows record is saved, you cannot change the domain type from Active Directory to NetBIOS or from NetBIOS to Active Directory.

Sample - Create Windows record

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With:curl" -X POST

"action=create&title=API_v2_utwrx_mp_Windows&username=User&password=Password&ips=10.10.10.200" "https://qualysapi.qualys.com/api/2.0/fo/auth/windows/"

XML output

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE BATCH_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/batch_return.dtd">

<BATCH_RETURN>

 <RESPONSE>

   <DATETIME>2018-04-30T09:28:00Z</DATETIME>

   <BATCH_LIST>

     <BATCH>

       <TEXT>Successfully Created</TEXT>

       <ID_SET>

         <ID>1310338</ID>

       </ID_SET>

     </BATCH>

   </BATCH_LIST>

 </RESPONSE>

</BATCH_RETURN>

Sample - Create Windows Record with Tags

In this sample, a new Windows record is created with asset_type=asset_tags.

API request

curl -H "X-Requested-With: curl" -u "USERNAME:PASSWORD"

"https://qualysapi.qualys.com/api/2.0/fo/auth/windows/?action=create&title=windows&username=root&asset_type=asset_tags&tags_include=ag1&tag_includ

e_selector=all&tags_exclude=ag20&tag_set_by=name&tag_exclude_selector=all"

XML output

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE BATCH_RETURN SYSTEM

"https://qualysapi.qualys.com/api/2.0/batch_return.dtd">

<BATCH_RETURN>

   <RESPONSE>

      <DATETIME>2021-03-11T00:45:31Z</DATETIME>

      <BATCH_LIST>

         <BATCH>

            <TEXT>Successfully Created</TEXT>

            <ID_SET>

                <ID>204027</ID>

            </ID_SET>

         </BATCH>

      </BATCH_LIST>

   </RESPONSE>

</BATCH_RETURN>

Sample - List Windows records

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With:curl" -X POST

"action=list&ids=1310338&details=All" "https://qualysapi.qualys.com/api/2.0/fo/auth/windows/"

XML output

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE AUTH_WINDOWS_LIST_OUTPUT SYSTEM "https://qualysapi.qualys.com/api/2.0/fo/auth/windows/auth_windows_list_output.dtd">

<AUTH_WINDOWS_LIST_OUTPUT>

 <RESPONSE>

   <DATETIME>2018-04-30T09:29:45Z</DATETIME>

   <AUTH_WINDOWS_LIST>

     <AUTH_WINDOWS>

       <ID>1310338</ID>

       <TITLE><![CDATA[Windows Record 1]]></TITLE>

       <USERNAME><![CDATA[acme_jd]]></USERNAME>

       <IP_SET>

         <IP>10.10.10.202</IP>

       </IP_SET>

       <CREATED>

         <DATETIME>2018-04-30T09:28:00Z</DATETIME>

         <BY>acme_jd</BY>

       </CREATED>

       <LAST_MODIFIED>

         <DATETIME>2018-04-30T09:28:43Z</DATETIME>

       </LAST_MODIFIED>

       <COMMENTS><![CDATA[My comments on Windows Record 1]]></COMMENTS>

     </AUTH_WINDOWS>

   </AUTH_WINDOWS_LIST>

   <GLOSSARY>

     <USER_LIST>

       <USER>

         <USER_LOGIN>acme_jd</USER_LOGIN>

         <FIRST_NAME>John</FIRST_NAME>

         <LAST_NAME>Doe</LAST_NAME>

       </USER>

     </USER_LIST>

   </GLOSSARY>

 </RESPONSE>

</AUTH_WINDOWS_LIST_OUTPUT>

More Samples

Qualys API - Windows Authentication API samples  (GitHub)

DTDs for auth type "windows"

<platform API server>/api/2.0/batch_return.dtd

<platform API server>/api/2.0/fo/auth/windows/auth_windows_list_output.dtd