Skip to content

feature: add new collector to compliance engine | priority account protection | CIS 2.4.1 and 2.4.2 - #320

Open
TrustBucket wants to merge 2 commits into
mainfrom
feature/cis2.4.1_priority_account_protection_collector
Open

feature: add new collector to compliance engine | priority account protection | CIS 2.4.1 and 2.4.2#320
TrustBucket wants to merge 2 commits into
mainfrom
feature/cis2.4.1_priority_account_protection_collector

Conversation

@TrustBucket

Copy link
Copy Markdown
Contributor

Summary

Adds collector required for CIS Microsoft 365 Foundations Benchmark v6.0.0 controls 2.4.1 (Ensure Priority account protection is enabled and configured) and 2.4.2 (Ensure Priority accounts have 'Strict protection' presets applied).

  • Adds PriorityAccountProtectionDataCollector in exchange/protection/
  • Registers collector as exchange.protection.priority_account_protection
  • Updates metadata.json to include collector ID (automation_status is stil left as not_started as rego policy is still outstanding)
  • Added sample JSON output in engine/samples/

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

Required to facilitate future 2.4.1 and 2.4.2 rego policy scans.

See planner task 26T2-ENG-JC-001.

Testing Done

  • [] Unit tests pass locally
  • Tested manually — describe how:

Tested against live test tenant using the collector test script - see sample JSON output in engine/samples .
Additionally tested using test_wiring.py script to verify no errors resulting from changes to metadata and registry files.

  • No tests required — explain why:

Security Considerations

No known security impact

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

Adds collector for CIS Microsoft 365 Foundations Benchmark
v6.0.0 controls 2.4.1 (Ensure Priority account protection is enabled and
configured) and 2.4.2 (Ensure Priority accounts have 'Strict protection'
presets applied).

Tested against live test tenant - see sample JSON output in engine/samples

- Adds PriorityAccountProtectionDataCollector in exchange/protection/
- Registers collector as exchange.protection.priority_account_protection
- Updates metadata.json to include collector ID (automation_status is stil left as
  not_started as rego policy is still outstanding)
- Added sample JSON output in engine/samples/
Removing unnecessary terminal outputs used during initial testing
Streamlining documentation and comments to match project conventions
@TrustBucket TrustBucket self-assigned this Aug 9, 2026
@TrustBucket
TrustBucket requested a review from a team as a code owner August 9, 2026 10:21
@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 failure
Tests success

One or more checks failed. View logs

@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: 3f23d072fd

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

#tenant_settings is required for v6.0.0 control 2.4.1
#accounts is required for v6.0.0 control 2.4.2
tenant_settings = await client.run_cmdlet("ExchangeOnline", "Get-EmailTenantSettings")
accounts = await client.run_cmdlet("ExchangeOnline", "Get-User", IsVIP=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 Collect strict preset scope for 2.4.2

For tenants where VIP accounts exist but the Strict preset is disabled or scoped to different recipients, this collector returns the same evidence as a compliant tenant because it only fetches the VIP users and never collects the Strict Preset Security Policy rules/recipient scope. The benchmark text for 2.4.2 requires confirming the strict preset includes the organization’s priority accounts/groups (docs/engine/Framework/CIS_M365_Benchmarks.json lines 450-456), so a future Rego policy wired to this collector cannot evaluate the control correctly. Please also collect the strict EOP/ATP protection policy rules and their recipient conditions/exceptions.

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