Goal: Get all 5 bots running against a real tenant in ~30–60 minutes.
- M365 Business Premium trial tenant (recommended)
- Existing business tenant (least-privilege app registration)
- Tenant Global Admin for initial consent
- One dedicated app registration for E8CR (or per-bot apps)
- Test endpoint(s) enrolled in Intune + Defender for Endpoint connected
- Python 3.11+ on runner host
Create app registration in Entra:
- Name:
e8cr-squad-bot - Auth: Application permissions only (client credentials)
- Secret: 6–12 month client secret (store securely)
Collect:
AZURE_TENANT_IDAZURE_CLIENT_IDAZURE_CLIENT_SECRET
Directory.Read.AllAuditLog.Read.All
DeviceManagementManagedDevices.Read.AllDeviceManagementConfiguration.Read.AllSecurityEvents.Read.All(if used in tenant)
Policy.Read.AllRoleManagement.Read.DirectoryUserAuthenticationMethod.Read.AllUser.Read.All
DeviceManagementConfiguration.Read.AllDeviceManagementManagedDevices.Read.AllDeviceManagementConfiguration.ReadWrite.All(only if policy deployment is enabled)
SecurityAlert.Read.All(or Graph Security equivalent in your tenant)SecurityIncident.Read.All(if incidents endpoint used)
Graph app perms above are not enough by themselves. Also assign Azure RBAC on Recovery Services Vault:
Backup Reader(read-only validation)Backup Contributor(if actions are needed)
After adding permissions: Grant admin consent.
# Shared Graph creds
export AZURE_TENANT_ID="<tenant-id>"
export AZURE_CLIENT_ID="<app-id>"
export AZURE_CLIENT_SECRET="<client-secret>"
# Backup provider (optional: Veeam)
export VEEAM_BASE_URL="https://veeam-server:9398"
export VEEAM_USERNAME="backup-admin@domain.com"
export VEEAM_PASSWORD="<secure-password>"
export VEEAM_VERIFY_SSL="true"
# Backup provider (optional: Azure Recovery Services)
export AZURE_SUBSCRIPTION_ID="<subscription-id>"
export AZURE_VAULT_NAME="<vault-name>"
export AZURE_RESOURCE_GROUP="<rg-name>"python3 skills/e8cr-vmpm/scripts/graph_auth.pyExpect: token retrieval success.
python3 skills/e8cr-vmpm/scripts/graph_devices.py
python3 skills/e8cr-vmpm/scripts/graph_patches.pypython3 skills/e8cr-identity/scripts/entra_mfa.py
python3 skills/e8cr-identity/scripts/entra_roles.py
python3 skills/e8cr-identity/scripts/entra_ca.pypython3 skills/e8cr-appcontrol/scripts/intune_appcontrol.py --mode audit
python3 skills/e8cr-appcontrol/scripts/intune_macros.py --mode audit
python3 skills/e8cr-appcontrol/scripts/intune_hardening.py --mode auditpython3 skills/e8cr-backup/scripts/provider_dispatch.py --mode detect
python3 skills/e8cr-backup/scripts/provider_dispatch.py --mode fetch-jobspython3 skills/e8cr-edr/scripts/defender_alerts.py --mode listpython3 skills/e8cr-vmpm/scripts/generate_report.py --input /tmp/e8cr-demo --output /tmp/e8cr-demo/weekly-report.html
python3 skills/e8cr-identity/scripts/demo_generate.py --output /tmp/e8cr-demo/identity --full-pipeline
python3 skills/e8cr-appcontrol/scripts/demo_generate.py --output /tmp/e8cr-demo/appcontrol --full-pipeline
python3 skills/e8cr-backup/scripts/demo_generate.py --output /tmp/e8cr-demo/backup --full-pipeline
python3 skills/e8cr-edr/scripts/demo_generate.py --output /tmp/e8cr-demo/edr --full-pipeline- Missing Graph permission or no admin consent granted.
- Tenant not licensed/configured for Intune yet.
- Defender for Endpoint not onboarded on test devices.
- Missing env vars for Veeam/Azure backup.
- Use dedicated app registration (do not reuse admin apps)
- Scope permissions to minimum set above
- Rotate secret every 90 days
- Log all bot actions and report generation
- Start in read/audit mode first, then enable writes/response actions
Tenant is ready when:
- Graph token retrieval works
- All 5 bots return non-error audit output
- At least 1 report generated from real tenant data
- Access-control checks documented for Backup/EDR actions