Skip to content

fix: update of 5.1.4.4 control - #335

Open
yergaliev98 wants to merge 1 commit into
mainfrom
feature/cis-5-1-4-4-local-admin-assignment
Open

fix: update of 5.1.4.4 control#335
yergaliev98 wants to merge 1 commit into
mainfrom
feature/cis-5-1-4-4-local-admin-assignment

Conversation

@yergaliev98

Copy link
Copy Markdown

Summary

Extends the existing device_registration_policy.py collector to pull the additional Microsoft Graph fields needed to evaluate CIS control 5.1.4.4 (local administrator assignment during Entra join) — specifically the azureADJoin.localAdmins settings from the beta/policies/deviceRegistrationPolicy endpoint. Adds the Rego policy evaluating whether local administrator assignment during Entra join is limited to an approved group, none, or unrestricted, backed by unit tests covering compliant, non-compliant, empty, and missing-data scenarios. Moves control 5.1.4.4 from not_started to ready in metadata.json.

Type of Change

  • New feature
  • Bug fix
  • 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 5.1.4.4 (Ensure local administrator assignment is limited during Entra join) was not_started in the CIS Microsoft 365 Foundations Benchmark v6.0.0 mapping — the metadata showed a collector already existed but no Rego policy had been written. Implementing it was part of my individual contribution plan for this trimester (tracked on the team Planner board), alongside 1.3.9.

Testing Done

  • Unit tests pass locally — describe: opa test tests/test_cis_5_1_4_4_local_admin_assignment.rego policies/ — 5/5 tests pass, covering: compliant (selected users/groups configured), compliant (no registering users added as local administrators), non-compliant (unrestricted assignment), missing/empty configuration data, and result-details structure.
  • Tested manually — describe: ran the extended collector directly against the test tenant to confirm the Graph API response correctly returns local_admin_settings and registering_users fields after normalisation; restarted the Compliance Engine and ran a full scan to confirm control 5.1.4.4 loads and evaluates correctly end-to-end in the AutoAudit dashboard.
  • No tests required — explain why:

Security Considerations

No new secrets or credentials introduced. Uses the Policy.Read.All Microsoft Graph permission already declared in metadata.json for this collector — no new permission scope requested. The deviceRegistrationPolicy endpoint call is read-only; no data is written back to the tenant.

Breaking Changes

  • No breaking changes
  • Yes — describe below:

Field additions to the device registration policy collector's output are additive only; no existing fields were renamed or removed, so nothing consuming the old collector output is affected. The registry.py change only registers this control's policy mapping and doesn't alter existing entries.

Rollback Plan

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

No DB migrations involved; reverting the commit restores control 5.1.4.4 to not_started.

Checklist

  • Code follows project conventions
  • No secrets, credentials, or tokens committed
  • Relevant documentation updated (if applicable) — not applicable, no user-facing docs reference this control yet
  • CI/CD workflows pass on this branch — pending CI run on this PR
  • PR is focused on one thing

Screenshots

N/A — backend/policy-engine change only, no UI changes. See dashboard verification screenshots (control 5.1.4.4 evaluated correctly) in my 5.1P/10.1P evidence report if a visual is wanted.

@yergaliev98
yergaliev98 requested a review from a team as a code owner August 24, 2026 02:09
@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 failure
Tests success

One or more checks failed. View logs

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