When the auto-add sudo is enabled, the hostname and other attributes of macOS patterns contain invalid characters, causing the scan to fail

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • Discovery 8.0.0
    • Affects Version/s: Discovery 7.0.0, Discovery 7.1.2, Discovery 7.1.4
    • Component/s: Assets Discovery
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      When the auto-add sudo is enabled, the hostname and other attributes of macOS patterns contain invalid characters, causing the scan to fail with the Error: Mandatory Hostname missing error. 

      7/24/2025 3:59:24 PM: [Normal] Using pattern: MacOSX_Hostinfo_FQDN (v1.1.0)
      7/24/2025 3:59:24 PM: [Debug] Auto add sudo is checked, the command is changed to: sudo host "$(hostname -s)"
      7/24/2025 3:59:24 PM: [Debug] Terminal raw result:ssudo host "$(hostname -s)" | col -b[?2004l
      
      testing.test.com has address 123.45.67.890
      %  
      7/24/2025 3:59:24 PM: [Debug] Command: sudo host "$(hostname -s)"
      7/24/2025 3:59:24 PM: [Debug] Result: s[?2004l                                                                             
      7/24/2025 3:59:24 PM: [Error] Error: Mandatory Hostname missing for: 123.45.67.890
      

      Steps to Reproduce

      1. Install Assets Discovery
      2. Enable the Auto add sudo on the Common tab;
      3. Set the Log Level to DEBUG;
      4. Configure a macOS IP to scan;
      5. Configure Credentials;
      6. Perform the Scan;
      7. Verify the output of the Assets Discovery logs

      Expected Results

      The Mac device will be successfully scanned when Auto Add Sudo is enabled;

      Actual Results

      The scan will fail with the following error message due to the invalid characters in the hostname result:

      7/24/2025 3:59:24 PM: [Error] Error: Mandatory Hostname missing for: 123.45.67.890

      Workaround

      Disable the auto-add sudo.

            Assignee:
            Unassigned
            Reporter:
            Rodrigo Jose Zaparoli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: