s365b.modules.entra =================== .. py:module:: s365b.modules.entra .. autoapi-nested-parse:: Entra ID module: directory objects, roles and policies. Every run reads a full snapshot (directory data is small). Each object is stored as normalised JSON, so an unchanged object is deduplicated and costs nothing; changed objects get a new version, and objects that disappeared are recorded as deleted. Restore is not implemented yet; the restore app gets no Entra permissions until it is. Submodules ---------- .. toctree:: :maxdepth: 1 /reference/api/s365b/modules/entra/module/index /reference/api/s365b/modules/entra/sources/index Classes ------- .. autoapisummary:: s365b.modules.entra.EntraModule Package Contents ---------------- .. py:class:: EntraModule Bases: :py:obj:`s365b.modules.sdk.BackupModule` Backs up Entra ID (Azure AD) directory objects and policies. .. py:attribute:: id :type: ClassVar[str] :value: 'entra' .. py:attribute:: display_name :type: ClassVar[str] :value: 'Entra ID' .. py:attribute:: description :type: ClassVar[str] :value: 'Users, groups, apps, roles, Conditional Access and tenant policies.' .. py:attribute:: version :type: ClassVar[str] :value: '0.2.0' .. py:attribute:: config_model :type: ClassVar[type[pydantic.BaseModel]] .. py:attribute:: object_noun :type: ClassVar[tuple[str, str]] :value: ('category', 'categories') .. py:method:: required_permissions(config: pydantic.BaseModel, *, restore: bool) -> set[str] Return the Graph application permissions needed. :param config: Module settings (none). :param restore: Restore is not implemented yet, so it needs nothing. :returns: Read permissions for backup; nothing for restore. .. py:method:: event_types() -> list[s365b.modules.sdk.EventType] Alerts for security-relevant directory changes. :returns: The event types. .. py:method:: change_event(item_type: str, change: str, version: s365b.modules.sdk.ItemVersion) -> str | None Map a change to an alert (see ``CHANGE_EVENTS``). :param item_type: The item's type. :param change: ``new``, ``changed`` or ``deleted``. :param version: The new version. :returns: The event ID, or ``None`` for changes that do not alert. .. py:method:: item_types() -> list[s365b.modules.sdk.ItemTypeInfo] Describe the item types. :returns: One entry per Graph object type. .. py:method:: discover(ctx: s365b.modules.sdk.ModuleContext) -> collections.abc.AsyncIterator[s365b.modules.sdk.ProtectedObject] :async: Yield one protected object per category. :param ctx: Module context. :Yields: The categories. .. py:method:: state_for_new_repository(state: s365b.modules.sdk.SyncState) -> s365b.modules.sdk.SyncState Keep the state: every run reads everything, and it finds deletions. :param state: The state saved by the backup into the other repository. :returns: The same state. .. py:method:: backup(ctx: s365b.modules.sdk.ModuleContext, obj: s365b.modules.sdk.ProtectedObject, state: s365b.modules.sdk.SyncState) -> collections.abc.AsyncIterator[s365b.modules.sdk.ItemVersion | s365b.modules.sdk.Checkpoint] :async: Snapshot one category. Every object is yielded each run (the catalog keeps only changed ones); objects seen last time but not now are yielded as deleted. A checkpoint follows each source. :param ctx: Module context. :param obj: The category. :param state: ``{"seen": {source key: [item keys]}}`` from the last run. :Yields: Item versions and checkpoints. :raises ModuleError: For an unknown category or missing permissions.