Conditional Access Policy Plans: Was die Graph API (noch) nicht in der Doku verrät
Policy Plans - diesmal von der API-Seite
Nachdem Microsoft die Conditional Access Policy Plans Ende Oktober in die Preview gebracht hat, gibt es mittlerweile ausreichend Blogposts, welche erklären was ein Plan ist, wie „Shared Conditions” funktionieren und wie man bestehende Policies im Portal in einen Plan migriert. Was mich jedoch mehr interessiert hat, ist der neue Endpoint /beta/identity/conditionalAccess/plans, welcher seit 22. Oktober im Graph Changelog steht, und vor allem die Frage, was dieser in der Praxis tatsächlich kann und was eben nicht.
Ich habe den Endpoint daher in meinem Lab-Tenant ziemlich ausgiebig “getestet” (Plans angelegt, Limits ausgereizt, Berechtigungen getestet, Errors forciert), und dabei sind einige Erkenntnisse herausgekommen, welche bisher in keiner Doku stehen:
- wie sieht es mit dem 240 CA Rule Limit aus? Gilt das auch für Policy Plans?
- warum Shared Conditions auch hinderlich sein können
- weshalb Plans für eure bestehenden CA-Tools unsichtbar sind und umgekehrt
- eine Lücke im Audit Log, welche man kennen sollte
- was die API bereits über kommende Agent-Features verrät
1 - Gilt das 240er Limit auch für Plans?
Kurze Antwort: nein. Klassische CA-Policies sind im Directory als Objekte vom Typ MultiConditionalAccessPolicy abgelegt, und genau auf diese bezieht sich das bekannte Limit. Ein Plan ist zwar ebenfalls ein Directory-Objekt, allerdings von einem neuen Typ, welchen Graph über /directoryObjects noch nicht einmal serialisieren kann, während die einzelnen Rules überhaupt keine eigenen Objekte sind, sondern innerhalb des Plans leben.
In Zahlen sieht das folgendermaßen aus:
- maximal 100 Rules pro Plan (momentan), weder über
POST /rulesnoch über einen PATCH auf den Plan umgehbar - in Summe hatte ich parallel 2048 Rules in unterschiedlichen Plans deployt - funktionierte fehlerlos - klassische Policies ließen sich während dieses Zustandes weiterhin problemlos anlegen (obwohl ich bereits 200 klassische CA Policies im Tenant habe)
Ich gehe davon aus, dass genau das einer der eigentlichen Gründe für das Feature ist, nachdem die kommenden Agent-Szenarien (dazu weiter unten mehr) sehr viele kleinteilige Rules erfordern werden und auch GSA immer mehr Policies erfordert, was mit klassischen Policies das Limit relativ schnell sprengen würde.
2 - Shared Conditions sind keine Scope-Grenze
Das hier ist meiner Ansicht nach der wichtigste Punkt für alle, welche Plans tatsächlich designen werden. Intuitiv würde man annehmen, dass ein Plan, welcher in den Shared Conditions die Gruppe A inkludiert, alle seine Rules auf genau diese Gruppe einschränkt. Das ist jedoch nicht der Fall, denn Includes aus dem Plan und Includes aus der Rule werden vereinigt und nicht geschnitten, was sich über die What-If API (/conditionalAccess/evaluate) mit Testusern sehr sauber nachvollziehen lässt, welche die effektiv zusammengeführte Rule mit includeGroups: [A, B] zurückliefert.
Dies hat zur Folge, dass eine Rule mit „All users” innerhalb eines Plans, welcher eigentlich nur eine Persona adressieren soll, schlicht den gesamten Tenant trifft. Hier gibt’s auch keine Warnung, dass das eventuell nicht gewollt sein könnte. Exclusions verhalten sich dagegen genau so, wie es Microsoft dokumentiert: ein Exclude auf Plan-Ebene gewinnt immer, auch gegenüber einem direkten User-Include in der Rule.
3 - Unsichtbar für bestehende Tools
Plan-Rules tauchen unter /identity/conditionalAccess/policies nicht auf. Jedes Tool, welches heute eure CA-Konfiguration ausliest, sei es für Backups, IaC (Infrastructure as Code), Assessments oder Dokumentation, sieht Plans daher schlicht nicht, solange es nicht explizit um den neuen Endpoint erweitert wird. Im Sign-in Log erscheinen die Rules zwar ganz normal in appliedConditionalAccessPolicies, allerdings nur mit Rule-ID und Rule-Name, ohne jeglichen Bezug zum übergeordneten Plan, wodurch auch KQL-basierte Workbooks (Sentinel) keine Möglichkeit haben, eine Rule ihrem Plan zuzuordnen. Bei einer Agent-Rule kam als result zusätzlich ein unknownFutureValue zurück, also ein Wert, welchen das Graph-Schema noch gar nicht kennt.
Lösung: CA-Tooling und Workbooks um /plans ergänzen und das Mapping Rule-ID zu Plan selbst aus der API aufbauen.
4 - Die Lücke im Audit Log
Auf diesen Punkt bin ich eher zufällig gestoßen, nachdem bei meinen Limit-Tests deutlich weniger Audit Events angekommen sind als Operationen durchgeführt wurden. Die Ursache ist ein Größenlimit: Entra speichert bei Plan-Operationen das komplette Plan-JSON in modifiedProperties (rund 500 Zeichen pro Rule), und sobald dieses etwa 22.000 Zeichen überschreitet, wird schlicht kein Audit Event mehr geschrieben.
| Operation | wird geloggt bis | kein Event ab |
|---|---|---|
| Plan anlegen | ca. 40 Rules | ca. 44 Rules |
| Plan ändern (alter & neuer Wert im Event) | ca. 20 Rules | ca. 21 Rules |
| Plan löschen / endgültig entfernen | kleine Plans | große Plans |
| Rule anlegen / ändern | immer | - |
Konkret getestet: Ein User, welcher in den Shared Conditions eines Plans mit 30 Rules excluded wurde, ist damit sofort aus allen 30 Rules ausgenommen, ohne dass dazu auch nur ein einziges Audit Event existiert. Da das Limit an der Größe und nicht an der Anzahl hängt, erreichen Rules mit vielen Gruppen oder Apps diese Grenze entsprechend früher.
Es handelt sich hier um eine Preview und ich gehe stark davon aus, dass dieses Verhalten nicht so gewollt ist. Bis das gefixt ist, sollte man sich jedoch nicht auf das Audit Log allein verlassen.
Ich hab dieses Thema auch direkt an das MSRC reported - ich gehe davon aus, dass dieses Thema bis zum GA des Features gefixt wird.
5 - Undokumentiertes & Abweichungen von der Doku
Zusätzlich sind mir einige Punkte aufgefallen, welche entweder gar nicht oder anders als dokumentiert funktionieren:
- PATCH auf den Plan mit
rulesist ein Upsert: neue Rules werden angelegt, Rules mit bestehenderidaktualisiert, gelöscht wird jedoch nichts - Soft Delete existiert:
/conditionalAccess/deletedItems/planssamtrestorefunktioniert und stellt den Plan inklusive aller Rules wieder her, einzeln gelöschte Rules sind dagegen endgültig weg - OData: von
$top,$count,$filter,$orderby,$selectund$expandfunktioniert lediglich$skip, Paging gibt es keines (40 Plans kamen als eine einzige 2,3 MB Response zurück) - Fehlermeldungen: die eigentliche Ursache steht ausschließlich in
innerError.message(Codes 2xxx), die Hauptmeldung ist immer dasselbe generische „malformed or incorrect” - Berechtigungen (app-only): lesen funktioniert mit
Policy.Read.All, schreiben erfordert wie bei klassischen PoliciesPolicy.Read.AllUNDPolicy.ReadWrite.ConditionalAccess, währendPolicy.Read.ConditionalAccessallein (entgegen der Doku) mit 403 endet
6 - Was die API über kommende Features verrät
Der spannendste Teil kam ehrlicherweise aus den Fehlermeldungen, nachdem die Validierung im Backend für eine ganze Reihe von Features bereits fertig implementiert ist, welche lediglich über Private Preview Flags (z.B. MrpaUserAndGroupTargeting, ClientsCondition, FederatedTokensIssuerOnly) gesperrt sind. Zusammen mit dem, was Microsoft rund um „Dynamic Conditional Access” für Agents angekündigt hat, ergibt sich daraus ein ziemlich klares Bild (das ist meine Interpretation, nicht offiziell bestätigt):
includeAgentActions: microsoftRecommendedProtectedActions: ein neues Target neben Apps und User Actions, nämlich von Microsoft kuratierte „gefährliche” Agent-AktionenhumanApproval: eine Session Control, welche riskante Agent-Aktionen auf eine menschliche Freigabe warten lässt, und zwar über ein Access Package (channelType: accessPackage)blockSensitiveActions: lesen erlauben, sensible Aktionen blockieren, passend zu Microsofts „preserve reads while blocking writes”agentContextmitallAgentAssistedFlows, also Agents, welche im Auftrag eines Users handeln, sowieagentSessionRiskLevelsfür das Risiko der Agent-Session statt der Agent-Identität - vergleichbar mit dem SignIn Risk vs. User Risk in Entra ID Identity Protection vermutlichclients(include All, exclude AllFirstParty)
Mit Ignite vom 17. bis 20. November steht der wahrscheinlichste Termin für die ersten Ankündigungen dazu bereits vor der Tür.
Fazit
Policy Plans sind meiner Ansicht nach weniger Komfort-Feature als vielmehr das Fundament für das, was bei Agent Security in den nächsten Monaten kommen wird, und genau deshalb lohnt sich der Blick auf die API schon jetzt. Für den produktiven Einsatz würde ich derzeit vor allem die Targeting-Logik und die Audit-Lücke im Hinterkopf behalten, nachdem beide in der Praxis zu Konfigurationen führen können, welche weder im Portal noch im Audit Log so aussehen, wie sie tatsächlich wirken.
Falls ihr selbst schon mit dem Endpoint gespielt habt und auf weitere Eigenheiten gestoßen seid, meldet euch gerne, ich bin gespannt, was davon bis zur GA noch übrig bleibt.
Policy Plans - this time from the API side
Since Microsoft brought Conditional Access Policy Plans into preview at the end of October, there are plenty of blog posts explaining what a plan is, how “shared conditions” work and how to migrate existing policies into a plan in the portal. What interested me more, however, is the new endpoint /beta/identity/conditionalAccess/plans, which has been listed in the Graph changelog since October 22, and above all the question of what it can actually do in practice and what it can’t.
So I “tested” the endpoint fairly extensively in my lab tenant (creating plans, pushing limits, testing permissions, forcing errors), and a number of findings came out of it that aren’t in any documentation so far:
- what about the 240 CA rule limit? Does it also apply to policy plans?
- why shared conditions can also get in your way
- why plans are invisible to your existing CA tools and vice versa
- a gap in the audit log you should know about
- what the API already reveals about upcoming agent features
1 - Does the 240 limit apply to plans?
Short answer: no. Classic CA policies are stored in the directory as objects of type MultiConditionalAccessPolicy, and that is what the well-known limit refers to. A plan is also a directory object, but of a new type that Graph can’t even serialize via /directoryObjects yet, while the individual rules are not objects of their own at all but live inside the plan.
In numbers:
- a maximum of 100 rules per plan (for now), which can’t be bypassed via
POST /rulesor via a PATCH on the plan - in total I had 2048 rules deployed in parallel across different plans - worked without a single error - classic policies could still be created without issues in that state (even though I already have 200 classic CA policies in the tenant)
I assume this is one of the actual reasons for the feature, since the upcoming agent scenarios (more on that below) will require a lot of fine-grained rules and GSA also requires more and more policies, which would blow through the limit fairly quickly with classic policies.
2 - Shared conditions are not a scope boundary
In my view this is the most important point for anyone who will actually design plans. Intuitively you would assume that a plan including group A in its shared conditions restricts all of its rules to exactly that group. That is not the case, though, because includes from the plan and includes from the rule are merged rather than intersected, which can be traced very cleanly with test users via the What-If API (/conditionalAccess/evaluate), which returns the effectively merged rule with includeGroups: [A, B].
As a result, a rule with “All users” inside a plan that is meant to address a single persona simply hits the entire tenant. There is also no warning that this might not be intended. Exclusions, on the other hand, behave exactly as Microsoft documents: an exclude at plan level always wins, also over a direct user include in the rule.
3 - Invisible to existing tools
Plan rules do not show up under /identity/conditionalAccess/policies. Any tool that reads your CA configuration today, whether for backups, IaC (Infrastructure as Code), assessments or documentation, simply doesn’t see plans unless it is explicitly extended to the new endpoint. In the sign-in log the rules do appear in appliedConditionalAccessPolicies as usual, but only with rule ID and rule name and without any reference to the parent plan, so KQL-based workbooks (Sentinel) have no way of mapping a rule to its plan. For one agent rule the result even came back as unknownFutureValue, a value the Graph schema doesn’t know yet.
Solution: extend CA tooling and workbooks to /plans and build the rule ID to plan mapping from the API yourself.
4 - The gap in the audit log
I came across this one rather by accident, after noticing that far fewer audit events arrived during my limit tests than operations had been performed. The cause is a size limit: for plan operations Entra stores the complete plan JSON in modifiedProperties (roughly 500 characters per rule), and once that exceeds about 22,000 characters, no audit event is written at all.
| Operation | logged up to | no event from |
|---|---|---|
| Create plan | approx. 40 rules | approx. 44 rules |
| Update plan (old & new value in the event) | approx. 20 rules | approx. 21 rules |
| Delete / permanently remove plan | small plans | large plans |
| Create / update rule | always | - |
Tested specifically: a user excluded in the shared conditions of a plan with 30 rules is immediately exempt from all 30 rules, without a single audit event existing for it. Since the limit depends on size rather than count, rules with many groups or apps reach it correspondingly earlier.
This is a preview and I strongly assume this behavior isn’t intended. Until it is fixed, however, you shouldn’t rely on the audit log alone.
I have also reported this directly to MSRC - I expect it to be fixed by the time the feature reaches GA.
5 - Undocumented behavior & deviations from the docs
On top of that I noticed a few things that either aren’t documented at all or work differently than documented:
- PATCH on the plan with
rulesis an upsert: new rules are created, rules with an existingidare updated, but nothing gets deleted - Soft delete exists:
/conditionalAccess/deletedItems/plansincludingrestoreworks and restores the plan with all its rules, while individually deleted rules are gone for good - OData: of
$top,$count,$filter,$orderby,$selectand$expandonly$skipworks, and there is no paging (40 plans came back as a single 2.3 MB response) - Error messages: the actual cause is only in
innerError.message(codes 2xxx), the main message is always the same generic “malformed or incorrect” - Permissions (app-only): reading works with
Policy.Read.All, writing requiresPolicy.Read.AllANDPolicy.ReadWrite.ConditionalAccessjust like classic policies, whilePolicy.Read.ConditionalAccessalone (contrary to the docs) ends in a 403
6 - What the API reveals about upcoming features
Honestly, the most exciting part came from the error messages, since the backend validation is already fully implemented for a whole range of features that are only locked behind private preview flags (e.g. MrpaUserAndGroupTargeting, ClientsCondition, FederatedTokensIssuerOnly). Combined with what Microsoft has announced around “Dynamic Conditional Access” for agents, a fairly clear picture emerges (this is my interpretation, not officially confirmed):
includeAgentActions: microsoftRecommendedProtectedActions: a new target alongside apps and user actions, namely “dangerous” agent actions curated by MicrosofthumanApproval: a session control that makes risky agent actions wait for human approval, via an access package (channelType: accessPackage)blockSensitiveActions: allow reads, block sensitive actions, matching Microsoft’s “preserve reads while blocking writes”agentContextwithallAgentAssistedFlows, i.e. agents acting on behalf of a user, plusagentSessionRiskLevelsfor the risk of the agent session rather than the agent identity - probably comparable to sign-in risk vs. user risk in Entra ID Identity Protectionclients(include All, exclude AllFirstParty)
With Ignite from November 17 to 20, the most likely date for the first announcements is right around the corner.
Conclusion
In my view, policy plans are less a convenience feature and more the foundation for what is coming in agent security over the next months, which is exactly why looking at the API already pays off now. For production use I would currently keep the targeting logic and the audit gap in mind above all, since both can lead to configurations in practice that look neither in the portal nor in the audit log the way they actually behave.
If you have already played with the endpoint yourselves and stumbled upon further quirks, feel free to reach out, I’m curious how much of this will still be around at GA.