[Bug]: Initialize-MonkeyScan iterates through directories unnecessarily
Installed monkey365 using: Install-Module -Scope CurrentUser -Name monkey365
Used 'Get-Help Invoke-Monkey365 -Examples' -- example 1. $assets = Invoke-Monkey365 -ExportTo CSV -PromptBehavior SelectAccount -IncludeEntraID -Instance Microsoft365 -Collect SharePointOnline
The following warning was observed: WARNING: File exchange-atp-safe-attachments-for-sharepoint-onedrive-and-teams-disabled.json was not found in C:\Users<redacted>\OneDrive - <REDACTED>\Documents\WindowsPowerShell\Modules\monkey365\0.95.2\rules\findings
There were numerous JSON files in the directory hierarchy but confirmed that one is not included. No output was generated by the execution. The $assets variable is empty after running the module.
Hi @bill-e-ghote thanks for submitting this. It's really appreciated.
Regarding the empty $assets variable, and according to the above screenshot, it seems that Monkey365 was unable to establish connection with your tenant. Common issues is lack of permissions to the desired portal, conditional access in place, application permission issues etc.. You can see within console logs that the tool is unable to get information about the account that is executing the tool (basically information about your user/application).
Secondly, you're right and it seems that there is a logic issue when listing collector's folders, so I will add this as an issue. Additionally, Monkey365 should stop processing subsequent operations if no connections are in place, so this definitely should be revised.
Hi @bill-e-ghote I believe it's now fixed on dev branch.
Please, also note that Windows uses a path length limitation (MAX_PATH) of 256 characters and I realised that the path in which monkey365 is installed is too long (potentially more than 250 chars). I've also tested monkey365 with the MAX_PATH registry value disabled and I get the same warning as you.
Thanks,
This issue has been automatically marked as stale because it has not had recent activity. We kindly ask you to check again if the issue you reported is still relevant in the current version of Monkey365. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.
This issue was closed because it has been inactive for 14 days since being marked as stale. If the issue is still relevant, feel free to re-open it or open a new one.