Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Prior to Hillary R1, the locations/target configuration could be created and edited via the iQSonar  user interface, or optionally by uploading a CSV file. The facility to modify (add and remove) target configurations via the RestAPI was initially introduced in Hillary R1 and further refined in Hillary R2. At the time of writing, the facility to modify credentials is still restricted to CSV import or manual editing via the User Interface

Instructions

Target configuration via the RestAPI relies on data stored in the JSON file format, rather than CSV files. The data stored in the file is the same, but the format of the file is quite different. To edit a JSON file and text editor can be used (for example Notepad) but an editor specifically designed for use by Programmers (for example Notepad++) would be preferred.

...

FieldDescriptionCan be empty?Example or Possible Values
LocationPathName of the location. Sub-locations seperated by the pipe symbol "|"NOSample|Node
Sample|Node2|Leaf1
Sample|Node2|Leaf2
TargetWhat category of target is this (Either Application or Device)NODevice
Application
TypeWhat sub-type of target is this (What type of Device, or Which Application)NOSee the list of valid target types
NameThe name of the location (This is a freeform text field)NOMain Lab
QA Lab
My Test Location
Instance NameThe name of the database instanceYESFor scanning database application targets
HostnameThe host name for hostname targetsYESvm-test.localdomain
www.myserver.example.com
vm-myserver
StartIPThe Start IP Address - use this for Application targets, Single, Range and Subnet targetsYES10.0.0.1
EndIPThe End IP Address - use this for Range targets onlyYES10.0.0.99
SubnetMaskThe netmask - as a number not as a dotted quat quad - use for Subnet targets onlyYESUse "24" not "255.255.255.0"
"0" can be used for an empty target
PortThe port on which to scan, for Application Targets onlyYESE.g. scan a web server on port 80 usually, but might also be port 8080
ExclusionWhether this is a target exclusion. Use to exclude IP addresses from a larger listYESMust be "True" or "False". Empty implies False

...

Code Block
languagejs
titleJSON Datafile
collapsetrue
{
    "Name":"LOCATION TARGET",
    "Version":"1.3",
	"Locations":
	[
		{
			"LocationPath":"Demo|TestScan",
			"Target":"Device",
			"Type":"Hostname",
			"Name":"Hostname Target 1",
			"InstanceName":"",	
			"Hostname":"vm-myserver",
			"StartIP":"",
			"EndIP":"",
			"SubnetMask":"0",
			"Port":"",
			"Exclusion":""
		},
		{
			"LocationPath":"Demo|TestScan",
			"Target":"Device",
			"Type":"Single",
			"Name":"Single IP Address",
			"InstanceName":"",	
			"Hostname":"",
			"StartIP":"10.0.0.1",
			"EndIP":"",
			"SubnetMask":"0",
			"Port":"",
			"Exclusion":""
		},
		{
			"LocationPath":"Demo|TestScan",
			"Target":"Device",
			"Type":"Range",
			"Name":"Multiple IP Addresses",
			"InstanceName":"",	
			"Hostname":"",
			"StartIP":"10.0.0.2",
			"EndIP":"10.0.0.99",
			"SubnetMask":"0",
			"Port":"",
			"Exclusion":""
		},
		{
			"LocationPath":"Demo|SecondNetwork",
			"Target":"Device",
			"Type":"Subnet",
			"Name":"Different network",
			"InstanceName":"",	
			"Hostname":"",
			"StartIP":"192.168.1.0",
			"EndIP":"",
			"SubnetMask":"24",
			"Port":"",
			"Exclusion":""
		}
	]
}

...