Intune Drift Sentry
aharwelik/intune-drift-sentry
Detecta e reverte desvios de config no Intune com diff semântico
Ver no GitHubSkill que detecta e reverte desvios de configuração no Microsoft Intune comparando dois snapshots semanticamente. Classifica mudanças por risco, gera planos de rollback e emite recibos verificáveis — tudo offline sem dependências externas.
Instalação
npx convez-ai aharwelik/intune-drift-sentry1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Auditoria de mudanças não autorizadas em políticas Intune
- Reversão segura de configurações de endpoint que divergiram da baseline
- Integração em pipelines GitOps para validação de policy-as-code
Veredito

Ferramenta sólida e bem-arquitetada para governança de Intune. Enche um vazio real (falta de undo nativo) com semântica clara e sem dependências, ideal para times que precisam de controle rigoroso de configurações de endpoint em escala.
README
A tradução para o português deste README ainda está na fila.
intune-drift-sentry
The undo button Intune does not have. Diff two configuration snapshots, classify the drift by risk, and get a rollback plan that restores the baseline -- offline, as a Claude Code skill, with a verifiable change receipt.
Keywords: Microsoft Intune, configuration drift, policy as code, configuration as code, Intune rollback, semantic diff, endpoint management, MDM, Microsoft Graph, change management, Claude Code skill, Intune backup restore, DevOps for Intune.
The problem
Console clicks in Intune leave an audit entry that a profile changed at a time. They do not tell you the previous value, whether the change was intended, or how to put it back. That is how drift starts: one engineer tweaks a setting to fix an urgent issue, another makes a conflicting change elsewhere, and there is no single click to undo it. Rollback is sold as a third-party feature.
The configuration-as-code answer is to treat the exported configuration as source: commit a baseline, re-export, and diff. This tool is the diff -- but a semantic one. It matches settings on a canonical identity, explains changes in policy terms instead of raw JSON, ranks them by risk, and writes the reverse plan.
What it does
- Semantic diff of two snapshots: settings added, removed, and changed; assignments widened or narrowed; whole policies added or removed.
- Drift classification by severity, with a
[security]tag on security-relevant settings and a flag on assignments widened to all devices or users. - Rollback plan: one concrete reverse step per change, ordered by severity.
- Verifiable receipt: emit a proof-carrying-ops
receipt for the rollback and verify it with
pco.
Install
No dependencies. Python 3.10+.
git clone https://github.com/aharwelik/intune-drift-sentry
cd intune-drift-sentry
Use it
python -m driftsentry diff examples/snapshot.a.json examples/snapshot.b.json --rollback
Output on the bundled example:
Intune configuration drift
changes=6 high=5 medium=1 low=0
[HIGH] setting_changed on 'Defender Baseline' device_vendor_msft_policy_config_defender_allowrealtimemonitoring [security]
'1' -> '0'
[HIGH] assignment_added on 'BitLocker'
None -> 'allDevices'
assignment widened to allDevices
[HIGH] policy_removed on 'AppLocker Enforce' [security]
entire policy removed (loss of control)
...
ROLLBACK PLAN (restores current to baseline)
1. On policy 'BitLocker' remove assignment target allDevices
3. Recreate policy 'AppLocker Enforce' (endpointSecurity) from the baseline snapshot
4. On policy 'Defender Baseline' set ...allowrealtimemonitoring = '1' (current value '0')
...
Exit code is 1 when drift at or above the --fail-on threshold (default
high) is present, so it gates a config-as-code pipeline.
Verifiable rollback receipt
python -m driftsentry diff baseline.json current.json --receipt | python -m pco verify -
# -> "status": "trustworthy" (the rollback covers every change and is reversible)
This composes with the proof-carrying-ops gate: a trustworthy verdict certifies that the proposed rollback is complete and reversible before anyone runs it.
Use it as a Claude Code skill
mkdir -p ~/.claude/skills/intune-drift-sentry
cp skill/SKILL.md ~/.claude/skills/intune-drift-sentry/SKILL.md
Then ask Claude to "diff this Intune baseline against the current export and give me a rollback plan."
Snapshot schema
A snapshot is {"policies": [{id, name, type, assignments, settings}, ...]},
the same export shape used by
intune-conflict-detector;
see that repo's docs/COLLECTOR.md for producing one from Microsoft Graph with a
read-only scope.
Theory
This implements the Reversibility invariant of the proof-carrying-ops model: a change is trustworthy only if it can be undone and was actually checked. The tool turns observed drift into a reverse plan and certifies, via a receipt, that the plan covers every change. Matching settings across snapshots relies on the Identity Normalization invariant.
Honesty boundary
Read-only and offline; it never calls Graph or applies changes. Values are compared literally. The rollback is expressed as Graph-level intents; executing them is deliberately a separate, human-approved step.
Design
Standard library only, tested on Python 3.10 through 3.13, no-emoji guard in CI.
Author
Anthony Harwelik -- aharwelik@gmail.com -- https://github.com/aharwelik
License
MIT. See LICENSE.