Skip to content

Surface SAM/GDAP configuration drift in top-level CIPP alerts#34

Draft
Copilot wants to merge 47 commits intodevfrom
copilot/add-permission-issue-notification
Draft

Surface SAM/GDAP configuration drift in top-level CIPP alerts#34
Copilot wants to merge 47 commits intodevfrom
copilot/add-permission-issue-notification

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 8, 2026

Admins currently have to manually run Access Checks to discover SAM permission drift or GDAP role/relationship issues, so important post-release permission changes are easy to miss. This change promotes those failures into the existing global alert stream so misconfiguration is visible immediately after login.

  • Alerting behavior update (Invoke-GetCippAlerts)

    • Added admin-scoped checks against cached AccessChecks table entries:
      • PartitionKey='AccessCheck', RowKey='AccessPermissions'
      • PartitionKey='AccessCheck', RowKey='GDAPRelationships'
    • Emits new warning banners when cached checks indicate:
      • SAM/service-account permission problems (Success=false, non-empty ErrorMessages, or MissingPermissions)
      • GDAP issues (GDAPIssues present)
  • New alert types

    • SAM Permission Issues Detected
    • GDAP Relationship Issues Detected
    • Both point admins to /cipp/settings (Access Checks) for remediation context.
  • Focused endpoint coverage

    • Added Tests/Endpoint/Invoke-GetCippAlerts.Tests.ps1 to verify:
      • warnings are emitted when cache contains SAM/GDAP issues
      • warnings are not emitted for healthy cached results
if ($AccessPermissions -and (
    $AccessPermissions.Success -eq $false -or
    @($AccessPermissions.ErrorMessages).Count -gt 0 -or
    @($AccessPermissions.MissingPermissions).Count -gt 0
)) {
    $Alerts.Add(@{
        title = 'SAM Permission Issues Detected'
        link  = '/cipp/settings'
        type  = 'warning'
    })
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add notification for permission issues in CIPP-SAM Surface SAM/GDAP configuration drift in top-level CIPP alerts Mar 8, 2026
KelvinTegelaar and others added 24 commits March 9, 2026 21:37
Introduce Invoke-ListMailboxForwarding HTTP entrypoint and Get-CIPPMailboxForwardingReport report function. The entrypoint parses request params (CIPPEndpoint, tenantFilter, ForwardingOnly), calls the report function, logs activity and returns HttpResponseContext with appropriate status codes. The report generator reads cached mailbox data via Get-CIPPDbItem, supports a TenantFilter and -ForwardingOnly switch, handles 'AllTenants' by aggregating per-tenant reports, computes forwarding status (External/Internal/Both/None), and returns PSCustomObjects with fields like UPN, DisplayName, PrimarySmtpAddress, ForwardingType, ForwardTo, DeliverToMailboxAndForward, Tenant and CacheTimestamp. Error handling and logging added for missing data and per-tenant failures.
Add UseReportDB query handling to fetch mailbox forwarding from the report DB (Get-CIPPMailboxForwardingReport). If UseReportDB=true the report function is called and returned; otherwise the code performs a live Exchange Online query (Get-Mailbox via New-ExoRequest), selects relevant fields and projects normalized PSCustomObjects with ForwardingType, ForwardTo, HasForwarding, and related properties. Also improve logging and error handling for both paths.
A mailbox forwarding report should only contain mailboxes with forwarding.
…box-forwarding-report

Feature/mailbox forwarding report
also add env var backup table
…state

Two bugs caused scheduled offboarding tasks to silently disappear:

1. In Push-ExecScheduledCommand, if Invoke-CIPPOffboardingJob threw an
   exception the inner catch set $State='Failed', but the outer state
   update unconditionally set TaskState='Processing' for all orchestrator-
   based commands, ignoring the failure. The task was then stuck in
   'Processing' showing "Orchestration in progress" with no way to recover.
   Fixed by checking $State before deciding between 'Processing' and 'Failed'.

2. In Start-UserTasksOrchestrator the recovery filter included stuck
   'Pending' (>24h) and 'Running' (>4h) tasks but omitted 'Processing'.
   Any task stuck in 'Processing' (from bug #1 or from an orchestration
   where the post-execution handler itself failed) would never be retried.
   Fixed by adding 'Processing' to the recovery filter with the same
   4-hour timeout used for 'Running'.

https://claude.ai/code/session_019TANRi9wms5e5W1nJgZWQm
… binding

Start-CIPPOrchestrator was called without -CallerIsQueueTrigger from inside
CIPPActivityFunction, causing it to fall through to Add-CippQueueMessage which
uses Push-OutputBinding with a QueueItem binding that doesn't exist in activity
function context. The queue message silently failed, leaving the GUID orphaned
in table storage with the actual offboarding orchestration never starting.

Passing -CallerIsQueueTrigger routes directly to Start-NewOrchestration which
is available in the activity function context, allowing all 12 offboarding tasks
to actually execute.

https://claude.ai/code/session_019TANRi9wms5e5W1nJgZWQm
fix: Exclude 'On-Premises Directory Synchronization Service Account' from MFA reports
@Zacgoose Zacgoose force-pushed the copilot/add-permission-issue-notification branch from 18a64e9 to e7a6263 Compare March 14, 2026 03:14
@Zacgoose Zacgoose force-pushed the copilot/add-permission-issue-notification branch from e7a6263 to 941681f Compare March 14, 2026 04:10
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.

8 participants