Skip to content

Implement CIS 1.2.2 shared mailbox sign-in control - #323

Open
Alsewedy wants to merge 2 commits into
mainfrom
feature/cis-1.2.2-shared-mailbox-signin
Open

Implement CIS 1.2.2 shared mailbox sign-in control#323
Alsewedy wants to merge 2 commits into
mainfrom
feature/cis-1.2.2-shared-mailbox-signin

Conversation

@Alsewedy

@Alsewedy Alsewedy commented Aug 9, 2026

Copy link
Copy Markdown

Summary

Implements CIS 1.2.2 by updating the shared mailbox collector, adding the Rego policy and test, and updating the control metadata.

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

This control is required to automate CIS 1.2.2 and verify that shared mailbox sign-in is blocked as expected.

Testing Done

  • Unit tests pass locally
  • Tested manually — describe how:
  • No tests required — explain why:

Security Considerations

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 documentation updated (if applicable)
  • CI/CD workflows pass on this branch
  • PR is focused on one thing

Screenshots

@Alsewedy
Alsewedy requested a review from a team as a code owner August 9, 2026 14:46
@github-actions

github-actions Bot commented Aug 9, 2026

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

github-actions Bot commented Aug 9, 2026

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: c264ada33e

ℹ️ 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 +43 to +47
user_account = await client.run_cmdlet(
"ExchangeOnline",
"Get-User",
Identity=user_principal_name,
)

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 Check Entra accountEnabled instead

For tenants where Exchange recipient state and the Entra user sign-in flag differ, this Get-User lookup can report the mailbox as blocked based on Exchange AccountDisabled even though the actual Microsoft 365 account can still sign in. The repository's CIS source for 1.2.2 audits Get-MgUser with AccountEnabled and expects that value to be False (docs/engine/Framework/CIS_M365_Benchmarks.json:82), so the collector should query Graph by ExternalDirectoryObjectId (or otherwise return authoritative Entra accountEnabled) before marking the control ready.

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