monkey365 icon indicating copy to clipboard operation
monkey365 copied to clipboard

Ability to expand the JSON depth limit beyond 10

Open localneeds opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Yes. After successfully completing a scan targeted at a specific Azure subscription. The export parameter was ExportTo = 'HTML'. After the scan process completes error-free the following message appears: WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 10.

This message is typically related to either the ConvertTo-Json or ConvertFrom-Json PowerShell commands. I ran my Azure scan with WriteLog = $true parameter and found nothing in the resulting log that clearly corresponded to this warning. The only suspect was several instances of this being logged:

[Convert-RawData] - Conversion from JSON failed with error: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. - verbose

The message in the console after the scan was only a warning (not an error). But there is still a concern is that the final output is missing data due to this truncation.

Describe the solution you'd like I would like to be able to declare a higher depth limit. This is a native with the ConvertTo-Json & ConvertFrom-Json cmdlets via the -Depth parameter

Describe alternatives you've considered Since I cannot find any corresponding entry in the logs for this specific message, alternative actions are very limited. Short of fully executing the various module functions one at a time, I am unsure what, if any, workarounds are possible.

Additional context json-truncation-message

localneeds avatar Apr 24 '24 23:04 localneeds

Hi @localneeds,

Firstly, thank you for the detailed report. It's really appreciated. I can confirm that it's a bug and will be fixed shortly. I'm currently working in improvements for JSON,CSV and HTML outputs.

As you mention, there is an issue with large json objects and when depth flag is not set. There are some discussions within the PowerShell Github about that.

I'll investigate it and I will let you know once a patch is available.

Many thanks for your report and for using Monkey365. Cheers,

silverhack avatar Apr 25 '24 14:04 silverhack

HI @localneeds,

Depth for JSON output was modified in main branch, but I'm experiencing some issues with data extracted from Exchange Online. I'll leave this opened, since JSON and CSV options will be updated sooner than later, and hopefully in the next version of Monkey365. Please, check #76 for more details.

Cheers,

silverhack avatar Jun 10 '24 17:06 silverhack

Hi all,

Main branch was updated with a new schema for all output formats. Please, raise an issue if you find any problem.

Thanks,

silverhack avatar Sep 10 '24 11:09 silverhack