Create a new scan definition with detailed settings and validation options. A scan definition specifies the targets, schedule, credentials, and scan parameters used when launching scan runs.
User-Agent String required
userAgent_example
curl -X 'POST'
-H
'Accept: application/json'
-H
'Content-Type: application/json; charset=UTF-8'
-H
'User-Agent: userAgent_example'
'https://api-cortex.paloaltonetworks.com/public_api/netscan/v1/scan/definition'
-d
'{
"plugins_timeout" : 5,
"excluded_targets" : [ "" ],
"schedule_days" : 127,
"schedule_quiet_hours" : [ ],
"network_scanner_ids" : [ "scanner-1", "scanner-2" ],
"schedule_cadence" : "DAILY",
"description" : "Weekly security scan for production servers",
"disable_wmi_search" : "1",
"exclude_printers" : "1",
"target_ids" : [ ],
"scanner_plugins_timeout" : 3600,
"targets" : [ "192.168.1.0/24", "10.0.0.1-10.0.0.100" ],
"enable_report" : true,
"network" : 1,
"definition_id" : 123,
"schedule_dates" : [ ],
"credential_ids" : [ 1 ],
"schedule_start_date" : 1765083183326,
"timeout_retry" : 5,
"max_hosts" : 30,
"strict_unauthenticated" : "0",
"override_target_exclusions" : false,
"port_list_id" : 5,
"auth_port_ssh" : 22,
"checks_read_timeout" : 5,
"non_simult_ports" : "139,445,3389,Services/irc",
"exclude_fragile_devices" : "1",
"vt_config_id" : 4,
"disable_cgi_cache" : "1",
"open_sock_max_attempts" : 5,
"max_checks" : 4,
"safe_checks" : "1",
"schedule_timezone" : "America/Los_Angeles",
"alive_test_methods" : [ "arp", "icmp", "tcp_ack" ],
"alive_test_ports" : "21-23,25,53,80,110-111,135,139,143,443,445,993,995,1723,3306,3389,5900,8080",
"schedule_time" : {
"hour" : 2,
"minute" : 0,
"second" : 0
},
"expand_vhosts" : "1",
"disable_win_cmd_exec" : "1",
"name" : "Weekly Production Scan",
"asset_groups" : [ {
"name" : "name",
"count" : 6,
"id" : 0
}, {
"name" : "name",
"count" : 6,
"id" : 0
} ],
"optimize_test" : "1",
"scan_ports" : [ ]
}'
import http.client
conn = http.client.HTTPSConnection("api-")
headers = { 'User-Agent': "SOME_STRING_VALUE" }
conn.request("POST", "%7Bfqdn%7D/public_api/netscan/v1/scan/definition", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api-/%7Bfqdn%7D/public_api/netscan/v1/scan/definition")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["User-Agent"] = 'SOME_STRING_VALUE'
response = http.request(request)
puts response.read_bodyconst data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api-/%7Bfqdn%7D/public_api/netscan/v1/scan/definition");
xhr.setRequestHeader("User-Agent", "SOME_STRING_VALUE");
xhr.send(data);HttpResponse<String> response = Unirest.post("https://api-/%7Bfqdn%7D/public_api/netscan/v1/scan/definition")
.header("User-Agent", "SOME_STRING_VALUE")
.asString();import Foundation
let headers = ["User-Agent": "SOME_STRING_VALUE"]
let request = NSMutableURLRequest(url: NSURL(string: "https://api-/%7Bfqdn%7D/public_api/netscan/v1/scan/definition")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-/%7Bfqdn%7D/public_api/netscan/v1/scan/definition",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"User-Agent: SOME_STRING_VALUE"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-/%7Bfqdn%7D/public_api/netscan/v1/scan/definition");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "User-Agent: SOME_STRING_VALUE");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://api-/%7Bfqdn%7D/public_api/netscan/v1/scan/definition");
var request = new RestRequest(Method.POST);
request.AddHeader("User-Agent", "SOME_STRING_VALUE");
IRestResponse response = client.Execute(request);Complete scan definition including scan settings, targets, schedule, and credentials
port_list_idintegerPort list ID to use
Port list ID to use
5scan_portsarrayCustom list of ports to scan (overrides port_list_id if provided)
Custom list of ports to scan (overrides port_list_id if provided)
auth_port_sshintegerSSH authentication port
SSH authentication port
22disable_cgi_cachestring (Enum)Disable CGI cache (0 = enabled, 1 = disabled)
Disable CGI cache (0 = enabled, 1 = disabled)
"1"plugins_timeoutintegerPlugin timeout in minutes
Plugin timeout in minutes
5checks_read_timeoutintegerChecks read timeout in minutes
Checks read timeout in minutes
5max_hostsintegerMaximum number of hosts to scan simultaneously
Maximum number of hosts to scan simultaneously
30max_checksintegerMaximum number of checks per host
Maximum number of checks per host
4scanner_plugins_timeoutintegerScanner plugins timeout in seconds
Scanner plugins timeout in seconds
3600timeout_retryintegerNumber of timeout retries
Number of timeout retries
5open_sock_max_attemptsintegerMaximum attempts to open socket
Maximum attempts to open socket
5non_simult_portsstringPorts that should not be scanned simultaneously (comma-separated)
Ports that should not be scanned simultaneously (comma-separated)
"139,445,3389,Services/irc"strict_unauthenticatedstring (Enum)Strict unauthenticated mode (0 = disabled, 1 = enabled)
Strict unauthenticated mode (0 = disabled, 1 = enabled)
"0"optimize_teststring (Enum)Optimize test execution (0 = disabled, 1 = enabled)
Optimize test execution (0 = disabled, 1 = enabled)
"1"expand_vhostsstring (Enum)Expand virtual hosts (0 = disabled, 1 = enabled)
Expand virtual hosts (0 = disabled, 1 = enabled)
"1"exclude_fragile_devicesstring (Enum)Exclude fragile devices (0 = disabled, 1 = enabled)
Exclude fragile devices (0 = disabled, 1 = enabled)
"1"exclude_printersstring (Enum)Exclude printers (0 = disabled, 1 = enabled)
Exclude printers (0 = disabled, 1 = enabled)
"1"safe_checksstring (Enum)Enable safe checks (0 = disabled, 1 = enabled)
Enable safe checks (0 = disabled, 1 = enabled)
"1"disable_win_cmd_execstring (Enum)Disable Windows command execution (0 = disabled, 1 = enabled)
Disable Windows command execution (0 = disabled, 1 = enabled)
"1"disable_wmi_searchstring (Enum)Disable WMI search (0 = disabled, 1 = enabled)
Disable WMI search (0 = disabled, 1 = enabled)
"1"alive_test_methodsarray[string]Methods to test if hosts are alive
Methods to test if hosts are alive
["arp","icmp","tcp_ack"]alive_test_portsstringPorts to use for alive testing (comma-separated or ranges)
Ports to use for alive testing (comma-separated or ranges)
"21-23,25,53,80,110-111,135,139,143,443,445,993,995,1723,3306,3389,5900,8080"definition_idintegerID of existing definition (for updates)
ID of existing definition (for updates)
123vt_config_idintegerrequiredVulnerability test configuration template ID
Vulnerability test configuration template ID
4namestringrequiredName of the scan definition
Name of the scan definition
"Weekly Production Scan"descriptionstringrequiredDescription of the scan definition
Description of the scan definition
"Weekly security scan for production servers"network_scanner_idsarray[string]requiredArray of network scanner UUIDs to use for this scan
Array of network scanner UUIDs to use for this scan
["scanner-1","scanner-2"]networkintegerrequiredNetwork ID
Network ID
1credential_idsarray[integer]requiredArray of credential IDs for authenticated scanning
Array of credential IDs for authenticated scanning
[1]schedule_cadencestring (Enum)requiredSchedule cadence frequency
Schedule cadence frequency
"DAILY"schedule_daysintegerrequiredScheduled days as bitmask (127 = all days)
Scheduled days as bitmask (127 = all days)
127schedule_datesarray[integer]requiredArray of scheduled dates (for monthly cadence)
Array of scheduled dates (for monthly cadence)
schedule_start_dateintegerrequiredint64Schedule start date as Unix timestamp in milliseconds
Schedule start date as Unix timestamp in milliseconds
1765083183326schedule_timeobjectTime of day specification for scan scheduling
Time of day specification for scan scheduling
hourintegerrequiredHour of the day (0-23)
Hour of the day (0-23)
2minuteintegerrequiredMinute of the hour (0-59)
Minute of the hour (0-59)
secondintegerrequiredSecond of the minute (0-59)
Second of the minute (0-59)
schedule_quiet_hoursarrayrequiredArray of quiet hours periods when scanning should not run
Array of quiet hours periods when scanning should not run
startobjectTime of day specification for scan scheduling
Time of day specification for scan scheduling
hourintegerrequiredHour of the day (0-23)
Hour of the day (0-23)
2minuteintegerrequiredMinute of the hour (0-59)
Minute of the hour (0-59)
secondintegerrequiredSecond of the minute (0-59)
Second of the minute (0-59)
endobjectTime of day specification for scan scheduling
Time of day specification for scan scheduling
hourintegerrequiredHour of the day (0-23)
Hour of the day (0-23)
2minuteintegerrequiredMinute of the hour (0-59)
Minute of the hour (0-59)
secondintegerrequiredSecond of the minute (0-59)
Second of the minute (0-59)
schedule_timezonestringrequiredTimezone for scheduling (IANA timezone format)
Timezone for scheduling (IANA timezone format)
"America/Los_Angeles"override_target_exclusionsbooleanrequiredWhether to override global target exclusions
Whether to override global target exclusions
target_idsarray[integer]requiredArray of target group IDs
Array of target group IDs
targetsarray[string]requiredArray of target hosts or IP ranges (CIDR notation)
Array of target hosts or IP ranges (CIDR notation)
["192.168.1.0/24","10.0.0.1-10.0.0.100"]excluded_targetsarray[string]requiredArray of excluded targets
Array of excluded targets
[""]enable_reportbooleanrequiredWhether to enable scan reporting
Whether to enable scan reporting
trueasset_groupsarray
idintegerrequired
namestring
countinteger
[application/json; charset=UTF-8 content]