-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(teams): add new checks teams_security_reporting_enabled
and defender_chat_report_policy_configured
#7614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andoniaf
merged 25 commits into
master
from
PRWLR-5813-ensure-users-can-report-security-concerns-in-teams
May 6, 2025
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ed1f828
feat(teams): add new check
andoniaf e5e49da
fix(teams): add missing field
andoniaf d0d5f11
feat(teams): add new check `teams_meeting_external_chat_disabled`
andoniaf 9b54683
feat(teams): add new check `teams_meeting_recording_disabled`
andoniaf 7e9ebff
Merge branch 'master' into PRWLR-5810-ensure-external-participants-ca…
MrCloudSec f6cf35a
chore: update changelog and add missing init
andoniaf bb07d97
Merge branch 'PRWLR-5810-ensure-external-participants-cant-give-or-re…
andoniaf 1e5cb47
chore: update changelog and add missing init
andoniaf 0a769aa
Merge branch 'PRWLR-5811-ensure-external-meeting-chat-is-off' into PR…
andoniaf 3f65963
chore: update changelog and add missing init
andoniaf 7e25414
feat(teams): add new check `teams_meeting_presenters_restricted`
andoniaf 636d50b
chore: update changelog
andoniaf 2ba2360
feat(defender): add report submission policy
andoniaf cdf5f8c
feat(teams): add new check `teams_security_reporting_enabled`
andoniaf 5593a57
chore: update changelog
andoniaf 0e1c90f
Merge branch 'master' into PRWLR-5813-ensure-users-can-report-securit…
andoniaf c6b2f9c
fix(defender): update report submission test case
andoniaf 051bb4f
fix: add missing json_parse
andoniaf 99e6408
Merge branch 'master' into PRWLR-5813-ensure-users-can-report-securit…
andoniaf 67dc22f
Merge branch 'master' into PRWLR-5813-ensure-users-can-report-securit…
andoniaf df5c02c
feat(m365): separate Defender settings checks in a new check
andoniaf ee7834f
chore: update changelog
andoniaf 18bc49f
fix: update check metadata
andoniaf ae68e56
fix: clarify checks objective
andoniaf d097fd3
chore: apply suggestions from code review
andoniaf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
30 changes: 30 additions & 0 deletions
30
...fender_chat_report_policy_configured/defender_chat_report_policy_configured.metadata.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"Provider": "m365", | ||
"CheckID": "defender_chat_report_policy_configured", | ||
"CheckTitle": "Ensure chat report submission policy is properly configured in Defender", | ||
"CheckType": [], | ||
"ServiceName": "teams", | ||
"SubServiceName": "", | ||
"ResourceIdTemplate": "", | ||
"Severity": "medium", | ||
"ResourceType": "Defender Report Submission Policy", | ||
"Description": "Ensure Defender report submission policy is properly configured to use customized addresses and enable chat message reporting to customized addresses, while disabling report chat message to Microsoft.", | ||
"Risk": "If Defender report submission policy is not properly configured, reported messages from Teams may not be handled or routed correctly, reducing the organization's ability to respond to threats.", | ||
"RelatedUrl": "https://learn.microsoft.com/en-us/defender-office-365/submissions-teams?view=o365-worldwide", | ||
"Remediation": { | ||
"Code": { | ||
"CLI": "Set-ReportSubmissionPolicy -Identity DefaultReportSubmissionPolicy -EnableReportToMicrosoft $false -ReportChatMessageEnabled $false -ReportChatMessageToCustomizedAddressEnabled $true -ReportJunkToCustomizedAddress $true -ReportNotJunkToCustomizedAddress $true -ReportPhishToCustomizedAddress $true -ReportJunkAddresses $usersub -ReportNotJunkAddresses $usersub -ReportPhishAddresses $usersub", | ||
"NativeIaC": "", | ||
"Other": "1. Navigate to Microsoft 365 Defender (https://security.microsoft.com/). 2. Click on Settings > Email & collaboration > User reported settings. 3. Scroll to Microsoft Teams section. 4. Ensure Monitor reported messages in Microsoft Teams is checked. 5. Ensure Send reported messages to: is set to My reporting mailbox only with report email addresses defined for authorized staff.", | ||
"Terraform": "" | ||
}, | ||
"Recommendation": { | ||
"Text": "Configure Defender report submission policy to use customized addresses and enable chat message reporting to customized addresses, while disabling report chat message to Microsoft.", | ||
"Url": "https://learn.microsoft.com/en-us/defender-office-365/submissions-teams?view=o365-worldwide" | ||
} | ||
}, | ||
"Categories": [], | ||
"DependsOn": [], | ||
"RelatedTo": [], | ||
"Notes": "" | ||
} |
53 changes: 53 additions & 0 deletions
53
...defender/defender_chat_report_policy_configured/defender_chat_report_policy_configured.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from typing import List | ||
|
||
from prowler.lib.check.models import Check, CheckReportM365 | ||
from prowler.providers.m365.services.defender.defender_client import defender_client | ||
|
||
|
||
class defender_chat_report_policy_configured(Check): | ||
"""Check if Defender report submission policy is properly configured for Teams security reporting. | ||
|
||
Attributes: | ||
metadata: Metadata associated with the check (inherited from Check). | ||
""" | ||
|
||
def execute(self) -> List[CheckReportM365]: | ||
"""Execute the check for Defender report submission policy settings. | ||
|
||
This method checks if Defender report submission policy is properly configured for Teams security reporting. | ||
|
||
Returns: | ||
List[CheckReportM365]: A list of reports containing the result of the check. | ||
""" | ||
findings = [] | ||
report_submission_policy = defender_client.report_submission_policy | ||
|
||
if report_submission_policy: | ||
report = CheckReportM365( | ||
metadata=self.metadata(), | ||
resource=report_submission_policy if report_submission_policy else {}, | ||
resource_name="Defender Security Reporting Policy", | ||
resource_id="defenderSecurityReportingPolicy", | ||
) | ||
|
||
defender_settings_valid = ( | ||
report_submission_policy.report_junk_to_customized_address | ||
and report_submission_policy.report_not_junk_to_customized_address | ||
and report_submission_policy.report_phish_to_customized_address | ||
and report_submission_policy.report_junk_addresses | ||
and report_submission_policy.report_not_junk_addresses | ||
and report_submission_policy.report_phish_addresses | ||
and not report_submission_policy.report_chat_message_enabled | ||
and report_submission_policy.report_chat_message_to_customized_address_enabled | ||
) | ||
|
||
if defender_settings_valid: | ||
report.status = "PASS" | ||
report.status_extended = "Defender report submission policy is properly configured for Teams security reporting." | ||
else: | ||
report.status = "FAIL" | ||
report.status_extended = "Defender report submission policy is not properly configured for Teams security reporting." | ||
|
||
findings.append(report) | ||
|
||
return findings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
30 changes: 30 additions & 0 deletions
30
...ces/teams/teams_security_reporting_enabled/teams_security_reporting_enabled.metadata.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"Provider": "m365", | ||
"CheckID": "teams_security_reporting_enabled", | ||
"CheckTitle": "Ensure users can report security concerns in Teams", | ||
"CheckType": [], | ||
"ServiceName": "teams", | ||
"SubServiceName": "", | ||
"ResourceIdTemplate": "", | ||
"Severity": "medium", | ||
"ResourceType": "Teams Global Messaging Policy", | ||
"Description": "Ensure Teams user reporting settings allow a user to report a message as malicious for further analysis", | ||
"Risk": "Without proper security reporting enabled, users cannot effectively report suspicious or malicious messages, potentially allowing security threats to go unnoticed.", | ||
"RelatedUrl": "https://learn.microsoft.com/en-us/defender-office-365/submissions-teams?view=o365-worldwide", | ||
"Remediation": { | ||
"Code": { | ||
"CLI": "Set-CsTeamsMessagingPolicy -Identity Global -AllowSecurityEndUserReporting $true", | ||
"NativeIaC": "", | ||
"Other": "1. Navigate to Microsoft Teams admin center (https://admin.teams.microsoft.com). 2. Click to expand Messaging and select Messaging policies. 3. Click Global (Org-wide default). 4. Ensure Report a security concern is On.", | ||
"Terraform": "" | ||
}, | ||
"Recommendation": { | ||
"Text": "Enable security reporting in Teams messaging policy.", | ||
"Url": "https://learn.microsoft.com/en-us/defender-office-365/submissions-teams?view=o365-worldwide" | ||
} | ||
}, | ||
"Categories": [], | ||
"DependsOn": [], | ||
"RelatedTo": [], | ||
"Notes": "" | ||
} |
50 changes: 50 additions & 0 deletions
50
.../m365/services/teams/teams_security_reporting_enabled/teams_security_reporting_enabled.py
andoniaf marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from typing import List | ||
|
||
from prowler.lib.check.models import Check, CheckReportM365 | ||
from prowler.providers.m365.services.teams.teams_client import teams_client | ||
|
||
|
||
class teams_security_reporting_enabled(Check): | ||
"""Check if users can report security concerns in Teams. | ||
|
||
Attributes: | ||
metadata: Metadata associated with the check (inherited from Check). | ||
""" | ||
|
||
def execute(self) -> List[CheckReportM365]: | ||
"""Execute the check for Teams security reporting settings. | ||
|
||
This method checks if security reporting is properly configured in Teams settings. | ||
|
||
Returns: | ||
List[CheckReportM365]: A list of reports containing the result of the check. | ||
""" | ||
findings = [] | ||
global_messaging_policy = teams_client.global_messaging_policy | ||
|
||
if global_messaging_policy: | ||
report = CheckReportM365( | ||
metadata=self.metadata(), | ||
resource=global_messaging_policy if global_messaging_policy else {}, | ||
andoniaf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
resource_name="Teams Security Reporting Settings", | ||
resource_id="teamsSecurityReporting", | ||
) | ||
|
||
teams_reporting_enabled = ( | ||
global_messaging_policy.allow_security_end_user_reporting | ||
) | ||
|
||
if teams_reporting_enabled: | ||
report.status = "PASS" | ||
report.status_extended = ( | ||
"Security reporting is enabled in Teams messaging policy." | ||
) | ||
else: | ||
report.status = "FAIL" | ||
report.status_extended = ( | ||
Check warning on line 44 in prowler/providers/m365/services/teams/teams_security_reporting_enabled/teams_security_reporting_enabled.py
|
||
"Security reporting is not enabled in Teams messaging policy." | ||
) | ||
|
||
findings.append(report) | ||
|
||
return findings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.