Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-12235

Assets Discovery - Text file IP range is NOT subtracted from a noted Scan Setting Range

      Issue Summary

      This is reproducible on Data Center: (yes)

      Discovery - any version.

      Discovery>Scan Setting tab supports various combinations of statements to compile the list of IPs to be scanned. This includes an IP range indicated withing a text file.
      Discovery can also use modifiers e.g. '!' to exclude an IP/Range from the List to scan.

      However, the Modifier does not work exactly the same when using a combination of an IP range and a Text file:
      Assuming a text file "IPRange.text" contains the following IP range: 10.0.0.10-15:
      See the following cases:

        Scan Setting IP range Actual number of IPs to be scanned Expected number of IPs to be scanned
      1 10.0.0.1-9;IPRange.text 15 15
      2 10.0.0.1-9;IPRange.text! 9 9
      3 10.0.0.0/24;10.0.0.10-15! 248 248
      4 10.0.0.0/24;IPRange.text! 254 248

       

       

      Steps to Reproduce

      1. In the .../Discovery folder (Disco Installation folder) save a text file:  .txt file containg the IP range: 10.0.0.10-15
      2. Configure 4 Scan settings in Discovery each with a range as indicated above
      3. Execute Discovery.exe -r <scan setting ID> for each of the scan settings
      4. check the logs - each main log's header (log named with 00000) for the List of IPs to scan

      Expected Results

      See table above, and below - logs for cases #1-3

       

      <1>
      12-Dec-2022 15:11:43 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
      12-Dec-2022 15:11:43 : ScanSetting: 00001 with entire Range: 10.0.0.1-9;IPRange.txt
      12-Dec-2022 15:11:43 : Generating list of IP's to scan from range: 10.0.0.1-9
      12-Dec-2022 15:11:43 : Generating list of IP's to scan from range: 10.0.0.10-15
      12-Dec-2022 15:11:43 : Getting 15 IP's to scan.
      
      <2>
      12-Dec-2022 15:11:51 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
      12-Dec-2022 15:11:51 : ScanSetting: 00002 with entire Range: 10.0.0.1-9;IPRange.txt!
      12-Dec-2022 15:11:51 : Can't generating ip list from range: IPRange.txt
      12-Dec-2022 15:11:51 : Generating list of IP's to scan from range: 10.0.0.1-9
      12-Dec-2022 15:11:51 : Getting 9 IP's to scan.
      
      <3>
      12-Dec-2022 15:11:55 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
      12-Dec-2022 15:11:55 : ScanSetting: 00003 with entire Range: 10.0.0.0/24;10.0.0.10-15!
      12-Dec-2022 15:11:55 : Generating list of IP's to scan from range: 10.0.0.0/24
      12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.10
      12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.11
      12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.12
      12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.13
      12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.14
      12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.15
      12-Dec-2022 15:11:55 : Getting 248 IP's to scan. 

       

      Actual Results

      The file is ignored BEFORE calculating the IP range (see Case 2 log above).
      See table above, and below - log for case #4
      "Can't generate ip list from range: IPRange.txt"

      <4>
      12-Dec-2022 15:12:00 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
      12-Dec-2022 15:12:00 : ScanSetting: 00004 with entire Range: 10.0.0.0/24;IPRange.txt!
      12-Dec-2022 15:12:00 : Can't generating ip list from range: IPRange.txt
      12-Dec-2022 15:12:00 : Generating list of IP's to scan from range: 10.0.0.0/24
      12-Dec-2022 15:12:00 : Getting 254 IP's to scan.

      Workaround

      Create a duplicated file, e.g. IPRangeNegate.txt indicating the IP range with the ! modifier IN the file: 10.0.0.10-11!
      This means that any change to one file requires the other file to be maintained as well.

      Use Case:

      I have one IP range of iOS devices stated in a text file, and scanned with scan setting id 00001. The rest of my Subnet is Linux devices scanned in scan setting id 00002.
      As a customer, I would like to maintain one text file with the IP range of my iOS Hosts, while not scanning these IPs when scanning the full Subnet range, hence Scan setting 0002 should ignor the IPs already scanned in Scan setting 0001 ...

            [JSDSERVER-12235] Assets Discovery - Text file IP range is NOT subtracted from a noted Scan Setting Range

            Marek Parfianowicz made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 781728 ]
            Marek Parfianowicz made changes -
            Fix Version/s Original: 3.1.8 [ 61995 ]
            Marek Parfianowicz made changes -
            Fix Version/s New: Discovery 3.1.8 [ 105616 ]
            Zakhar Listiev made changes -
            Fix Version/s New: 3.1.8 [ 61995 ]
            Zakhar Listiev made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Viktor Kryvoruchko (Inactive) made changes -
            Status Original: In Progress [ 3 ] New: Waiting for Release [ 12075 ]
            SET Analytics Bot made changes -
            Support reference count New: 1
            Viktor Kryvoruchko (Inactive) made changes -
            Status Original: Needs Triage [ 10030 ] New: In Progress [ 3 ]
            Zakhar Listiev made changes -
            Assignee New: Viktor Kryvoruchko [ 21ad8969f413 ]
            Yinon Negev made changes -
            Description Original: h3. Issue Summary

            This is reproducible on Data Center: (yes)

            Discovery - any version.

            Discovery>[Scan Setting tab|https://confluence.atlassian.com/insightapps/scan-settings-1085180664.html] supports various combinations of statements to compile the list of IPs to be scanned. This includes an IP range indicated withing a text file.
            Discovery can also use modifiers e.g. '!' to exclude an IP/Range from the List to scan.

            However, the Modifier does not work exactly the same when using a combination of an IP range and a Text file:
            Assuming a text file "IPRange.text" contains the following IP range: 10.0.0.10-15:
            See the following cases:
            || ||Scan Setting IP range||Actual number of IPs to be scanned||Expected number of IPs to be scanned||
            |1|10.0.0.1-9;IPRange.text|15 (/)|15|
            |2|10.0.0.1-9;IPRange.text!|9 (/)|9|
            |3|10.0.0.0/24;10.0.0.10-15!|248 (/)|248|
            |4|10.0.0.0/24;IPRange.text{*}!{*}|254 (x) |248|

             

             
            h3. Steps to Reproduce
             # In the .../Discovery folder (Disco Installation folder) save a text file:  .txt file containg the IP range: 10.0.0.10-15
             # Configure 4 Scan settings in Discovery each with a range as indicated above
             # Execute Discovery.exe -r <scan setting ID> for each of the scan settings
             # check the logs - each main log's header (log named with 00000) for the List of IPs to scan

            h3. Expected Results

            See table above, and below - logs for cases #1-3

             
            {code:java}
            <1>
            12-Dec-2022 15:11:43 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:11:43 : ScanSetting: 00001 with entire Range: 10.0.0.1-9;IPRange.txt
            12-Dec-2022 15:11:43 : Generating list of IP's to scan from range: 10.0.0.1-9
            12-Dec-2022 15:11:43 : Generating list of IP's to scan from range: 10.0.0.10-15
            12-Dec-2022 15:11:43 : Getting 15 IP's to scan.

            <2>
            12-Dec-2022 15:11:51 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:11:51 : ScanSetting: 00002 with entire Range: 10.0.0.1-9;IPRange.txt!
            12-Dec-2022 15:11:51 : Can't generating ip list from range: IPRange.txt
            12-Dec-2022 15:11:51 : Generating list of IP's to scan from range: 10.0.0.1-9
            12-Dec-2022 15:11:51 : Getting 9 IP's to scan.

            <3>
            12-Dec-2022 15:11:55 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:11:55 : ScanSetting: 00003 with entire Range: 10.0.0.0/24;10.0.0.10-15!
            12-Dec-2022 15:11:55 : Generating list of IP's to scan from range: 10.0.0.0/24
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.10
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.11
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.12
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.13
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.14
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.15
            12-Dec-2022 15:11:55 : Getting 248 IP's to scan. {code}
             
            h3. Actual Results

            The file is ignored BEFORE calculating the IP range.
            See table above, and below - log for case #4
            "Can't generate ip list from range: IPRange.txt"
            {noformat}
            <4>
            12-Dec-2022 15:12:00 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:12:00 : ScanSetting: 00004 with entire Range: 10.0.0.0/24;IPRange.txt!
            12-Dec-2022 15:12:00 : Can't generating ip list from range: IPRange.txt
            12-Dec-2022 15:12:00 : Generating list of IP's to scan from range: 10.0.0.0/24
            12-Dec-2022 15:12:00 : Getting 254 IP's to scan.{noformat}
            h3. Workaround

            Create a duplicated file, e.g. IPRangeNegate.txt indicating the IP range with the ! modifier IN the file: 10.0.0.10-11!
            This means that any change to one file requires the other file to be maintained as well.
            h4. Use Case:

            I have one IP range of iOS devices stated in a text file, and scanned with scan setting id 00001. The rest of my Subnet is Linux devices scanned in scan setting id 00002.
            As a customer, I would like to maintain one text file with the IP range of my iOS Hosts, while not scanning these IPs when scanning the full Subnet range, hence Scan setting 0002 should ignor the IPs already scanned in Scan setting 0001 ...
            New: h3. Issue Summary

            This is reproducible on Data Center: (yes)

            Discovery - any version.

            Discovery>[Scan Setting tab|https://confluence.atlassian.com/insightapps/scan-settings-1085180664.html] supports various combinations of statements to compile the list of IPs to be scanned. This includes an IP range indicated withing a text file.
            Discovery can also use modifiers e.g. '!' to exclude an IP/Range from the List to scan.

            However, the Modifier does not work exactly the same when using a combination of an IP range and a Text file:
            Assuming a text file "IPRange.text" contains the following IP range: 10.0.0.10-15:
            See the following cases:
            || ||Scan Setting IP range||Actual number of IPs to be scanned||Expected number of IPs to be scanned||
            |1|10.0.0.1-9;IPRange.text|15 (/)|15|
            |2|10.0.0.1-9;IPRange.text!|9 (/)|9|
            |3|10.0.0.0/24;10.0.0.10-15!|248 (/)|248|
            |4|10.0.0.0/24;IPRange.text{*}!{*}|254 (x)|248|

             

             
            h3. Steps to Reproduce
             # In the .../Discovery folder (Disco Installation folder) save a text file:  .txt file containg the IP range: 10.0.0.10-15
             # Configure 4 Scan settings in Discovery each with a range as indicated above
             # Execute Discovery.exe -r <scan setting ID> for each of the scan settings
             # check the logs - each main log's header (log named with 00000) for the List of IPs to scan

            h3. Expected Results

            See table above, and below - logs for cases #1-3

             
            {code:java}
            <1>
            12-Dec-2022 15:11:43 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:11:43 : ScanSetting: 00001 with entire Range: 10.0.0.1-9;IPRange.txt
            12-Dec-2022 15:11:43 : Generating list of IP's to scan from range: 10.0.0.1-9
            12-Dec-2022 15:11:43 : Generating list of IP's to scan from range: 10.0.0.10-15
            12-Dec-2022 15:11:43 : Getting 15 IP's to scan.

            <2>
            12-Dec-2022 15:11:51 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:11:51 : ScanSetting: 00002 with entire Range: 10.0.0.1-9;IPRange.txt!
            12-Dec-2022 15:11:51 : Can't generating ip list from range: IPRange.txt
            12-Dec-2022 15:11:51 : Generating list of IP's to scan from range: 10.0.0.1-9
            12-Dec-2022 15:11:51 : Getting 9 IP's to scan.

            <3>
            12-Dec-2022 15:11:55 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:11:55 : ScanSetting: 00003 with entire Range: 10.0.0.0/24;10.0.0.10-15!
            12-Dec-2022 15:11:55 : Generating list of IP's to scan from range: 10.0.0.0/24
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.10
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.11
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.12
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.13
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.14
            12-Dec-2022 15:11:55 : Ignoring IP: 10.0.0.15
            12-Dec-2022 15:11:55 : Getting 248 IP's to scan. {code}
             
            h3. Actual Results

            The file is ignored BEFORE calculating the IP range (see Case 2 log above).
            See table above, and below - log for case #4
            "Can't generate ip list from range: IPRange.txt"
            {noformat}
            <4>
            12-Dec-2022 15:12:00 : --------------- Start Discovery (3.1.6.0 - 6CBD1) scan ---------------
            12-Dec-2022 15:12:00 : ScanSetting: 00004 with entire Range: 10.0.0.0/24;IPRange.txt!
            12-Dec-2022 15:12:00 : Can't generating ip list from range: IPRange.txt
            12-Dec-2022 15:12:00 : Generating list of IP's to scan from range: 10.0.0.0/24
            12-Dec-2022 15:12:00 : Getting 254 IP's to scan.{noformat}
            h3. Workaround

            Create a duplicated file, e.g. IPRangeNegate.txt indicating the IP range with the ! modifier IN the file: 10.0.0.10-11!
            This means that any change to one file requires the other file to be maintained as well.
            h4. Use Case:

            I have one IP range of iOS devices stated in a text file, and scanned with scan setting id 00001. The rest of my Subnet is Linux devices scanned in scan setting id 00002.
            As a customer, I would like to maintain one text file with the IP range of my iOS Hosts, while not scanning these IPs when scanning the full Subnet range, hence Scan setting 0002 should ignor the IPs already scanned in Scan setting 0001 ...

              21ad8969f413 Viktor Kryvoruchko (Inactive)
              8cdc82c96fd5 Yinon Negev
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: