Skip to content

WIP: Control 7.2.4 - implement SharePoint collector, fix registry and… - #325

Draft
Meetphoenix1309 wants to merge 1 commit into
mainfrom
feature/control-7.2.4-onedrive-sharing
Draft

WIP: Control 7.2.4 - implement SharePoint collector, fix registry and…#325
Meetphoenix1309 wants to merge 1 commit into
mainfrom
feature/control-7.2.4-onedrive-sharing

Conversation

@Meetphoenix1309

Copy link
Copy Markdown

… test harness routing gaps; blocked on 401 from SharePoint REST API

Summary

Implements the SharePoint REST API client and spo_tenant data collector for CIS Control 7.2.4 (OneDrive/SharePoint external sharing restriction), which previously had no working collector. Also fixes two shared infrastructure gaps discovered during implementation. Currently blocked on a live SharePoint authentication issue — not ready to merge.

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

Control 7.2.4 was unautomated — the collector stub raised NotImplementedError. Picked up as part of assigned capstone control implementation work https://planner.cloud.microsoft/webui/v1/plan/lcHW9ElPMUK9pRly1LHeX8gABVGl/view/board/task/7vUmN4iZ7Ue7zWzNNif0pcgACdac?tid=d02378ec-1688-46d5-8540-1c28b5f470f6.

Testing Done

  • Unit tests pass locally

  • [*] Tested manually — describe how: Ran the collector against the live shared test tenant via scripts/test_collector.py -c sharepoint.spo_tenant. Confirmed the client correctly acquires an MSAL token and reaches the correct SharePoint endpoint (https://<tenant>-admin.sharepoint.com/_api/SPOTenant), but the API returns 401 Unauthorized. No Rego policy or unit tests exist yet, since real evidence hasn't been successfully retrieved.

  • No tests required — explain why:

Security Considerations

This PR adds a new authenticated client (SharePointClient) using the existing client-secret/MSAL pattern already used elsewhere in the codebase — no new secret storage or handling introduced. The live 401 error is currently under investigation with the team lead to confirm whether it's a missing/unconsented API permission or a limitation of client-secret auth for this specific endpoint (a caveat already flagged in the original stub code).

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

N/A — backend/collector change only, no UI impact.

… test harness routing gaps; blocked on 401 from SharePoint REST API
@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.

2 participants