Skip to content

Commit d4c3704

Browse files
committed
update monkey365
1 parent 755ff80 commit d4c3704

2 files changed

Lines changed: 41 additions & 9 deletions

File tree

Invoke-Monkey365.ps1

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ Function Invoke-Monkey365{
305305
[Parameter(Mandatory=$false, HelpMessage="Force to load MSAL Desktop PowerShell Core on Windows")]
306306
[Switch]$ForceMSALDesktop,
307307

308+
[Parameter(Mandatory=$false, HelpMessage="Pass tokens from others tools, such as az cli")]
309+
[Object]$AccessToken,
310+
308311
[Parameter(Mandatory=$false, HelpMessage="List available collectors")]
309312
[Switch]$ListCollector,
310313

@@ -396,13 +399,13 @@ Function Invoke-Monkey365{
396399
}
397400
#Add parameters for Microsoft365 instance
398401
If($null -ne (Get-Variable -Name Instance -ErrorAction Ignore) -and $Instance -eq 'Microsoft365'){
399-
#Create the -ScanSites string parameter
402+
#Create the -SpoSites string parameter
400403
$attributeCollection = New-Object -TypeName System.Collections.ObjectModel.Collection[System.Attribute]
401404
# define a new parameter attribute
402405
$rg_attr_name = New-Object System.Management.Automation.ParameterAttribute
403406
$rg_attr_name.Mandatory = $false
404407
$attributeCollection.Add($rg_attr_name)
405-
$rg_pname = 'ScanSites'
408+
$rg_pname = 'SpoSites'
406409
$rg_type_dynParam = New-Object -TypeName System.Management.Automation.RuntimeDefinedParameter($rg_pname,
407410
[string[]], $attributeCollection)
408411
$paramDictionary.Add($rg_pname, $rg_type_dynParam)
@@ -595,8 +598,26 @@ Function Invoke-Monkey365{
595598
################### End Validate parameters #####################
596599
#Initialize authentication parameters
597600
Initialize-AuthenticationParam
598-
#Connect
599-
Connect-MonkeyCloud
601+
If($PSBoundParameters.ContainsKey('AccessToken') -and $PSBoundParameters['AccessToken']){
602+
Import-ExternalAccessToken -InputObject $PSBoundParameters['AccessToken']
603+
If($O365Object.auth_tokens.GetEnumerator().Where({$null -ne $_.value}).Count -gt 0){
604+
Connect-MonkeyCloud -Connected
605+
}
606+
Else{
607+
$msg = @{
608+
MessageData = ($message.ConnectImportTokenErrorMessage);
609+
callStack = (Get-PSCallStack | Select-Object -First 1);
610+
logLevel = 'warning';
611+
InformationAction = $O365Object.InformationAction;
612+
Tags = @('Monkey365ExternalAccessTokenError');
613+
}
614+
Write-Warning @msg
615+
}
616+
}
617+
Else{
618+
#Connect
619+
Connect-MonkeyCloud
620+
}
600621
#Start Watcher
601622
If($null -ne (Get-Command -Name "Watch-AccessToken" -ErrorAction ignore)){
602623
Watch-AccessToken

monkey365.psd1

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
RootModule = 'monkey365.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.96'
15+
ModuleVersion = '0.96.5'
1616

1717
# Supported PSEditions
18-
# CompatiblePSEditions = @()
18+
CompatiblePSEditions = @('Desktop', 'Core')
1919

2020
# ID used to uniquely identify this module
2121
GUID = 'b040dfab-f762-4ce1-bcc4-1b3963603ff1'
@@ -27,7 +27,7 @@ Author = 'Juan Garrido'
2727
CompanyName = 'monkey365'
2828

2929
# Copyright statement for this module
30-
Copyright = '(c)2021 Juan Garrido. All rights reserved.'
30+
Copyright = '(c)2021-2026 Juan Garrido. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
3333
Description = 'Monkey365 provides a tool that enables security consultants to efficiently perform security configuration reviews across Microsoft 365, Azure subscriptions, and Microsoft Entra ID.'
@@ -74,7 +74,7 @@ NestedModules = @(
7474
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
7575
FunctionsToExport = @(
7676
'Invoke-Monkey365',
77-
'Get-MonkeyJobError'
77+
'Get-MonkeyJobError',
7878
'Convert-MarkDownToHtml',
7979
'Convert-MarkDownToPlainText',
8080
'Copy-PsObject',
@@ -116,6 +116,10 @@ PrivateData = @{
116116
"Microsoft365-Security",
117117
"Azure",
118118
"AzureAD",
119+
'EntraID',
120+
'Security-Assessment',
121+
'Cloud-Security',
122+
'Configuration-Review',
119123
"EntraID-Security-Assessment",
120124
"Microsoft-Entra",
121125
"Cloud-Security-Configuration-Review",
@@ -134,10 +138,17 @@ PrivateData = @{
134138
# A URL to an icon representing this module.
135139
IconUri = 'https://user-images.githubusercontent.com/5271640/181045413-1d17333c-0533-404a-91be-2070ccc6ee29.png'
136140

141+
# Repository URI and Bug tracker
142+
RepositoryUri = 'https://github.com/silverhack/monkey365'
143+
BugTrackerUri = 'https://github.com/silverhack/monkey365/issues'
144+
137145
#Prerelease = 'beta'
138146

139147
# ReleaseNotes of this module
140-
ReleaseNotes = '*'
148+
ReleaseNotes = 'https://github.com/silverhack/monkey365/releases'
149+
150+
# Set true to require explicit acceptance when using Install-Module
151+
RequireLicenseAcceptance = $false
141152

142153
# External dependent modules of this module
143154
# ExternalModuleDependencies = ''

0 commit comments

Comments
 (0)