Create Discovery
In order to run the certificate discovery process, we need to create new Discovery.
Discovery behavior is defined by the Connector implementing Discovery Provider Function Group.
Create Discovery using the API
Discovery can be created using the Discovery API. However, before creating it, we need know the required Attributes for the Discovery.
We can get that using the following request:
curl -X GET \
--cacert [ca-cert] \
--cert [client-cert] \
--cert-type [type] \
-H "Accept: application/json" \
https://[domain]:[port]/api/v1/connectors/ef092b12-e181-4734-8e34-73152612a945/discoveryProvider/IP-Hostname/attributes
#https://[domain]:[port]/api/v1/connectors/{uuid}/{functionGroup}/{kind}/attributes
To get details about the Connector, you can use the API call described in Register Connector.
This returns the list of applicable attributes for the Discovery process, such as:
[
{
"uuid": "1b6c48ad-c1c7-4c82-91ef-3b61bc9f52ac",
"name": "ip",
"label": "IPs/Hostnames",
"type": "STRING",
"required": true,
"readOnly": false,
"visible": true,
"list": false,
"description": "Multiple values can be given seperated by comma ','.",
"multiSelect": false
},
{
"uuid": "a9091e0d-f9b9-4514-b275-1dd52aa870ec",
"name": "port",
"content": {
"value": 443
},
"label": "Ports",
"type": "INTEGER",
"required": false,
"readOnly": false,
"visible": true,
"list": false,
"description": "Multiple values can be given seperated by comma ','.",
"multiSelect": false
},
{
"uuid": "3c70d728-e8c3-40f9-b9b2-5d7256f89ef0",
"name": "allPorts",
"content": {
"value": false
},
"label": "All Ports?",
"type": "BOOLEAN",
"required": false,
"readOnly": false,
"visible": true,
"list": false,
"description": "Check to discover certificates from all ports.",
"multiSelect": false
}
]
Knowing the attributes, we can create the Discovery using the following request:
curl -X POST \
--cacert [ca-cert] \
--cert [client-cert] \
--cert-type [type] \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '
{
"name": "CZERTAINLY Hostname Discovery",
"connectorUuid": "ef092b12-e181-4734-8e34-73152612a945",
"kind": "IP-Hostname",
"attributes": [
{
"name": "port",
"content": {
"value": 443
}
},
{
"name": "allPorts",
"content": {
"value": false
}
},
{
"name": "ip",
"content": {
"value": "www.czertainly.com"
}
}
]
}' \
https://[domain]:[port]/api/v1/discoveries
When the Discovery process is successfully created, its uuid is sent back:
{
"uuid": "c0aaafda-a731-4175-8ec4-2cdcd06015fa"
}
Create Discovery using the Web Interface
Follow these steps to create new Network Discovery.
All required attributes will be displayed.
- Log in to the Operator Interface
https://[domain]:[port]/operator - Click Discovery in the left menu
- Click Add New Discovery (plus symbol )
- Fill the columns with the attributes:
- Discovery Name:
CZERTAINLY Hostname Discovery - Discovery Provider:
Network Discovery Provider - Type:
IP-Hostname - IP/Hostname:
www.czertainly.com - Port:
443 - All Ports?:
No
- Discovery Name:
- Click on Create button to start the
Discovery
You have created successfully the Discovery for discover certificates from the website www.czertainly.com.