Skip to content

Arvinder/cis m365 1 3 3 and 1 3 6#177

Open
asagle2531 wants to merge 7 commits into
mainfrom
Arvinder/CIS-M365-1-3-3-and-1-3-6
Open

Arvinder/cis m365 1 3 3 and 1 3 6#177
asagle2531 wants to merge 7 commits into
mainfrom
Arvinder/CIS-M365-1-3-3-and-1-3-6

Conversation

@asagle2531
Copy link
Copy Markdown
Collaborator

Summary

Adds two new CIS M365 Foundations Benchmark v6.0.0 Rego policy implementations for Exchange controls:

Control 1.3.3 : Ensure external sharing of calendars is not available
Control 1.3.6 : Ensure the Customer Lockbox feature is enabled

Type of Change

  • Bug fix
  • [✓] New feature
  • Breaking change
  • Refactor / code cleanup
  • Documentation
  • CI/CD / infrastructure
  • Security

Affected Components

  • /backend-api
  • /frontend
  • [✓] /engine (collectors / policies)
  • /security
  • /infrastructure
  • /.github/workflows
  • /docs

Motivation

Control 1.3.3 :
Risk Addressed : External calendar sharing exposes availability patterns, meeting titles and internal email addresses to unauthenticated external parties
Business Impact : Data exfiltration, reconnaissance for social engineering, compliance violations

1.3.6: 
Risk Addressed : Without Customer Lockbox, Microsoft engineers can access tenant data without audit trail or approval
Business Impact : Loss of data sovereignty, unmonitored privileged access, regulatory non-compliance in regulated industries

Testing Done

  • Unit tests pass locally

  • [✓] Tested manually — describe how:
    both policies evaluated against sample compliant and non compliant input data to confirm correct compliant: true/false output and accurate violation messages

Test results :

  1. opa eval -i ".\1.3.3_pass.json" -d ".\1.3.3_external_calendar_sharing_disabled.rego" "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_3.result"

Output : {
"result": [
{
"expressions": [
{
"value": {
"affected_resources": [],
"compliant": true,
"details": {
"policies_allowing_external": [],
"policies_allowing_external_count": 0,
"total_policies": 1
},
"message": "External calendar sharing is properly disabled"
},
"text": "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_3.result",
"location": {
"row": 1,
"col": 1
}
}
]
}
]
}

  1. opa eval -i ".\1.3.3_fail.json" -d ".\1.3.3_external_calendar_sharing_disabled.rego" "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_3.result"

Output : {
"result": [
{
"expressions": [
{
"value": {
"affected_resources": [
"Default Sharing Policy"
],
"compliant": false,
"details": {
"policies_allowing_external": [
{
"domains": [
"*"
],
"name": "Default Sharing Policy"
}
],
"policies_allowing_external_count": 1,
"total_policies": 1
},
"message": "1 policy(s) allow external calendar sharing"
},
"text": "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_3.result",
"location": {
"row": 1,
"col": 1
}
}
]
}
]
}

  1. opa eval -i ".\1.3.6_pass.json" -d ".\1.3.6_customer_lockbox_enabled.rego" "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result"

Output :

{
"result": [
{
"expressions": [
{
"value": {
"affected_resources": [],
"compliant": true,
"details": {
"audit_disabled": false,
"customer_lockbox_enabled": true,
"oauth_enabled": true
},
"message": "Customer Lockbox is properly enabled"
},
"text": "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result",
"location": {
"row": 1,
"col": 1
}
}
]
}
]
}

  1. opa eval -i ".\1.3.6_fail.json" -d ".\1.3.6_customer_lockbox_enabled.rego" "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result"

Output : {
"result": [
{
"expressions": [
{
"value": {
"affected_resources": [],
"compliant": false,
"details": {
"audit_disabled": false,
"customer_lockbox_enabled": false,
"oauth_enabled": true
},
"message": "Customer Lockbox is disabled - Microsoft can access content without approval"
},
"text": "data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result",
"location": {
"row": 1,
"col": 1
}
}
]
}
]
}

  • No tests required — explain why:

Security Considerations

No impact on auth, secrets, or API permissions

Breaking Changes

  • [✓] No breaking changes
  • Yes — describe below:

Rollback Plan

  • [✓] Revert commit is sufficient
  • Requires additional steps — describe below:

Checklist

  • [✓] Code follows project conventions
  • [✓] No secrets, credentials, or tokens committed
  • Relevant drkflows pocumentation updated (if applicable)
  • CI/CD woass on this branch
  • [✓] PR is focused on one thing

Screenshots

N/A

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f12c46f1f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"is_manual": false,
"benchmark_audit_type": "Automated",
"automation_status": "not_started",
"automation_status": "implemented",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Set executable controls to ready status

automation_status is set to implemented here (and similarly for control 1.3.6), but the dispatcher only executes controls when status == "ready" (engine/worker/tasks.py). As a result, both new controls will be marked skipped in scans and their Rego policies will never run, so this change does not actually deliver the intended compliance checks.

Useful? React with 👍 / 👎.

@du-dhartley
Copy link
Copy Markdown
Collaborator

@asagle2531 I'd like to see this tested against the sandbox tenant we have with expected-pass and expected-fail settings to confirm that this works as intended. Where did you get those sample payloads from? Were they produced by one of our collectors?

@du-dhartley
Copy link
Copy Markdown
Collaborator

@asagle2531 The comment from a couple of weeks ago still needs to be addressed - we have a valid service principal that we can use to scan, so I'd like to see an expected pass and expected fail result show up as intended in a scan after manually changing settings in the tenant to show these expected values, and then confirm if the value performs as expected.

@du-dhartley
Copy link
Copy Markdown
Collaborator

@asagle2531 Are you able to address the feedback so this can be merged?

@asagle2531
Copy link
Copy Markdown
Collaborator Author

@asagle2531 Are you able to address the feedback so this can be merged?

yes, I will complete the testing by tomorrow sir.

Updated compliance check to consider only enabled policies allowing external sharing.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

CI: Engine

Job Result
Security analysis (CodeQL) success
Lint success
Tests success

All checks passed.

@asagle2531
Copy link
Copy Markdown
Collaborator Author

Screenshot 2026-05-23 213201 Screenshot 2026-05-23 213154 Screenshot 2026-05-23 212232 Screenshot 2026-05-23 212055 Tests where successful sir, but i had to change the rego a bit for it to be running perfectly. I have updated the rego as well

@asagle2531
Copy link
Copy Markdown
Collaborator Author

Also the test files in the test configs folder are no longer needed. I tried to delete them but couldn't. Could you please do that

@asagle2531
Copy link
Copy Markdown
Collaborator Author

Please review the files and merge this request. Thanks a lot for your help sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants