/api/2.0/fo/auth/snmp/
[POST]
Create, update, list and delete SNMP records for authenticated scans of SNMP enabled devices. Supported are vulnerability and compliance scans (using VM, PC). Supported versions are SNMPv1, SNMPv2 and SNMPv3.
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. |
version={v1|v2c|v3} |
(Optional to create or update record) Specifies the SNMP protocol version. For an update request, this parameter overwrites the existing SNMP version with a new version. A valid value is: v1 = SNMPv1 (the default) v2c = SNMPv2c v3 = SNMPv3 |
Login Credentials |
|
community_strings={value} |
(Optional and valid using SNMPv1 and SNMPv2c) The SNMP community strings to be used for authentication to target hosts. Multiple entries are comma separated. The service attempts authentication using several common default community strings. When community_strings is specified, the user-provided community strings are used for authentication before the default community strings. |
username={value} |
(Optional and valid using SNMPv3) The user account for authentication to target hosts. A maximum of 128 characters may be specified. These three parameters are used to specify authentication: username, password and auth_alg. If creating a record and authentication will be used, it is required that all three parameters are specified together. If updating a record to change the username, the username specified will replace the existing username in the record. If updating a record to remove authentication, specify an empty value for all three parameters. |
password={value} |
(Optional and valid using SNMPv3) The password for authentication to target hosts. Maximum of 128 characters.. These three parameters are used to specify authentication: username, password and auth_alg. If creating a record and authentication will be used, it is required that all three parameters are specified together. If updating a record to change the password, the password specified will replace the existing password in the record. If updating a record to remove authentication, specify an empty value for all three parameters. |
auth_alg={MD5|SHA1} |
(Optional and valid using SNMPv3) The algorithm for authentication: MD5 or SHA1. This algorithm is used to safely prove to the SNMP server knowledge of the password without sending the password. These three parameters are used to specify authentication: username, password and auth_alg. If creating a record and authentication will be used, it is required that all three parameters are specified together. If updating a record to change the authentication algorithm, the algorithm specified will replace the existing algorithm in the record. If updating a record to remove authentication, specify an empty value for all three parameters. |
encrypt_password={value} |
(Optional and valid using SNMPv3) The password if privacy (data encryption) is to be used for SNMP communication. Maximum of 128 characters. These two parameters are used to specify privacy: encrypt_password and priv_alg. If creating a record and privacy will be used, it is required that both parameters are specified together. If updating a record to change the password, the password specified will replace the existing password in the record. If updating a record to remove privacy, specify an empty value for both parameters. |
priv_alg={DES|AES} |
(Optional and valid using SNMPv3) The algorithm to be used for privacy: DES or AES. This algorithm is used to encrypt and decrypt SNMP messages. These two parameters are used to specify privacy: encrypt_password and priv_alg. If creating a record and privacy will be used, it is required that both parameters are specified together. If updating a record to change the privacy algorithm, the algorithm specified will replace the existing algorithm in the record. If updating a record to remove privacy, specify an empty value for both parameters. |
security_engine_id={value} |
(Optional and valid using SNMPv3) The security engine ID when a security engine is part of the target host configuration. A valid ID is required. A maximum of 128 characters may be specified. If a security engine ID is part of the target host configuration, the parameter security_engine_id must be defined for the record in order for authentication to be successful. If the security engine ID is not defined (and is required by the target host for all SNMP requests), then the SNMP service may not be detected on the target host and authentication will fail. |
context_engine_id={value} |
(Optional and valid using SNMPv3) The context engine ID used in scoped PDUs when a context is part of the target host configuration. A valid ID is required. A maximum of 128 characters may be specified. If an SNMP context is part of the target host configuration, the parameters context_engine_id and/or context must be defined for the record in order for the scanning engine to retrieve context-sensitive information from the target host. |
context={value} |
(Optional and valid using SNMPv3) The context name used in scoped PDUs when a context is part of the target host configuration. A maximum of 128 characters may be specified. If an SNMP context is part of the target host configuration, the parameters context_engine_id and/or context must be defined for the record in order for the scanning engine to retrieve context-sensitive information from the target host. |
Target Hosts |
|
ips={value} |
(Required to create record) The IP address(es) the server will log into using the record’s credentials. Multiple entries are comma separated. (Optional to update record) 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) 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) 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. |
API request
curl -H "X-Requested-With: Curl Sample" -d "action=create&title=My+Record&version=v3&username=user&password=password&auth_alg=MD5&encrypt_password=passwordabcde123456&priv_alg=DES&security_engine_id=0x80001F88805131F121BD9B194B&context_engine_id=0x80001F88805131F121BD9B194B&context=bridge1&ips=10.10.10.2-10.10.10.4" -b "QualysSession=a3863e31b486417f81eea7f8881f3142; path=/api; secure" "https://qualysapi.qualys.com/api/2.0/fo/auth/snmp/"
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-02-27T20:17:42Z</DATETIME>
<BATCH_LIST>
<BATCH>
<TEXT>Successfully Created</TEXT>
<ID_SET>
<ID>12366</ID>
</ID_SET>
</BATCH>
</BATCH_LIST>
</RESPONSE>
</BATCH_RETURN>
Change the user name and password for authentication and the target IPs.
API request
curl -H "X-Requested-With: Curl Sample" -d "action=update&ids=65319&username=user2&password=password2&ips=10.10.10.5-10.10.10.6"
-b "QualysSession=a3863e31b486417f81eea7f8881f3142; path=/api; secure" "https://qualysapi.qualys.com/api/2.0/fo/auth/snmp/"
<platform API server>/api/2.0/batch_return.dtd
<platform API server>/api/2.0/fo/auth/snmp/auth_snmp_list_output.dtd