Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
919 commits
Select commit Hold shift + click to select a range
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
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
dbd7fcb
logging improvements
Zacgoose May 14, 2026
bc7de0c
when running a standard manually still process all standards for prec…
Zacgoose May 14, 2026
ee0398d
feat(endpoint): add Apple ADE and Android enrollment profile listing …
kris6673 May 14, 2026
5ccf15a
fix: missing odata path error in the returned json
kris6673 May 14, 2026
5901014
Merge pull request #100 from KelvinTegelaar/dev
isgq-github01 May 15, 2026
5289a30
feat: ability to add/remove nested groups in group memberships
isgq-github01 May 15, 2026
7ae35c2
post exec tweaks for dedupe queue names
Zacgoose May 15, 2026
fd6e30f
fix(standards): target azureADRegistration in intuneRestrictUserDevic…
kris6673 May 15, 2026
c67bc8d
feat(standards): add intuneRestrictUserDeviceJoin standard
kris6673 May 15, 2026
90b6457
Add AutoExpandingArchiveScope property showing org-level vs mailbox-l…
Zacgoose May 18, 2026
ab83a2b
Update Update-CIPPSAMRedirectUri.ps1
Zacgoose May 18, 2026
d7cda8a
Update Initialize-CIPPAuth.ps1
Zacgoose May 18, 2026
ab5e515
Switch to app auth for authentication changes standard
Zacgoose May 18, 2026
1b1ee68
cache PowerShell enabled status and use cached data for standard
Zacgoose May 19, 2026
6b8ebd4
refactor calls to use new onepass method to store DB data
Zacgoose May 19, 2026
e3e82cd
Cache Security Defaults
Zacgoose May 19, 2026
9ba4871
correct incorrect default value
Zacgoose May 19, 2026
73f8371
add logging to geoip lookip
Zacgoose May 19, 2026
9fce7e7
feat: add in missing options for Windows Hello standard
kris6673 May 21, 2026
1e02bfc
feat(standards): add DLP via DCS standard
kris6673 May 21, 2026
cfa144d
Update Invoke-ListWorkerHealth.ps1
Zacgoose May 22, 2026
a89c2b9
Add Group-Based Licensing support
May 23, 2026
bb2ebc6
fix: Add missing options for Windows Hello standard (#2061)
KelvinTegelaar May 23, 2026
7fbb8ed
Feat: Split Intune device join and registration standards (#2057)
KelvinTegelaar May 23, 2026
77a4be6
fixes #6027
KelvinTegelaar May 23, 2026
4ab85c7
CIPP Hosted Notices
Zacgoose May 23, 2026
dcf382a
Update Build-DevApiModules.ps1
Zacgoose May 23, 2026
9bb2f6b
Update Build-DevApiModules.ps1
Zacgoose May 23, 2026
fa5f4de
remove sso setup from featureflag
JohnDuprey May 24, 2026
df84777
implement standards template deployment for intune apps
KelvinTegelaar May 24, 2026
08ab039
add filtering
KelvinTegelaar May 24, 2026
c81b6a5
add filtering
KelvinTegelaar May 24, 2026
33512c3
FIDO2 profile standards
KelvinTegelaar May 24, 2026
03abdad
add global var showing
KelvinTegelaar May 24, 2026
f09ce56
Update New-TeamsRequest.ps1
Zacgoose May 25, 2026
a0dab59
domain fixes
Zacgoose May 25, 2026
08b972c
timezone changes
Zacgoose May 25, 2026
d854e22
feat: add function to remove users from admin roles
kris6673 May 25, 2026
cb31997
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 25, 2026
46015ce
Add APv2 profile
KelvinTegelaar May 25, 2026
05ce60f
Feat: Add function to remove users from admin roles (#2064)
KelvinTegelaar May 25, 2026
a7e30d7
feat: Add DLP via DCS standard (#2062)
KelvinTegelaar May 25, 2026
4214bc7
Fix: Fix missing OData path error in JSON response (#2054)
KelvinTegelaar May 25, 2026
a7b7d4d
feat: Add Apple ADE and Android enrollment profile endpoints (#2053)
KelvinTegelaar May 25, 2026
443e16a
feat: ability to add/remove nested groups in group memberships (#2056)
KelvinTegelaar May 25, 2026
71afcdd
ExoTransportConfig cache type - fix for missing data used in test suites
Zacgoose May 26, 2026
1e63ebf
Update Invoke-CIPPStandardsharingDomainRestriction.ps1
Zacgoose May 26, 2026
59a0e15
update application content type handling
Zacgoose May 26, 2026
e6b800b
remove rerun from alert
Zacgoose May 26, 2026
97dc672
user sync
Zacgoose May 26, 2026
359633a
fix: ensure tenant groups skips cache so they dont alternate anymore …
kris6673 May 26, 2026
49d629e
Update Get-CippApiAuth.ps1
Zacgoose May 26, 2026
22902b0
api fixes
Zacgoose May 26, 2026
5561a5b
Fix: tenant groups cache issue (#2065)
KelvinTegelaar May 26, 2026
95d48d1
Fix for desktop activations copilot ready test
Zacgoose May 27, 2026
a6fdfe2
Make all tenants list for SPO sites fast
Zacgoose May 27, 2026
122aec8
fix for template id casing
Zacgoose May 27, 2026
7d3b480
Update Invoke-CIPPStandardDefenderCompliancePolicy.ps1
Zacgoose May 27, 2026
4915301
use top 500 to minimise requests
Zacgoose May 27, 2026
c5b0e59
smart lockout standard
KelvinTegelaar May 27, 2026
c5a8a20
smart lockout standard
KelvinTegelaar May 27, 2026
f85963b
Sharepoint management functionality.
KelvinTegelaar May 27, 2026
b7d4f5e
Sharepoint management functionality.
KelvinTegelaar May 27, 2026
b7c7218
fix: update terminology from "Temporary Access Password" to "Temporar…
kris6673 May 27, 2026
8a536fe
Fix: Update terminology from "Temporary Access Password" to "Temporar…
KelvinTegelaar May 27, 2026
bdd8602
Add version cleanup
KelvinTegelaar May 27, 2026
e563aea
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 27, 2026
829ced8
feat(mailboxes): cache mailbox and archive usage metrics
kris6673 May 27, 2026
0ebb188
implement autopatch
KelvinTegelaar May 27, 2026
e41d532
Update Add-CIPPDbItem.ps1
Zacgoose May 28, 2026
5b7c5a9
Update Invoke-ListWorkerHealth.ps1
Zacgoose May 28, 2026
aefa69b
add compliance admin by default
KelvinTegelaar May 28, 2026
25fcdc1
add 404 detection for non-existing roles
KelvinTegelaar May 28, 2026
25e2b0f
tweaks
Zacgoose May 28, 2026
99dd88c
optimisation
Zacgoose May 28, 2026
0cdc2e8
new auth methods single standard
KelvinTegelaar May 28, 2026
fc080e4
new auth methods single standard
KelvinTegelaar May 28, 2026
a1179a2
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 28, 2026
55fea61
Feat: Add online archive report functionality for mailboxes (#2067)
KelvinTegelaar May 28, 2026
1f9fb1f
test invocation optimisations
Zacgoose May 28, 2026
1ac506d
fix: update endpoint roles to use Autopilot.Read
kris6673 May 28, 2026
3f03634
Update Initialize-CIPPAuth.ps1
Zacgoose May 29, 2026
e0f45f2
Backup excluded tenants config
Zacgoose May 29, 2026
e3d57cf
Update Invoke-CIPPStandardDeployCheckChromeExtension.ps1
Zacgoose May 29, 2026
a17137c
chore: remove cipp processor queue
JohnDuprey May 29, 2026
0fd3315
chore: disable cippcommand action
JohnDuprey May 29, 2026
e98445f
chore: sanitize cippid in public webhooks
JohnDuprey May 29, 2026
38e3ae9
chore: block arbitrary cmdlets not in CIPP modules
JohnDuprey May 29, 2026
c18bda8
fix: optimize checks
JohnDuprey May 29, 2026
c69e2ce
fix: allow for command without .value
JohnDuprey May 29, 2026
da7bd8c
chore: add devsecrets to restricted tables
JohnDuprey May 29, 2026
2ed3f94
chore: remove write host
JohnDuprey May 29, 2026
f5f3736
Optimize CIPP DB orchestration
Zacgoose May 30, 2026
7caadb2
fixes
Zacgoose May 30, 2026
11e613a
cleanup
Zacgoose May 30, 2026
dd8952e
reduce memory
Zacgoose May 30, 2026
518855c
test optimisation
Zacgoose May 30, 2026
999f028
Fix TenantAllowBlockListTemplate always reporting non-compliant
chris-dewey-1991 May 31, 2026
7b34160
update openapi spec with generated one
KelvinTegelaar May 31, 2026
4478065
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 31, 2026
8341f49
Test
KelvinTegelaar May 31, 2026
26a87b2
add-member force
KelvinTegelaar May 31, 2026
2a2851b
sso auth
KelvinTegelaar May 31, 2026
acf4bf3
Add or update the Azure App Service build and deployment workflow config
KelvinTegelaar May 31, 2026
72f7882
fixes another add member
KelvinTegelaar May 31, 2026
fad627f
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 31, 2026
54a3a08
api auth save and get changes
Zacgoose Jun 1, 2026
c16557f
Guarding for cache collection items
Zacgoose Jun 1, 2026
4b4a2d1
Update Set-CIPPDBCacheSharePointSiteUsage.ps1
Zacgoose Jun 1, 2026
f3393cb
Update Invoke-ExecUniversalSearchV2.ps1
Zacgoose Jun 1, 2026
9d8f1a0
correct incorrect pathing
Zacgoose Jun 1, 2026
a40683c
fix: access issues related to undefined roles
JohnDuprey Jun 1, 2026
3c19e62
fix: ip restriction logic
JohnDuprey Jun 1, 2026
648127f
fix: role for EditIntunePolicy
JohnDuprey Jun 1, 2026
679c390
fix: validate token exchange url is microsoft
JohnDuprey Jun 1, 2026
139b0c6
fix: sanitize more odata paths for tables
JohnDuprey Jun 1, 2026
a9797cd
chore: cleanup redundant tenant check in listexorequest
JohnDuprey Jun 1, 2026
ac33841
add featureflag for mcp
KelvinTegelaar Jun 1, 2026
468fb30
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Jun 1, 2026
235bd85
fix: validate and sanitize msp/choco app params
JohnDuprey Jun 1, 2026
256e9fc
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Jun 1, 2026
0c5d2bb
Fix TenantAllowBlockListTemplate always reporting non-compliant (#2069)
KelvinTegelaar Jun 1, 2026
55a97db
added logging
KelvinTegelaar Jun 1, 2026
0c54cd1
fix: move New-CIPPCoreRequest back to CIPPCore
JohnDuprey Jun 1, 2026
5a3b425
fix: Update endpoint roles to use Autopilot.Read (#2068)
KelvinTegelaar Jun 1, 2026
2492ad4
customsubject fix
KelvinTegelaar Jun 1, 2026
2875214
unique
KelvinTegelaar Jun 1, 2026
3f9dbd9
new licence report endpoint and revert old endpoint
Zacgoose Jun 1, 2026
3f842ab
fix: explicitly remove tenant from the table instead of using -cleanold
JohnDuprey Jun 2, 2026
55ddb18
Update Invoke-ExecTestRun.ps1
Zacgoose Jun 2, 2026
1167ff5
caching bump
Zacgoose Jun 3, 2026
6eeb31b
Pluralize standard name and continue on error
Zacgoose Jun 3, 2026
058da5e
rework mail contact standard and lazy load modules when needed
Zacgoose Jun 3, 2026
2edc759
Handle PendingAcceptance guests and update reporting
Zacgoose Jun 3, 2026
64efbd9
Apply multiple fixes to the add member to exo groups flow including a…
Zacgoose Jun 3, 2026
a9be272
Update Invoke-CIPPStandardEnableExchangeCloudManagement.ps1
Zacgoose Jun 3, 2026
3e99e66
add mcp allowed
KelvinTegelaar Jun 3, 2026
a2c2524
oauth prm
KelvinTegelaar Jun 3, 2026
1fc4263
feat: add Email as alternate login ID standard
kris6673 Jun 3, 2026
5c81043
change resource usage to craft well known
KelvinTegelaar Jun 3, 2026
6fc7d35
Revert custom well known
KelvinTegelaar Jun 3, 2026
0cd6f9d
MCP client updates to support client auth
KelvinTegelaar Jun 3, 2026
ec2eb83
add logging to mcp reation.
KelvinTegelaar Jun 3, 2026
49e8af8
feat: add Invoke-ExecSetCASMailbox function for CAS settings management
kris6673 Jun 3, 2026
2350636
add tot non-ng
KelvinTegelaar Jun 3, 2026
72c277d
Allow MCP client
KelvinTegelaar Jun 3, 2026
7800b3c
Fix
KelvinTegelaar Jun 3, 2026
77073ba
role change
KelvinTegelaar Jun 3, 2026
bc6aee4
fix: quarantine deny action
JohnDuprey Jun 4, 2026
4288bd8
exclude partner tenant
Zacgoose Jun 4, 2026
adba8fa
add excludeFromAlert to licenses.
KelvinTegelaar Jun 4, 2026
9a176cc
feat: Add Group-Based Licensing support (#2063)
KelvinTegelaar Jun 4, 2026
593911e
Feat: Add Invoke-ExecSetCASMailbox function for CAS settings manageme…
KelvinTegelaar Jun 4, 2026
a8e7aa5
Feat: Add Email as alternate login ID standard (#2075)
KelvinTegelaar Jun 4, 2026
2b3a7bb
resolves #6096
KelvinTegelaar Jun 4, 2026
ae92127
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Jun 4, 2026
53db433
better descriptions
KelvinTegelaar Jun 4, 2026
c7cebfe
better descriptions
KelvinTegelaar Jun 4, 2026
6a1c373
fixes issue with all tenants retrieval
KelvinTegelaar Jun 4, 2026
4909e9c
dbcache desc
KelvinTegelaar Jun 4, 2026
3ca5887
updated descriptions.
KelvinTegelaar Jun 4, 2026
7902097
add missing return
KelvinTegelaar Jun 4, 2026
65659c2
fix: remove headers parameter from scheduler details/list
JohnDuprey Jun 4, 2026
c5d1558
fix: version check
JohnDuprey Jun 4, 2026
c584938
fix: fallback to app version if one is not specified
JohnDuprey Jun 5, 2026
d4ddd3d
fix: additional protections for choco app deployment
JohnDuprey Jun 5, 2026
2bbcfcc
This endpoint is silly, we are going to manually try paging
Zacgoose Jun 5, 2026
90e45ea
pass timing to stop queue rerun protection drift
Zacgoose Jun 5, 2026
3fa0ee6
Pipe character escaping in names
Zacgoose Jun 5, 2026
2b3a1c8
Fix for manually run standards being excluded from applied standards …
Zacgoose Jun 5, 2026
4435ea3
CA expansion for tags
KelvinTegelaar Jun 5, 2026
9cab066
CA expansion for tags
KelvinTegelaar Jun 5, 2026
2b093c3
fixes issue with CA compare and a weird blank line
KelvinTegelaar Jun 5, 2026
f7f51cc
remove duplicate non gated cache collection items
Zacgoose Jun 5, 2026
ed47810
Update Test-CIPPAccess.ps1
Zacgoose Jun 5, 2026
c040658
Update FeatureFlags.json
Zacgoose Jun 5, 2026
612ba54
Update Get-CIPPTenantAlignment.ps1
Zacgoose Jun 5, 2026
f0f361d
restart helper
Zacgoose Jun 5, 2026
961462f
fix: role assignment checks
JohnDuprey Jun 5, 2026
503eac5
fix: apps and services test
JohnDuprey Jun 5, 2026
ee1884f
add permissions for new settings endpoint
JohnDuprey Jun 5, 2026
d817b6d
fix: cis test 1_3_5
JohnDuprey Jun 5, 2026
da10bf9
renumber for cis7
KelvinTegelaar Jun 5, 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
  •  
  •  
  •  
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