Skip to content

Conversation

Copy link

Copilot AI commented Dec 8, 2025

  • Explore existing alert patterns and phishing check infrastructure
  • Create Get-CIPPAlertCheckExtensionAlerts.ps1 following CIPP alert conventions
    • Accept TenantFilter and InputValue (time interval in hours) parameters
    • Query CheckExtensionAlerts table for recent alerts
    • Filter alerts by timestamp based on interval
    • Combine all alerts for the tenant into a single alert
    • Use System.Collections.Generic.List for performance
    • Call Write-AlertTrace with combined data
  • Test the new alert function
  • Validate code follows PowerShell best practices
  • Replace Write-Host with Write-LogMessage for proper logging
  • Optimize table query with timestamp filter in OData query
Original prompt

look at this enpoint that currently lists "check" alerts Modules/CIPPCore/Public/Entrypoints/Invoke-ListCheckExtAlerts.ps1
those are written to the table when requests come to Modules/CIPPCore/Public/Entrypoints/Invoke-PublicPhishingCheck.ps1
can you please create an alert endpoint that alerts on recent alerts for X interval, this interval will be based on a variable passed to the alert from the alert ascheuler which we will create. pelase make surte to not use ++ and use system collections. all alerts for the specified tenant are to be combined into one alert and retuned at one rather then individual alerts. like how the full/close to full email/onedrive alerts are structured.

Custom agent used: CIPP Alert Engineer
Implements and maintains CIPP tenant alerts in PowerShell using existing CIPP patterns, without touching API specs, avoiding CodeQL, and using Test-CIPPStandardLicense for license/SKU checks.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add endpoint for recent alerts based on interval Add alert for recent phishing check extension alerts Dec 8, 2025
Copilot AI requested a review from Zacgoose December 8, 2025 06:19
@Zacgoose
Copy link
Owner

Zacgoose commented Dec 8, 2025

@copilot we should not write host, there are logging system in place, check hwo they are called in other scripts, also are we able to filter on the table call for the interval rather than just on the response from the table, that should help with performance if its supported?

Copy link
Author

Copilot AI commented Dec 8, 2025

@copilot we should not write host, there are logging system in place, check hwo they are called in other scripts, also are we able to filter on the table call for the interval rather than just on the ...

Updated in commit d7f3272:

  • Replaced Write-Host with Write-LogMessage for proper error logging
  • Optimized table query by adding timestamp filter directly to the OData query (Timestamp ge datetime'...'). This filters at the database level instead of fetching all records and filtering in PowerShell, improving performance significantly.

@Zacgoose Zacgoose force-pushed the module-loading branch 2 times, most recently from b7ad029 to 539f061 Compare December 20, 2025 04:31
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