Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1991 commits
Select commit Hold shift + click to select a range
956c732
fix: save test result
JohnDuprey Apr 24, 2026
0ff7d1e
Update Invoke-ExecTestRefresh.ps1
JohnDuprey Apr 24, 2026
821b92e
fix: base role permissions
JohnDuprey Apr 24, 2026
870b94d
fix: getversion api role
JohnDuprey Apr 24, 2026
40cb7fc
chore: Block Az Function app setting cmdlets
JohnDuprey Apr 24, 2026
24fcd6b
fix: Fallback to legacy REST when CIPP client missing
JohnDuprey Apr 25, 2026
07a3bae
shuffle
Zacgoose Apr 25, 2026
f796dea
Token update locking
Zacgoose Apr 25, 2026
2a2772b
feat: add allTenants support for multiple intune pages
kris6673 Apr 24, 2026
1249d1b
more shuffles
Zacgoose Apr 26, 2026
42e980b
move more files to make root cleaner
Zacgoose Apr 26, 2026
9ece8de
harden orc start and audit log error message
Zacgoose Apr 26, 2026
10012b4
more audit log error handling
Zacgoose Apr 26, 2026
85e3a88
Update Start-CIPPOrchestrator.ps1
Zacgoose Apr 26, 2026
7e9f719
feat: Add allTenants support for all the Teams SharePoint pages
kris6673 Apr 26, 2026
ef2fff0
Merge branch 'KelvinTegelaar:master' into feat/-Configure-Encrypted-M…
chris-dewey-1991 Apr 26, 2026
f2cd153
Creation of OME Encrypted Message Branding Standard
chris-dewey-1991 Apr 26, 2026
c9ca4f0
Merge branch 'KelvinTegelaar:master' into fix-add-support-for-group-a…
TecharyJames Apr 27, 2026
e30eaa5
fix: Update docs links that 404
bmsimp Apr 27, 2026
6f4c32c
feat(mde-onboarding): cache full connector properties
kris6673 Apr 27, 2026
307db51
fix: handle case when no tenants found for MDE report
kris6673 Apr 27, 2026
9b24f33
refactor: Vacation group filter url encoding
JohnDuprey Apr 27, 2026
25a06e3
fix: update restricted tables for superadmin backup restoration
JohnDuprey Apr 27, 2026
16d2ff4
fix: correct path to version_latest.txt in version.json creation step
JohnDuprey Apr 27, 2026
12d93fe
refactor: enhance IP validation and result handling in Invoke-ExecApi…
JohnDuprey Apr 27, 2026
1141713
Add Add-CIPPTestResult as an allowed custom test command
Zacgoose Apr 28, 2026
4255573
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
Zacgoose Apr 28, 2026
dd73a6f
fix standards logging issues
Zacgoose Apr 28, 2026
7b17a58
fix: Update docs links that 404 (#2025)
KelvinTegelaar Apr 28, 2026
e7a9d88
Add SP/Exchange standards
Zacgoose Apr 28, 2026
61b172b
Update CippEntrypoints.psm1
Zacgoose Apr 28, 2026
ea6cc64
Handle midterm license changes and enrich response to contain started…
Zacgoose Apr 28, 2026
f5ecbb0
Fix GDAP requests to use more than 300 results
Zacgoose Apr 28, 2026
4c70122
Don't use cache for app permissions, causes issues if stale or missing
Zacgoose Apr 28, 2026
33ee646
typo
Zacgoose Apr 28, 2026
f652a1a
fix: correct version_latest.txt path in remote API version check
bmsimp Apr 28, 2026
7687325
fix: correct version_latest.txt path in remote API version check (#2029)
KelvinTegelaar Apr 28, 2026
a1bed60
Clear drift remediation tasks if reoccurring ones were created
Zacgoose Apr 28, 2026
f896701
Ensure only HTML fragments are generated
Zacgoose Apr 28, 2026
7b61a9d
Fix standard to only apply to users and shared accounts if enabled, e…
Zacgoose Apr 28, 2026
217416d
add back to root :(
Zacgoose Apr 28, 2026
ae39bce
fix: version locations
JohnDuprey Apr 28, 2026
8c0ca04
fix: disable transitive failures error logging for now
JohnDuprey Apr 28, 2026
658acea
fix: add caching to sharepoint/onedrive site listings
JohnDuprey Apr 28, 2026
3ff08f0
feat: update intuneCollection with new properties
kris6673 Apr 28, 2026
0e3413c
feat: enrich Intune policy setting details
kris6673 Apr 28, 2026
e2f71c2
fix: group types in edit user
JohnDuprey Apr 28, 2026
2161569
chore: bump version to 10.4.2
JohnDuprey Apr 28, 2026
d15734d
Merge branch 'settings-tooltips' of https://github.com/kris6673/CIPP-…
kris6673 Apr 28, 2026
66e7da5
Bring in tenant deviations into calculation and expose confirmed devi…
Zacgoose Apr 29, 2026
d6e0c01
tweak ninja sync interval
Zacgoose Apr 29, 2026
d9f630e
offset some activities to help spread the load
Zacgoose Apr 29, 2026
70642a2
Surface errors correctly for secret reset
Zacgoose Apr 29, 2026
3fc9675
tweaks for webhook table lookups
Zacgoose Apr 29, 2026
8bbefe1
Update version_latest.txt
Zacgoose Apr 29, 2026
4727715
feat: show full MDE connector details (#2026)
KelvinTegelaar Apr 29, 2026
10ddece
Merge branch 'dev' into settings-tooltips
KelvinTegelaar Apr 29, 2026
1606bf1
feat: enrich Intune policy setting details (#2031)
KelvinTegelaar Apr 29, 2026
c39d061
Fix: Add support for group assigned admin roles to 'disable exo' stan…
KelvinTegelaar Apr 29, 2026
834b4c6
fix: calculated group type in listusergroups
JohnDuprey Apr 29, 2026
fe7b013
Feat/Configure Encrypted Message Branding OME (#2023)
KelvinTegelaar Apr 29, 2026
9700734
Use ConvertTo-SafeArray for all EXO domain checks
Zacgoose Apr 30, 2026
e0df450
account for trials
Zacgoose Apr 30, 2026
29e3006
Update Get-CIPPLicenseOverview.ps1
Zacgoose Apr 30, 2026
1416a14
Simple is best
Zacgoose Apr 30, 2026
264abca
Update Invoke-CIPPDBCacheCollection.ps1
Zacgoose Apr 30, 2026
3ed7bdd
Update New-CIPPAPIConfig.ps1
Zacgoose Apr 30, 2026
a78bd50
slight orc changes
Zacgoose Apr 30, 2026
b446c02
Update Add-CippQueueMessage.ps1
Zacgoose Apr 30, 2026
7b26b11
fix(compare): handle non-catalog null results
kris6673 Apr 30, 2026
f036c0b
fix: odata sanitization
JohnDuprey Apr 30, 2026
ece775b
feat(intune): extend ListIntunePolicy for admin templates
kris6673 Apr 30, 2026
89ade0e
How long has this been wrong?
Zacgoose May 1, 2026
e0db8da
Fix oauth consent not adding ms app id after the fact
Zacgoose May 1, 2026
b937399
Add specific DNS endpoints to TCP connection limits
Zacgoose May 1, 2026
924a078
Fix listing of excluded tenants in scripted alerts
Zacgoose May 1, 2026
1639700
Update add CA exclusion to account for targeted roles
Zacgoose May 1, 2026
0a08f63
Add ResultMode, CIPP wrapper handling, Github save/import and custom …
Zacgoose May 1, 2026
6c27c34
Custom variable support + block explicit calls with tenantfilter
Zacgoose May 1, 2026
4589d5d
So the docs are wrong about this one
Zacgoose May 1, 2026
1cf4ee6
Prevent race conditions for duplicate audit logs
Zacgoose May 1, 2026
78eb1ae
More escaping for HMTL alerts that contain objects
Zacgoose May 1, 2026
cf66039
Silly audit logs
Zacgoose May 1, 2026
8c4f9bd
fix: Add SHAREPOINTENTERPRISE_GOV to license checks
JohnDuprey May 1, 2026
a0b7655
chore: bump version to 10.4.3
JohnDuprey May 2, 2026
80f6df7
Redirect url helper scripts
Zacgoose May 2, 2026
50789ce
queue tweaks
Zacgoose May 2, 2026
8594b3d
Update Start-CIPPOrchestrator.ps1
Zacgoose May 2, 2026
7504083
rename
JohnDuprey May 2, 2026
4484ec2
Add queueing functions to blocked commands list
JohnDuprey May 3, 2026
bb3db33
Correct list alerts accounting for tenant allowed tenant groups
Zacgoose May 4, 2026
f9928ae
CIS Microsoft 365 Foundations Benchmark v6.0.1
KelvinTegelaar May 4, 2026
16c03a1
add to scheduler
KelvinTegelaar May 4, 2026
cb51886
fix: MOERA standard reporting
JohnDuprey May 4, 2026
29685d6
feat(api): add license capability presets
kris6673 May 4, 2026
f50d8a1
feat: add Get-CIPPGroupsReport function and integrate with Invoke-Lis…
JohnDuprey May 4, 2026
3702c85
feat: PR check on fork
JohnDuprey May 4, 2026
8856340
dead code
Zacgoose May 5, 2026
8e12d10
Correct CIPP SAM addition repeated alerts
Zacgoose May 5, 2026
b230c7f
Fix drift tag resolution using stale rawData instead of live lookup
Zacgoose May 5, 2026
7a7c70d
fix: remove +1hr buffer to end time
JohnDuprey May 5, 2026
61b891c
Fix image upload
Zacgoose May 5, 2026
364da37
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
Zacgoose May 5, 2026
7787f18
Improve drift alignment data
Zacgoose May 5, 2026
08d2bcb
Add self-service email stuff
KelvinTegelaar May 5, 2026
733da22
updated
KelvinTegelaar May 5, 2026
e2382b4
fix: exclude expired user consent requests
JohnDuprey May 5, 2026
5087f26
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey May 5, 2026
45c8f59
Fix TeamsMeetingRecordingExpiration drift report showing Current=true
bmsimp May 3, 2026
512d87c
Fix SPFileRequests drift report showing pre-remediation values
bmsimp May 3, 2026
2be775b
Fix DisableSelfServiceLicenses autoclaim reading wrong property
bmsimp May 3, 2026
7aeeffc
Fix TeamsFederationConfiguration drift report ordering mismatch
bmsimp May 3, 2026
27c08ab
Fix SafeLinksPolicy and MalwareFilterPolicy drift report ordering
bmsimp May 3, 2026
212c6f1
improve drift page loading speed
Zacgoose May 6, 2026
0e537b1
fix: Guard against missing GeoIP.Data
JohnDuprey May 6, 2026
21528ea
parse timezone value for nice response message
Zacgoose May 6, 2026
23505c3
Correct backup object retuned
Zacgoose May 6, 2026
cc07ca5
public group standard
KelvinTegelaar May 6, 2026
9a84438
Empty AllowList Standard for CIS
KelvinTegelaar May 6, 2026
7962aab
add teasm ZAP standard
KelvinTegelaar May 6, 2026
94a291c
Ensure that collaboration invitations are sent to allowed domains only
KelvinTegelaar May 6, 2026
498d03f
fix: duplicate group ID retrieval in Invoke-ExecAddGDAPRole function
JohnDuprey May 6, 2026
9ae7562
Update Standard AutoAddProxy
Zacgoose May 7, 2026
adbbb53
Update CIPPTimers.json
Zacgoose May 7, 2026
3beb622
Better queue tracking
Zacgoose May 7, 2026
b9e193e
Add usageLocation support to JIT Admin creation and templates (#5910)
joaadvi May 7, 2026
b02970f
Fix drift report inaccuracies for TeamsMeeting, SPFileRequests, and p…
KelvinTegelaar May 7, 2026
0bc436b
Fix handling of non-catalog null results in comparison function (#2034)
KelvinTegelaar May 7, 2026
02fdcbe
Feat: Extend ListIntunePolicy for admin templates (#2035)
KelvinTegelaar May 7, 2026
8e7392d
fix: scripted alert optimization
JohnDuprey May 7, 2026
731a41e
fix: ensure unique and non-null email addresses in report generation
JohnDuprey May 7, 2026
bc4e643
add purview section
KelvinTegelaar May 7, 2026
c0098fd
remove old file
KelvinTegelaar May 7, 2026
26cb9ae
feat: Add AutoDiscover check to domain analysis
kris6673 May 7, 2026
94158f4
Add Investigate status to custom tests
Zacgoose May 8, 2026
f20c60a
Revert escaping
Zacgoose May 8, 2026
318d826
fix: correct assignment syntax for FieldValue in Add-CIPPBPAField fun…
JohnDuprey May 8, 2026
51b2281
fix: add SharingCapability to current state retrieval in Invoke-CIPPS…
JohnDuprey May 8, 2026
7804aaf
Try infer template type from content if missing, else fail early
Zacgoose May 8, 2026
1a304e1
feat: Add AutoDiscover check to domain analysis (#2042)
KelvinTegelaar May 8, 2026
3f44d22
Add usageLocation support to JIT Admin creation and templates (#5910)…
KelvinTegelaar May 8, 2026
8d454b9
fixed unmapped issue sherweb
KelvinTegelaar May 8, 2026
85d9a6c
concept
rvdwegen May 8, 2026
5644578
fixed #5930
KelvinTegelaar May 8, 2026
67ea958
fixes #5973
KelvinTegelaar May 8, 2026
b7773c6
pushing new compliance menus
KelvinTegelaar May 8, 2026
0475f95
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 8, 2026
584a6fe
feat: support bulk manager and sponsor updates
kris6673 May 8, 2026
b872a8b
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
rvdwegen May 8, 2026
a8a0c9d
fixes #5967
KelvinTegelaar May 8, 2026
68a83d3
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 8, 2026
6c440c0
Fix usageLocation autocomplete object in JIT Admin (#5910)
joaadvi May 8, 2026
3b60964
fix(jit-admin): honor TAP lifetime policy bounds
kris6673 May 8, 2026
2529b6a
fixes #5925
KelvinTegelaar May 8, 2026
0e00b46
Feat: Add configurable TAP lifetime for JIT Admin creation (#2045)
KelvinTegelaar May 8, 2026
d7bd907
Fix usageLocation value extraction in JIT Admin (#5910) (#2044)
KelvinTegelaar May 8, 2026
b9a8249
feat: Support bulk updates for managers and sponsors (#2043)
KelvinTegelaar May 8, 2026
74124f4
chore: update DNSHealth to 1.1.7
JohnDuprey May 8, 2026
176aa96
fix: sharing capability based on desired state for file requests
JohnDuprey May 8, 2026
f105398
chore: update dnshealth to 1.1.8
JohnDuprey May 8, 2026
d9c6203
fix: update expiration days logic for SharePoint and OneDrive file re…
JohnDuprey May 8, 2026
106f746
Add AAD Premium license gate to ExternalMFATrusted standard
bmsimp May 8, 2026
933a6dc
Fix for 5979
rvdwegen May 8, 2026
0bc4f50
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
rvdwegen May 8, 2026
4a466be
fix: prevent stale template list from skewing applied standards report
JohnDuprey May 8, 2026
b8b26a2
Update standards docs URLs to alignment/templates path
bmsimp May 3, 2026
9683b79
Fix standards run errors for Retention and MDO standards
bmsimp May 3, 2026
bf8a33a
feat: add Invoke-ListResellerRelationshipLink function for retrieving…
JohnDuprey May 8, 2026
e99b4aa
chore: bump version to 10.4.4
JohnDuprey May 8, 2026
07f2983
purview adding
KelvinTegelaar May 9, 2026
b7f32e7
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 9, 2026
a187a17
set warn to true.
KelvinTegelaar May 10, 2026
96727eb
fixes to purview setup
KelvinTegelaar May 10, 2026
ec7f564
Single deployment from function now that its all rigged up
KelvinTegelaar May 10, 2026
61c938a
standards use function
KelvinTegelaar May 10, 2026
be25c76
Squashed commit of the following:
TecharyJames May 11, 2026
6aa66c7
Custom Test - Alert on X statuses
Zacgoose May 11, 2026
dc3f0f4
Merge branch 'dev' into Feat-Conditional-access-policy-package-tags
TecharyJames May 11, 2026
dad97f7
Restore Invoke-AddCustomScript.ps1
TecharyJames May 11, 2026
6a96bab
Update Invoke-ListLicenses.ps1
Zacgoose May 11, 2026
f87f7da
implemenets #5948
KelvinTegelaar May 11, 2026
61bac43
Greatly speed up listing of intune policies for alltenants
Zacgoose May 11, 2026
377b83e
HVE user management and cache
Zacgoose May 11, 2026
c29746a
eclusions everywhere
KelvinTegelaar May 11, 2026
2753661
implements #5986
KelvinTegelaar May 11, 2026
5f3b26e
tablecleanup update
KelvinTegelaar May 11, 2026
1aa55cf
fix: intune standard change detection queries
JohnDuprey May 11, 2026
0c045c7
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey May 11, 2026
ee0b822
fix: change cleanup to 30 days
JohnDuprey May 11, 2026
b6c2a43
Feat: Add support for AllTenants in Intune pages (#2021)
KelvinTegelaar May 11, 2026
dd413bf
Add AAD Premium license gate to ExternalMFATrusted standard (#2046)
KelvinTegelaar May 11, 2026
d8be445
Merge branch 'dev' into levenshtein-distance
kris6673 May 11, 2026
59da6e6
Merge branch 'dev' into testlicense-presets
kris6673 May 11, 2026
fdf313e
fix: remove partitionkey
JohnDuprey May 11, 2026
b0232ec
Feat conditional access policy package tags (#1979)
KelvinTegelaar May 11, 2026
75699ff
feat: Add fuzzy matching for Intune policies using Levenshtein distan…
KelvinTegelaar May 11, 2026
d996bab
Merge branch 'dev' of https://github.com/kris6673/CIPP-API into allte…
kris6673 May 11, 2026
ddf0a4c
feat: Add allTenants support for Teams SharePoint pages (#2022)
KelvinTegelaar May 11, 2026
0c63311
fix: fix my cleanup mistake
kris6673 May 11, 2026
affac9d
Fix/standards run errors (#2037)
KelvinTegelaar May 11, 2026
12bb4f6
Fix: Fix cleanup mistake in caching functions (#2048)
KelvinTegelaar May 11, 2026
5995ad7
Merge branch 'dev' into testlicense-presets
kris6673 May 11, 2026
2152641
fix: add the presets to the rest of the standards
kris6673 May 11, 2026
bc4abb5
feat: add DefenderForOffice365 preset to license tests
kris6673 May 11, 2026
f5702f4
feat: Enhance Invoke-ListIntuneTemplates to include usage tracking fo…
JohnDuprey May 12, 2026
ecbc9a5
fix: Add error handling for missing standard functions in Push-CIPPSt…
JohnDuprey May 12, 2026
57b7de1
fix: Rename 'usedInTemplates' property to 'usage' for clarity in Invo…
JohnDuprey May 12, 2026
7fd7d09
fixes sharepoint response stuff
KelvinTegelaar May 12, 2026
23c8994
fixes defaultr_hidden vs hidden #5990
KelvinTegelaar May 12, 2026
ad0d096
OneDrive Sharing disable
KelvinTegelaar May 12, 2026
2869564
Add AlertUserReportPhising
KelvinTegelaar May 12, 2026
ddb498f
chore: bump version to 10.4.5
JohnDuprey May 12, 2026
3543755
Update Viva standard
Zacgoose May 12, 2026
5f864e3
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
Zacgoose May 12, 2026
7819302
fix name
JohnDuprey May 12, 2026
785e71c
fix user select
KelvinTegelaar May 12, 2026
6a81a08
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 12, 2026
2c5d0c9
feat: Add license capability presets (#2040)
KelvinTegelaar May 12, 2026
2dbc480
auth configs
Zacgoose May 12, 2026
3adade4
Featureflag configs and timer changes
Zacgoose May 13, 2026
93c8081
skip replacement if not value set for variable
Zacgoose May 13, 2026
2d33e02
strip return characters
Zacgoose May 13, 2026
d480cf7
Add Apps and SP to universal search
Zacgoose May 13, 2026
9011dd6
Nice CA policy editor and template creator/editor
Zacgoose May 13, 2026
b563b25
feat(halo): add Get-HaloUser lookup function
renada-jacob May 13, 2026
e3b2a61
feat(halo): link tickets to affected user contacts when configured
renada-jacob May 13, 2026
5f470b1
feat(halo): thread AffectedUser from alerts to HaloPSA ticket creation
renada-jacob May 13, 2026
21d7a2f
feat(alerts): add AffectedUser parameter to Send-CIPPAlert
renada-jacob May 13, 2026
71a208f
feat(alerts): split per-user PSA tickets when HaloPSA user-linking is on
renada-jacob May 13, 2026
95386fc
fix(halo): escape ClientId variable in Get-HaloUser warning message
renada-jacob May 13, 2026
b190cf0
fix(halo): populate site_id from matched user record
renada-jacob May 13, 2026
a74f113
fix(halo): cast user id and site_id to [int] in Get-HaloUser
renada-jacob May 13, 2026
048725f
Merge branch 'dev' into feat/halo-link-tickets-to-users
renada-jacob May 13, 2026
0582c23
feat(halo): link audit-log PSA tickets to the affected user
renada-jacob May 13, 2026
e7657c7
chore(alerts): surface PSA delivery outcome to Information stream
renada-jacob May 13, 2026
897dfaa
fixed #5997
KelvinTegelaar May 13, 2026
b136300
#5997
KelvinTegelaar May 13, 2026
e060fa2
implements #5981
KelvinTegelaar May 13, 2026
f5f7ae7
fixes duplicate test calls in some cases
Zacgoose May 14, 2026
c097631
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
Zacgoose May 14, 2026
b4a5215
Fix tenant group scope cache
Zacgoose May 14, 2026
d83a6fb
fix(halo): cast client_id to [int] on outbound ticket payload
renada-jacob May 14, 2026
ec152c6
fix(halo): match user lookup against all common identity fields
renada-jacob May 14, 2026
9947afc
fix(halo): combine search results before filtering on identity fields
renada-jacob May 14, 2026
dbd7fcb
logging improvements
Zacgoose May 14, 2026
bc7de0c
when running a standard manually still process all standards for prec…
Zacgoose May 14, 2026
aa681a1
fix(halo): use advanced_search for exact field-level user lookup
renada-jacob May 14, 2026
7283ce2
fix(halo): silence advanced_search noise and recover from note-add fa…
renada-jacob May 14, 2026
5259076
Merge remote-tracking branch 'upstream/dev' into feat/halo-link-ticke…
renada-jacob May 14, 2026
1e83607
feat(alerts): per-task PsaTicketStrategy override for the HaloPSA spl…
renada-jacob May 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
17 changes: 9 additions & 8 deletions .github/agents/CIPP-Alert-Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Your job is to implement, update, and review **alert-related functionality** in

You **must follow all constraints in this file** exactly.

## Secondary Reference

For detailed scaffolding patterns, parameter conventions, API call examples, and output standards, refer to `.github/instructions/alerts.instructions.md`. That file provides comprehensive technical reference for alert development. **If anything in this agent file conflicts with the instructions file, this agent file takes precedence.**

---

## Scope of Work
Expand Down Expand Up @@ -98,16 +102,13 @@ When adding or modifying alerts:

When an alert depends on a tenant having certain SKUs or capabilities, you **must**:

- Use `Test-CIPPStandardLicense`
- Use `Test-CIPPStandardLicense`
- Prefer `-Preset` for common capability sets: `Exchange`, `SharePoint`, `Intune`, `Entra`, `EntraP2`, `Teams`, `Compliance`
- Use `-RequiredCapabilities` only when no preset matches, or combine it with `-Preset` for extra edge-case capabilities
- Do **not** manually inspect SKUs, raw license IDs, or raw capability lists.

Example pattern (adapt to the specific feature):

```powershell
$TestResult = Test-CIPPStandardLicense -StandardName 'AutopilotProfile' -TenantFilter $Tenant -RequiredCapabilities @(
'INTUNE_A',
'MDM_Services',
'EMS',
'SCCM',
'MICROSOFTINTUNEPLAN1'
)
$TestResult = Test-CIPPStandardLicense -StandardName 'AutopilotProfile' -TenantFilter $Tenant -Preset Intune
```
54 changes: 25 additions & 29 deletions .github/agents/CIPP-Standards-Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ description: >

# CIPP Standards Engineer

name: CIPP Alert Engineer
description: >
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.
---

# CIPP Alert Engineer

## Mission

You are an expert CIPP Standards engineer for the CIPP repository.
Expand All @@ -29,47 +20,51 @@ Your job is to implement, update, and review **Standards-related functionality**

You **must follow all constraints in this file** exactly.

## Secondary Reference

For detailed scaffolding patterns, the three action modes (remediate/alert/report), `$Settings` conventions, API call patterns, and frontend JSON payloads, refer to `.github/instructions/standards.instructions.md`. That file provides comprehensive technical reference for standard development. **If anything in this agent file conflicts with the instructions file, this agent file takes precedence.**

---

## Scope of Work

Use this agent when a task involves:

- Adding a new standard (e.g. implement a standard to enable the audit log)
- Adding a new standard (e.g. "implement a standard to enable the audit log")

You **do not** make broad architectural changes. Keep changes focused and minimal.

---

## Key Directories & Patterns

When working on alerts, you should:
When working on standards, you should:

1. **Discover existing alerts and patterns**
1. **Discover existing standards and patterns**
- Use shell commands to explore:
- `Modules/CIPPCore/Public/Standards/`
- Inspect several existing alert files, e.g.:
- `\Modules\CIPPCore\Public\Standards\Invoke-CIPPStandardAddDKIM.ps1`
- `\Modules\CIPPCore\Public\Standards\Invoke-CIPPStandardlaps.ps1`
- `\Modules\CIPPCore\Public\Standards\Invoke-CIPPStandardOutBoundSpamAlert.ps1`
- `Modules/CIPPStandards/Public/Standards/`
- Inspect several existing standard files, e.g.:
- `Modules/CIPPStandards/Public/Standards/Invoke-CIPPStandardAddDKIM.ps1`
- `Modules/CIPPStandards/Public/Standards/Invoke-CIPPStandardlaps.ps1`
- `Modules/CIPPStandards/Public/Standards/Invoke-CIPPStandardOutBoundSpamAlert.ps1`
- Other `Invoke-CIPPStandard*.ps1` files
- Understand how alerts are **named, parameterized, and how they call Graph / Exo and helper functions**.
- Understand how standards are **named, parameterized, and how they call Graph / Exo and helper functions**.

2. **Follow the standard alert pattern**
- Alert functions live in:
`Modules/CIPPCore/Public/Standardss/`
- Alert functions are named:
`Invoke-CIPPStandardAddDKIM.ps1`
2. **Follow the standard pattern**
- Standard functions live in:
`Modules/CIPPStandards/Public/Standards/`
- Standard functions are named:
`Invoke-CIPPStandard<Name>.ps1`
- Typical characteristics:
- Standard parameter set, including `Tenant` and `Settings` which can be a complex object with subsettings, and similar common params.
- Uses CIPP helper functions like:
- `New-GraphGetRequest` for any graph requests
- `New-ExoReques` for creating exo requests
- `New-GraphGetRequest` for any Graph requests
- `New-ExoRequest` for Exchange Online requests
- Uses CIPP logging and error-handling patterns (try/catch, consistent message formatting).
- Each standard requires a Remediate, alert, and report section.
- Each standard requires a Remediate, Alert, and Report section.

3. **Rely on existing module loading**
- The CIPP module auto-loads `Public` functions recursively.
- The CIPPStandards module auto-loads `Public` functions recursively.
- **Do not** modify module manifest or loader behavior just to pick up your new standard.

---
Expand All @@ -78,15 +73,16 @@ When working on alerts, you should:

You **must** respect all of these:

### 1. Always follow existing CIPP alert patterns
### 1. Always follow existing CIPP standard patterns

When adding or modifying alerts:
When adding or modifying standards:

- Use the **same structure** as existing `Invoke-CIPPStandard*.ps1` files:
- Similar function signatures
- Similar logging and error handling
- Reuse helper functions instead of inlining raw Graph calls or custom HTTP code.
- Keep behaviour predictable.
- If a standard needs license gating, use `Test-CIPPStandardLicense` with `-Preset` for common capability sets (`Exchange`, `SharePoint`, `Intune`, `Entra`, `EntraP2`, `Teams`, `Compliance`). Use `-RequiredCapabilities` only when no preset matches, or combine it with `-Preset` for extra edge-case capabilities.

### 2. Return the code for the frontend.

Expand Down
164 changes: 164 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# CIPP-API Project Conventions

## Platform

- **Azure Functions** app running **PowerShell 7.4**
- Uses **Durable Functions** for orchestration (fan-out/fan-in, long-running workflows)
- All persistent data stored in **Azure Table Storage** (no SQL)
- Telemetry via **Application Insights** (optional)

## Project layout

```
├── Modules/ # All PowerShell modules — bundled locally, not external
│ ├── CIPPCore/ # Main module (~300+ exported functions)
│ │ ├── Public/ # Exported functions (auto-loaded recursively)
│ │ ├── Private/ # Internal-only functions
│ │ └── lib/ # Binary dependencies (Cronos.dll, etc.)
│ ├── CippEntrypoints/ # HTTP/trigger router functions
│ ├── CippExtensions/ # Third-party integrations (Hudu, Halo, NinjaOne, etc.)
│ ├── AzBobbyTables/ # Azure Table Storage helper module
│ ├── DNSHealth/ # DNS validation
│ ├── MicrosoftTeams/ # Teams API helpers
│ └── AzureFunctions.PowerShell.Durable.SDK/
├── CIPPHttpTrigger/ # Single HTTP trigger → routes all API requests
├── CIPPOrchestrator/ # Durable orchestration trigger
├── CIPPActivityFunction/ # Durable activity trigger (parallelizable work)
├── CIPPQueueTrigger/ # Queue-based async processing
├── CIPPTimer/ # Timer trigger (runs every 15 min)
├── Config/ # JSON templates (CA, Intune, Transport Rules, BPA)
├── Tests/ # Pester tests
├── profile.ps1 # Module loading at startup
└── host.json # Azure Functions runtime config
```

## Module loading

Modules are **bundled in the repo**, not loaded from the PowerShell Gallery. `profile.ps1` imports them at startup in order: `CIPPCore` → `CippExtensions` → `AzBobbyTables`. The CIPPCore module auto-loads all functions under `Public/` recursively. No manifest changes are needed when adding new functions.

## How HTTP requests work

There is only **one** Azure Functions HTTP trigger (`CIPPHttpTrigger`). It routes all requests through `Receive-CippHttpTrigger` → `New-CippCoreRequest`, which:

1. Reads the `CIPPEndpoint` parameter from the route
2. Maps it to a function: `Invoke-{CIPPEndpoint}`
3. Validates RBAC permissions via `Test-CIPPAccess`
4. Checks feature flags
5. Invokes the handler function

**Only functions in `Modules/CIPPCore/Public/Entrypoints/HTTP Functions/` are callable by the frontend.** They are organized by domain:

| Folder | Domain |
|--------|--------|
| `CIPP/` | Platform administration |
| `Email-Exchange/` | Exchange Online |
| `Endpoint/` | Intune / device management |
| `Identity/` | Entra ID / users / groups |
| `Security/` | Defender / Conditional Access |
| `Teams-Sharepoint/` | Teams & SharePoint |
| `Tenant/` | Tenant-level settings |
| `Tools/` | Utility endpoints |

### HTTP function naming

- `Invoke-List*` — Read-only GET endpoints
- `Invoke-Exec*` — Write/action endpoints
- `Invoke-Add*` / `Invoke-Edit*` / `Invoke-Remove*` — CRUD variants

Full naming rules, scaffolds, return conventions, and RBAC metadata are in `.github/instructions/http-entrypoints.instructions.md`, auto-loaded when editing HTTP Functions.

## Durable Functions

The app uses durable orchestration for anything that takes more than a few seconds:

| Component | Purpose |
|-----------|---------|
| **Orchestrator** (`CIPPOrchestrator/`) | Coordinates multi-step workflows, fan-out/fan-in |
| **Activity** (`CIPPActivityFunction/`) | Individual work units invoked by orchestrators in parallel |
| **Queue** (`CIPPQueueTrigger/`) | Async task processing via `cippqueue` |
| **Timer** (`CIPPTimer/`) | Runs every 15 minutes, triggers scheduled orchestrators |

Orchestrator functions live in `Modules/CIPPCore/Public/Entrypoints/Orchestrator Functions/`.
Activity triggers live in `Modules/CIPPCore/Public/Entrypoints/Activity Triggers/`.
Timer functions live in `Modules/CIPPCore/Public/Entrypoints/Timer Functions/`.

## Key helper functions

Graph, Exchange, and Teams API helpers live in `Modules/CIPPCore/Public/GraphHelper/`. Key functions: `New-GraphGetRequest`, `New-GraphPOSTRequest`, `New-GraphBulkRequest`, `New-ExoRequest`, `New-ExoBulkRequest`, `New-TeamsRequest`. Full signatures and token details are in `.github/instructions/auth-model.instructions.md`.

### Table Storage

```powershell
$Table = Get-CIPPTable -tablename 'TableName'
$Entities = Get-CIPPAzDataTableEntity @Table -Filter "PartitionKey eq 'value'"
Add-CIPPAzDataTableEntity @Table -Entity $Row -Force # Upsert
```

### Logging

```powershell
# General logging (HTTP endpoints, standards, orchestrators, cache, etc.)
Write-LogMessage -API 'EndpointName' -tenant $TenantFilter -message 'What happened' -sev Info

# Alert functions only — deduplicates by message + tenant per day
Write-AlertMessage -message 'Alert description' -tenant $TenantFilter -LogData $ErrorMessage
```

- **`Write-AlertMessage`**: Use exclusively in alert functions (`Get-CIPPAlert*`). It is a deduplication wrapper — checks if the same message was already logged today for the tenant, and only writes if new. Internally calls `Write-LogMessage` with `-sev 'Alert'` and `-API 'Alerts'`.
- **`Write-LogMessage`**: Use everywhere else. Directly writes to the `CippLogs` Azure Table with full audit context.

Severity levels: `Debug`, `Info`, `Warning`, `Error`. Logs go to the `CippLogs` Azure Table.

### Error handling

Use `Get-CippException -Exception $_` (preferred) or `Get-NormalizedError` (legacy) inside `catch` blocks, then `Write-LogMessage` with `-sev Error`. See `powershell-conventions.instructions.md` for full patterns.

## Tenant filtering

Every tenant-scoped operation receives a `$TenantFilter` parameter (domain name or GUID). Access is validated with `Test-CIPPAccess` at the HTTP layer. Always pass `$TenantFilter` (or `$Tenant` in standards) through to Graph/Exchange calls via `-tenantid`.

## Authentication model

CIPP is a **multi-tenant partner management tool**. A single **Secure Application Model (SAM)** app in the partner's tenant accesses all customer tenants via delegated admin (GDAP) or direct tenant relationships. Credentials live in Azure Key Vault; `Get-GraphToken` handles token acquisition, caching, and refresh automatically. Comprehensive documentation (SAM architecture, token flows, scopes, GDAP vs direct tenants, caching, API helpers) is in `.github/instructions/auth-model.instructions.md`, auto-loaded when editing GraphHelper files.

### What developers need to know

- **Never call `Get-GraphToken` directly** — `New-GraphGetRequest`, `New-ExoRequest`, etc. handle token acquisition internally
- **Always pass `-tenantid`** — without it, the call goes to the partner tenant, not the customer
- **Different scopes = different tokens**: Graph, Exchange, and Partner Center each have separate tokens
- **Do not hardcode secrets** — all credentials come from Key Vault via `Get-CIPPAuthentication`

## Function categories

| Category | Location | Naming | Purpose |
|----------|----------|--------|---------|
| HTTP endpoints | `Entrypoints/HTTP Functions/` | `Invoke-List*` / `Invoke-Exec*` | Frontend-callable API |
| Standards | `Standards/` | `Invoke-CIPPStandard*` | Compliance enforcement (remediate/alert/report) |
| Alerts | `Alerts/` | `Get-CIPPAlert*` | Tenant health monitoring |
| Orchestrators | `Entrypoints/Orchestrator Functions/` | `Start-*Orchestrator` | Workflow coordination |
| Activity triggers | `Entrypoints/Activity Triggers/` | `Push-*` | Parallelizable work units |
| Timer functions | `Entrypoints/Timer Functions/` | `Start-*` | Scheduled background jobs |
| DB cache | `Public/Set-CIPPDBCache*.ps1` | `Set-CIPPDBCache*` | Tenant data cache refresh |

## CIPP DB (tenant data cache)

CIPPDB is a **tenant-scoped read cache** backed by the `CippReportingDB` Azure Table. Standards, alerts, reports, and the UI read from cache instead of making live API calls. `Set-CIPPDBCache*` functions refresh the cache nightly; `New-CIPPDbRequest` is the primary reader. Comprehensive documentation (CRUD signatures, pipeline streaming, batch writes, collection grouping, scaffolding) is in `.github/instructions/cippdb.instructions.md`, auto-loaded when editing DB-related files.

## Coding conventions

Detailed PowerShell coding conventions are in `.github/instructions/powershell-conventions.instructions.md`, auto-loaded when editing `.ps1` files. Covers naming, collection building, pipeline usage, null handling, error handling, JSON serialization, and PS 7.4 idioms.

## Configuration

- **`host.json`** — Runtime config (timeouts, concurrency limits, extension bundles)
- **`CIPPTimers.json`** — Scheduled task definitions with priorities and cron expressions
- **`Config/`** — JSON templates for CA policies, Intune profiles, transport rules, BPA
- **Environment variables** — `AzureWebJobsStorage`, `APPLICATIONINSIGHTS_CONNECTION_STRING`, `CIPP_PROCESSOR`, `DebugMode`

## Things to avoid

- Do not install modules from the Gallery — bundle everything locally
- Do not modify module manifests to register new functions — auto-loading handles it
- Do not create new Azure Function trigger folders — use the existing five triggers
- Do not call `Write-Output` in HTTP functions — return an `[HttpResponseContext]` (the outer trigger handles `Push-OutputBinding`)
- Do not hardcode tenant IDs or secrets — use environment variables and `Get-GraphToken`
Loading