diff --git a/source/Private/Get-CISMSTeamsOutput.ps1 b/source/Private/Get-CISMSTeamsOutput.ps1 index 9c439ce..d07d8f4 100644 --- a/source/Private/Get-CISMSTeamsOutput.ps1 +++ b/source/Private/Get-CISMSTeamsOutput.ps1 @@ -135,7 +135,6 @@ function Get-CISMSTeamsOutput { # - Condition A: `AllowAnonymousUsersToJoinMeeting` is not set to `False`. # - Condition B: Verification using the UI shows that `Anonymous users can join a meeting` is not set to `Off` in the Global meeting policy. # - Condition C: PowerShell command output indicates that anonymous users are allowed to join meetings. - # Connect to Teams PowerShell using Connect-MicrosoftTeams # $teamsMeetingPolicy Mock Object <# diff --git a/source/tests/Test-BlockChannelEmails.ps1 b/source/tests/Test-BlockChannelEmails.ps1 index 0468ed0..4816471 100644 --- a/source/tests/Test-BlockChannelEmails.ps1 +++ b/source/tests/Test-BlockChannelEmails.ps1 @@ -5,16 +5,14 @@ function Test-BlockChannelEmails { # Aligned # Parameters can be added here if needed ) - begin { # Dot source the class script if necessary #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.1.2" + Write-Verbose "Running Test-BlockChannelEmails for $recnum..." } - process { - try { # 8.1.2 (L1) Ensure users can't send emails to a channel email address # @@ -31,11 +29,9 @@ function Test-BlockChannelEmails { # - Condition A: The `AllowEmailIntoChannel` setting in Teams is not set to `False`. # - Condition B: The setting `Users can send emails to a channel email address` is not set to `Off` in the Teams admin center. # - Condition C: Verification using PowerShell indicates that the `AllowEmailIntoChannel` setting is enabled. - # Retrieve Teams client configuration $teamsClientConfig = Get-CISMSTeamsOutput -Rec $recnum $allowEmailIntoChannel = $teamsClientConfig.AllowEmailIntoChannel - # Prepare failure reasons and details based on compliance $failureReasons = if ($allowEmailIntoChannel) { "Emails can be sent to a channel email address" # Condition A Fail: AllowEmailIntoChannel is True @@ -43,14 +39,12 @@ function Test-BlockChannelEmails { else { "N/A" # Condition A Pass: AllowEmailIntoChannel is False } - $details = if ($allowEmailIntoChannel) { "AllowEmailIntoChannel is set to True" # Condition B Fail: Emails are allowed } else { "AllowEmailIntoChannel is set to False" # Condition B Pass: Emails are blocked } - # Create and populate the CISAuditResult object $params = @{ Rec = $recnum @@ -66,7 +60,6 @@ function Test-BlockChannelEmails { $auditResult = Get-TestError -LastError $LastError -recnum $recnum } } - end { # Return the audit result return $auditResult diff --git a/source/tests/Test-DialInBypassLobby.ps1 b/source/tests/Test-DialInBypassLobby.ps1 index 08cf2af..6526715 100644 --- a/source/tests/Test-DialInBypassLobby.ps1 +++ b/source/tests/Test-DialInBypassLobby.ps1 @@ -5,16 +5,14 @@ function Test-DialInBypassLobby { # Aligned # Parameters can be defined here if needed ) - begin { # Dot source the class script if necessary #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.5.4" + Write-Verbose "Running Test-DialInBypassLobby for $recnum..." } - process { - try { # 8.5.4 (L1) Ensure users dialing in can't bypass the lobby # @@ -40,7 +38,6 @@ function Test-DialInBypassLobby { #> $CsTeamsMeetingPolicyPSTN = Get-CISMSTeamsOutput -Rec $recnum $PSTNBypassDisabled = -not $CsTeamsMeetingPolicyPSTN.AllowPSTNUsersToBypassLobby - # Prepare failure reasons and details based on compliance $failureReasons = if (-not $PSTNBypassDisabled) { "Users dialing in can bypass the lobby" @@ -48,14 +45,12 @@ function Test-DialInBypassLobby { else { "N/A" } - $details = if ($PSTNBypassDisabled) { "AllowPSTNUsersToBypassLobby is set to False" } else { "AllowPSTNUsersToBypassLobby is set to True" } - # Create and populate the CISAuditResult object $params = @{ Rec = $recnum @@ -71,7 +66,6 @@ function Test-DialInBypassLobby { $auditResult = Get-TestError -LastError $LastError -recnum $recnum } } - end { # Return the audit result return $auditResult diff --git a/source/tests/Test-MeetingChatNoAnonymous.ps1 b/source/tests/Test-MeetingChatNoAnonymous.ps1 index c84a2ea..5e281b7 100644 --- a/source/tests/Test-MeetingChatNoAnonymous.ps1 +++ b/source/tests/Test-MeetingChatNoAnonymous.ps1 @@ -10,6 +10,7 @@ function Test-MeetingChatNoAnonymous { #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.5.5" + Write-Verbose "Running Test-MeetingChatNoAnonymous for $recnum..." } process { try { diff --git a/source/tests/Test-NoAnonymousMeetingJoin.ps1 b/source/tests/Test-NoAnonymousMeetingJoin.ps1 index 4dc3cfc..d9d82dd 100644 --- a/source/tests/Test-NoAnonymousMeetingJoin.ps1 +++ b/source/tests/Test-NoAnonymousMeetingJoin.ps1 @@ -10,6 +10,7 @@ function Test-NoAnonymousMeetingJoin { #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.5.1" + Write-Verbose "Running Test-NoAnonymousMeetingJoin for $recnum..." } process { try { diff --git a/source/tests/Test-NoAnonymousMeetingStart.ps1 b/source/tests/Test-NoAnonymousMeetingStart.ps1 index f1ea675..cb92a64 100644 --- a/source/tests/Test-NoAnonymousMeetingStart.ps1 +++ b/source/tests/Test-NoAnonymousMeetingStart.ps1 @@ -10,6 +10,7 @@ function Test-NoAnonymousMeetingStart { #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.5.2" + Write-Verbose "Running Test-NoAnonymousMeetingStart for $recnum..." } process { try { diff --git a/source/tests/Test-OrgOnlyBypassLobby.ps1 b/source/tests/Test-OrgOnlyBypassLobby.ps1 index 785a85e..b3213a1 100644 --- a/source/tests/Test-OrgOnlyBypassLobby.ps1 +++ b/source/tests/Test-OrgOnlyBypassLobby.ps1 @@ -5,14 +5,13 @@ function Test-OrgOnlyBypassLobby { # Aligned # Parameters can be defined here if needed ) - begin { # Dot source the class script if necessary #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.5.3" + Write-Verbose "Running Test-OrgOnlyBypassLobby for $recnum..." } - process { try { # 8.5.3 (L1) Ensure only people in my org can bypass the lobby diff --git a/source/tests/Test-OrganizersPresent.ps1 b/source/tests/Test-OrganizersPresent.ps1 index df79661..b4d4867 100644 --- a/source/tests/Test-OrganizersPresent.ps1 +++ b/source/tests/Test-OrganizersPresent.ps1 @@ -10,6 +10,7 @@ function Test-OrganizersPresent { #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.5.6" + Write-Verbose "Running Test-OrganizersPresent for $recnum..." } process { try { diff --git a/source/tests/Test-TeamsExternalAccess.ps1 b/source/tests/Test-TeamsExternalAccess.ps1 index ca3b6ae..f28262a 100644 --- a/source/tests/Test-TeamsExternalAccess.ps1 +++ b/source/tests/Test-TeamsExternalAccess.ps1 @@ -10,6 +10,7 @@ function Test-TeamsExternalAccess { # . .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.2.1" + Write-Verbose "Running Test-TeamsExternalAccess for $recnum..." } process { try { diff --git a/source/tests/Test-TeamsExternalFileSharing.ps1 b/source/tests/Test-TeamsExternalFileSharing.ps1 index a709c20..faca09b 100644 --- a/source/tests/Test-TeamsExternalFileSharing.ps1 +++ b/source/tests/Test-TeamsExternalFileSharing.ps1 @@ -10,18 +10,17 @@ function Test-TeamsExternalFileSharing { # . .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.1.1" + Write-Verbose "Running Test-TeamsExternalFileSharing for $recnum..." } process { try { # 8.1.1 (L2) Ensure external file sharing in Teams is enabled for only approved cloud storage services # Connect to Teams PowerShell using Connect-MicrosoftTeams - # Condition A: The `AllowDropbox` setting is set to `False`. # Condition B: The `AllowBox` setting is set to `False`. # Condition C: The `AllowGoogleDrive` setting is set to `False`. # Condition D: The `AllowShareFile` setting is set to `False`. # Condition E: The `AllowEgnyte` setting is set to `False`. - # Assuming that 'approvedProviders' is a list of approved cloud storage service names # This list must be defined according to your organization's approved cloud storage services # Retrieve the current Teams client configuration