Tenants: Tenant anlegen/öffnen → tenant_id, app_client_id, app_client_secret setzen → Make current (wichtig). Inventory → Policies: oben Sync from Intune. In der Tabelle nach Type = “Driver Updates (Windows)” (windowsDriverUpdateProfile) filtern und Policy öffnen. Auf der Policy: Settings-Tab prüfen (Block „Driver Update Profile“), dann Capture snapshot klicken und unter Versions die Version ansehen. Restore-Test (nur im Test-Tenant!): Version öffnen → Restore to Intune erst als Dry-run, dann Execute; danach unter Backups & Restore → Restore Runs Ergebnis prüfen (soll graph_path mit deviceManagement/windowsDriverUpdateProfiles/... zeigen). Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local> Reviewed-on: #27
2.0 KiB
2.0 KiB
Plan: Endpoint Security Policy Restore (023)
Branch: feat/023-endpoint-security-restore
Date: 2026-01-03
Input: spec.md
Status: Implemented (ready to merge)
Goal
Enable full restore execution for Endpoint Security Policies (endpointSecurityPolicy) instead of preview-only, with defensive validation around templates and settings payloads.
Approach
- Enable restore execution in
config/tenantpilot.phpby switchingendpointSecurityPolicy.restorefrompreview-onlytoenabled. - Add template existence validation during restore preview:
- Resolve the snapshot’s
templateReference(family/id/display name where available). - Confirm the referenced template is resolvable in the target tenant before execution.
- Surface warnings in preview and fail execution with a clear error when missing.
- Resolve the snapshot’s
- Add settings instance validation prior to execution:
- Resolve template definitions for the target tenant.
- Validate that settings instances are structurally compatible with the resolved template.
- Treat validation failures as preview warnings, and block execution when the payload cannot be made safe.
- Ensure restore uses the existing generic configuration policy create/update flow:
- Create when no match exists; update when matched (per existing restore matching rules).
- Apply assignments using existing mapping logic.
- Add targeted tests covering:
- Create + update restore execution for
endpointSecurityPolicy. - Preview warnings and execution failure when template is missing.
- Settings validation failure paths.
- Assignment application expectations.
- Create + update restore execution for
Decisions / Notes
- Assume template identifiers may differ across tenants; prefer mapping by
templateFamilywith display-name fallback when required. - Safety-first: if template resolution is ambiguous, treat as missing and block execution.
- Incident hardening: make restore failures actionable by surfacing Graph path/method and avoid unsafe fallback endpoints.