Skip to content

Conversation

@kshitiz-prog
Copy link
Collaborator

No description provided.

@kshitiz-prog kshitiz-prog self-assigned this Jan 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a new assessment test (ID: 35022) to verify that on-demand scans are configured for discovering sensitive information in historical SharePoint, OneDrive, and Exchange content. The test helps organizations establish a compliance baseline by identifying sensitive data that predates auto-labeling policies.

Key changes:

  • Added PowerShell test function to retrieve and validate on-demand sensitive information scan configurations
  • Created markdown documentation with remediation guidance for configuring on-demand classification scans

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/powershell/tests/Test-Assessment.35022.ps1 Implements the assessment logic to check for configured on-demand scans, retrieve scan details, and generate a comprehensive report with scan status, workloads, and sensitive information types covered
src/powershell/tests/Test-Assessment.35022.md Provides background documentation and step-by-step remediation instructions for configuring on-demand classification scans in Microsoft Purview

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexandair
Copy link
Collaborator

@kshitiz-prog
Test is not producing output requested by the spec. The spec is asking for a bunch of aggregate statistics, the test outputs only total number of scans.
Property names in the spec are incorrect (probably hallucinated by AI), but that's not mentioned in the comments to the issue in ztspecs repo.

@kshitiz-prog kshitiz-prog marked this pull request as draft January 30, 2026 13:25
@kshitiz-prog kshitiz-prog marked this pull request as ready for review February 4, 2026 15:10
@alexandair alexandair requested a review from Copilot February 4, 2026 15:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +8
Checks if on-demand scans are configured for sensitive information discovery in
SharePoint, OneDrive, and Exchange. Implements dynamic SIT GUID -> friendly name
resolution and generates a markdown result suitable for inclusion in test reports.
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The .DESCRIPTION states that the test "checks if on-demand scans are configured for sensitive information discovery in SharePoint, OneDrive, and Exchange", but the assessment logic only sets $passed based on ($scanCount -ge 1) without considering per-workload coverage. This creates a mismatch between the documented behavior and the implemented pass criteria; either the description should be relaxed to match the current implementation, or the logic should be updated to require scans for the stated workloads if that is the intended requirement.

Suggested change
Checks if on-demand scans are configured for sensitive information discovery in
SharePoint, OneDrive, and Exchange. Implements dynamic SIT GUID -> friendly name
resolution and generates a markdown result suitable for inclusion in test reports.
Checks if on-demand scans are configured for sensitive information discovery in the
tenant. Implements dynamic SIT GUID -> friendly name resolution and generates a
markdown result suitable for inclusion in test reports.

Copilot uses AI. Check for mistakes.
Comment on lines +257 to +263
else {
$passed =$false
if ($passed) {
$testResultMarkdown = "✅ At least one on-demand scan is configured in the organization, enabling discovery and classification of historical sensitive information.`n`n"
}
else {
$testResultMarkdown = "❌ No on-demand scans are configured in the organization; historical sensitive data cannot be discovered.`n`n"
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

In the report-generation branch the $passed flag is unconditionally reset to $false (line 258) before the success/failure message is chosen, which means this test will always report failure even when $scanCount -ge 1 and the earlier assessment logic has already set $passed to $true. The report text and the Status value passed to Add-ZtTestResultDetail should rely on the result of the assessment logic instead of overriding it here.

Copilot uses AI. Check for mistakes.
$nameEsc = $row.Name
$statusEsc = $row.Status
$workEsc = $row.Workload
$sitEsc = 'SIT Detected'
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

When building the markdown table, the SIT Detected column always outputs the literal string 'SIT Detected' (line 277) instead of the per-row sensitive information details built earlier and stored in $row.'SIT Detected'. This makes the SIT resolution and $sitString computation effectively unused in the final report; the table should use the actual value from the row object so readers can see which sensitive information types were detected.

Suggested change
$sitEsc = 'SIT Detected'
$sitEsc = $row.'SIT Detected'

Copilot uses AI. Check for mistakes.
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.

3 participants