Is there a way to use qualys API and search/list for asset groups based on domain name?
Is there a way to use qualys API and search/list for asset groups based on domain name?
I was looking for something like
curl -u "USERNAME:PASSWD" -H "X-Requested-With: Curl" -X "POST" -d "action=list&domains=mydomainname
Hi,
Thanks! that works as an intermediate solution. although what I am trying to do was search for the asset group by domain. if it does not exist, i want to create a new one, else i want to scan using my current asset group ID.
Sounds like you'll need a developer to wrap some code to your API command to return the results you need.
You can further tailor the results returned by your API call by tinkering with the show_attributes:
show_attributes={None or a comma-separated list of:
TITLE, OWNER, NETWORK_IDS, LAST_UPDATE,
IP_SET, APPLIANCE_LIST, DOMAIN_LIST, DNS_LIST,
NETBIOS_LIST, EC2_ID_LIST, HOST_IDS, USER_IDS,
UNIT_IDS, BUSINESS_IMPACT, CVSS}
I encourage you to visit Qualys Documentation > API Quick Reference for all APand API V2 User Guide for additional details.
I would recommend starting with an API call that has all the information pertinent to systematic analysis:
curl -u "USERNAME:PASSWD" -H "X-Requested-With: Curl" -X "POST" -d "action=list&show_attributes=DOMAIN_LIST,TITLE,IP_SET" "https://qualysapi.qualys.com/api/2.0/fo/asset/group/"
Please keep us posted on the direction you decide to go.
the easiest solution would have been to search with domain-name since this would avoid a for loop of all the domains . So, for now, I have taken the domain list and if domain does not exist (in my code, done by iterating through for-loop of all the domains ), I am creating an asset group and returning the assetID from that. I am using this assetID to perform further actions according to my need.
Hi DMFezzaReed ,
Is there a way to add a domain with the qualys API? I don't see a documentation on that.
Yes, please refer page 113 and 114 of the Qualys API V1 User Guide which can be found here: https://www.qualys.com/docs/qualys-api-v1-user-guide.pdf
I just want to add a domain. the error i am getting, i believe, is because there is no "google.com" domain already added in my account. Is it possible using api guide v2?
Ah, my apologies I misread the question. shyam_raj was correct, the functionality is only available in the V1 API.
I believe there is a flaw in the API.
Step 1: I create "just a domain" using api v1 guide and it has no asset groups tied to it.
Step 2: I perform " '/asset/group/?action=list&&show_attributes=DOMAIN_LIST' " using api guide v2 and search for my domain that I added in step 1. This results in a true condition where in fact it should have given me false!
To add a domain to an existing AG: Qualys API v2 User Guide, Page 238
I am researching API capability for UI function: VM > Assets > Domains to add a NEW domain. I need to learn things...I'll get back to you.
Sure, thanks! what I'm trying to do is completely without IPs. I just want my code everything to do as per domain name as I have another code in place to deal with the IPs.
Also,
from the qualys API docs for editing an asset group:
id={value} (Required) The ID of the asset group you want to edit.
You could use an API query that looks like below, and then search on domain information.
The XML output looks like this: