Skip to content

Implement CIS control 1.3.3: Ensure 'External sharing' of calendars is not available - #297

Open
Trunaw wants to merge 1 commit into
mainfrom
feature/cis-1.3.3-external-calendar-sharing
Open

Implement CIS control 1.3.3: Ensure 'External sharing' of calendars is not available#297
Trunaw wants to merge 1 commit into
mainfrom
feature/cis-1.3.3-external-calendar-sharing

Conversation

@Trunaw

@Trunaw Trunaw commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Implements the Rego policy for CIS Microsoft 365 Foundations control 1.3.3
(Ensure 'External sharing' of calendars is not available).

  • The collector (exchange.organization.sharing_policy) already existed - no collector changes needed
  • New Rego policy evaluates sharing policies and only counts policies that are BOTH
    enabled AND have external domains configured (a disabled policy with domains defined
    is still compliant)
  • Unit tests: 7/7 passing, covering compliant, non-compliant, mixed enabled/disabled,
    and missing-data cases
  • metadata.json updated: automation_status not_started -> ready, policy_file linked

Testing

  • OPA unit tests: 7/7 PASS
  • Collector tested against the shared test tenant: returns Default Sharing Policy
    with enabled=false -> policy correctly evaluates compliant=true

- Add Rego policy checking for enabled sharing policies with external domains
- Policy distinguishes enabled vs disabled policies to avoid false failures
- Add unit tests covering compliant, non-compliant, mixed and missing-data cases (7/7 passing)
- Update metadata.json: automation_status not_started -> ready, link policy file
@github-actions

Copy link
Copy Markdown
Contributor

Preview Environment

A preview environment can be spun up on demand for this PR.

Action Label Includes
Spin up preview deploy-preview Frontend, backend, database, Redis, OPA, worker
Spin up preview with M365 deploy-preview-m365 Everything above + PowerShell service for Exchange/Teams scan testing
Tear down preview teardown-preview Stops the environment early

The environment will also be torn down automatically when the PR is closed or merged.
Preview URLs will appear in a follow-up comment once the deploy completes (~5–8 min).
M365 scans require real tenant credentials added through the frontend UI.

@github-actions

Copy link
Copy Markdown
Contributor

CI: Engine

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

All checks passed.

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

Copy link
Copy Markdown

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: 05a9632cd9

ℹ️ 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 on lines +25 to +29
policies_allowing_external := object.get(input, "policies_allowing_external", [])

enabled_external_policies := [p |
some p in policies_allowing_external
p.enabled == true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check the default policy Enabled flag directly

The CIS benchmark text in docs/engine/Framework/CIS_M365_Benchmarks.json:125 audits Get-SharingPolicy -Identity "Default Sharing Policy" | ft Name,Enabled and requires Enabled to be false, but this rule only derives failures from the collector's filtered policies_allowing_external list. Because the collector populates that list only when Domains is non-empty (engine/collectors/exchange/organization/sharing_policy.py:52-64), an enabled Default Sharing Policy with no domain entries would be reported compliant even though the benchmark's required Enabled check fails; evaluate input.default_policy.Enabled for the default policy directly.

Useful? React with 👍 / 👎.

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.

1 participant