Skip to content

Add Rego policy for CIS 1.3.3 (external calendar sharing)#196

Open
williamywccc wants to merge 2 commits into
mainfrom
feature/add-cis-1.3.3-policy
Open

Add Rego policy for CIS 1.3.3 (external calendar sharing)#196
williamywccc wants to merge 2 commits into
mainfrom
feature/add-cis-1.3.3-policy

Conversation

@williamywccc
Copy link
Copy Markdown
Collaborator

Summary

  • Implements the Rego policy for CIS Microsoft 365 Foundations v6.0.0 control 1.3.3
  • Rewrites the sharing_policy collector to produce structured, per-entry violation data instead of a flat boolean
  • Adds a sample JSON file for manual OPA eval testing

How it works

Get-SharingPolicy returns a Domains field as a list of domain:Capability pairs. The collector parses each entry and flags those where the domain component is Anonymous or * (wildcard) paired with a CalendarSharing* capability on an enabled policy. Named external SMTP domains are not classified as violations.

The Rego policy checks calendar_sharing_violations from the collector output and surfaces each offending entry as an affected resource.

Notes

There is an existing branch Arvinder/CIS-M365-1-3-3-and-1-3-6 that covers the same control. Please coordinate with Arvinder before merging to avoid conflicts.

Test plan

  • Run opa eval with engine/samples/exchange_organization_sharing_policy_sample.json to verify non-compliant path
  • Run opa eval with an input where calendar_sharing_violations is empty to verify compliant path
  • Verify against a live tenant once Exchange PowerShell permissions are available

Made with Cursor

Rewrites the sharing_policy collector to produce structured violation data:
each SharingPolicy Domains entry is parsed as a domain:Capability pair,
and entries using Anonymous or wildcard (*) domains with CalendarSharing
capabilities are flagged as non-compliant. Named SMTP partner domains are
not evaluated.

The Rego policy (1.3.3_external_calendar_sharing.rego) checks
calendar_sharing_violations from the collector output and reports
each violating domain entry as an affected resource.

Includes a sample JSON file for manual OPA eval testing.

Made-with: Cursor
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: 3fd9fea956

ℹ️ 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".

Comment thread engine/collectors/exchange/organization/sharing_policy.py
Copy link
Copy Markdown
Collaborator

@du-dhartley du-dhartley left a comment

Choose a reason for hiding this comment

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

@williamywccc If there was a known conflict with another branch, why was this PR created?
Aside from that, there are a couple of issues that need to be resolved, however the known and expected conflict should be resolved before either branch have updates applied.

We should also demonstrate expected and matched pass/fail results by settings values to invalid and then valid settings, shown by scans.

Comment thread engine/samples/exchange_organization_sharing_policy_sample.json
Comment thread engine/collectors/exchange/organization/sharing_policy.py
Comment thread engine/collectors/exchange/organization/sharing_policy.py
Restore class and collect method docstrings that were accidentally removed.
Replace placeholder sample JSON with real output from live sandbox tenant.

Co-authored-by: Cursor <cursoragent@cursor.com>
@williamywccc
Copy link
Copy Markdown
Collaborator Author

PR196_Fail_Result PR196_Pass_Result

The above are pass/fail results

@williamywccc williamywccc requested a review from du-dhartley May 14, 2026 06:08
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