Phishing & Email Header Analyzer
Trace the hops and spot spoofing, locally
Builds a baseline set of Microsoft Entra Conditional Access policies (MFA, legacy authentication, device compliance, risk) from your licensing and requirements, with break-glass accounts covered.
| Name | Why | Licence |
|---|---|---|
| CA001-Admins-AllApps-RequirePhishingResistantMFA | Admin accounts are the most valuable target. Phishing-resistant MFA (FIDO2 keys, Windows Hello, passkeys) stops token-phishing kits that defeat app prompts. | P1 |
| CA002-AllUsers-AllApps-RequireMFA | MFA blocks the vast majority of password-spray and credential-stuffing attacks. | P1 |
| CA003-AllUsers-LegacyAuth-Block | Legacy protocols (IMAP, POP, SMTP AUTH, older Office clients) can’t do MFA, so attackers use them to bypass it. | P1 |
| CA004-Guests-AllApps-RequireMFA | Guests sign in with accounts you don’t manage, so you can’t rely on their home tenant’s security. | P1 |
| CA005-AllUsers-AzureManagement-RequireMFA | Covers the Azure portal, Azure CLI and PowerShell, where anyone with an Azure role can change resources. | P1 |
| CA006-Admins-AllApps-SignInEvery4Hours | Shorter admin sessions and no “stay signed in” limit how long a stolen admin session cookie is useful. | P1 |
# Conditional Access baseline: generated by techieshelp.com. Review before running.
# Policies are created in report-only mode. Check sign-in logs (Conditional Access tab) before switching them on.
# Install-Module Microsoft.Graph -Scope CurrentUser # once
Connect-MgGraph -Scopes 'Policy.ReadWrite.ConditionalAccess', 'Policy.Read.All', 'Group.ReadWrite.All', 'Application.Read.All' -NoWelcome
# 1. Break-glass exclusion group (put your 2 emergency access accounts in it, cloud-only, with FIDO2 keys)
$bgName = 'CA-Exclude-BreakGlass'
$bg = Get-MgGroup -All | Where-Object DisplayName -eq $bgName | Select-Object -First 1
if (-not $bg) {
$bg = New-MgGroup -DisplayName $bgName -MailEnabled:$false -MailNickname ($bgName -replace '[^a-zA-Z0-9]', '') -SecurityEnabled:$true -Description 'Excluded from all Conditional Access policies. Emergency access accounts only.'
Write-Warning "Created $bgName. Add your break-glass accounts to it BEFORE enabling any policy."
}
# 3. Policies (skips any that already exist by name)
$policies = @(
@'
{
"displayName": "CA001-Admins-AllApps-RequirePhishingResistantMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeRoles": [
"62e90394-69f5-4237-9190-012177145e10",
"e8611ab8-c189-46e8-94e1-60213ab1f814",
"7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
"194ae4cb-b126-40b2-bd5b-6091b380977d",
"b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
"29232cdf-9323-42fd-ade2-1d097af3e4de",
"f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
"fe930be7-5e62-47db-91af-98c3a49a38b1",
"729827e3-9c14-49f7-bb1b-9608f156bbb8",
"c4e39bd9-1100-46d3-8c65-fb160da0071f",
"9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
"158c047a-c907-4556-b7ef-446551a6b5f7",
"3a2c62db-5318-420d-8d74-23affee5d9d5",
"b0f54661-2d74-4c50-afa3-1ec803f12efe"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"authenticationStrength": {
"id": "00000000-0000-0000-0000-000000000004"
}
}
}
'@,
@'
{
"displayName": "CA002-AllUsers-AllApps-RequireMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"All"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"mfa"
]
}
}
'@,
@'
{
"displayName": "CA003-AllUsers-LegacyAuth-Block",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"All"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"exchangeActiveSync",
"other"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"block"
]
}
}
'@,
@'
{
"displayName": "CA004-Guests-AllApps-RequireMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"GuestsOrExternalUsers"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"mfa"
]
}
}
'@,
@'
{
"displayName": "CA005-AllUsers-AzureManagement-RequireMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"All"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"797f4846-ba00-4fd7-ba43-dac1f8f63013"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"mfa"
]
}
}
'@,
@'
{
"displayName": "CA006-Admins-AllApps-SignInEvery4Hours",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeRoles": [
"62e90394-69f5-4237-9190-012177145e10",
"e8611ab8-c189-46e8-94e1-60213ab1f814",
"7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
"194ae4cb-b126-40b2-bd5b-6091b380977d",
"b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
"29232cdf-9323-42fd-ade2-1d097af3e4de",
"f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
"fe930be7-5e62-47db-91af-98c3a49a38b1",
"729827e3-9c14-49f7-bb1b-9608f156bbb8",
"c4e39bd9-1100-46d3-8c65-fb160da0071f",
"9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
"158c047a-c907-4556-b7ef-446551a6b5f7",
"3a2c62db-5318-420d-8d74-23affee5d9d5",
"b0f54661-2d74-4c50-afa3-1ec803f12efe"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"sessionControls": {
"signInFrequency": {
"isEnabled": true,
"value": 4,
"type": "hours",
"frequencyInterval": "timeBased"
},
"persistentBrowser": {
"isEnabled": true,
"mode": "never"
}
}
}
'@
)
foreach ($json in $policies) {
$json = $json.Replace('{{BREAK_GLASS_GROUP_ID}}', $bg.Id)
$body = $json | ConvertFrom-Json -AsHashtable
$exists = Get-MgIdentityConditionalAccessPolicy -All | Where-Object DisplayName -eq $body.displayName
if ($exists) { Write-Host "Exists: $($body.displayName)"; continue }
New-MgIdentityConditionalAccessPolicy -BodyParameter $body | Out-Null
Write-Host "Created: $($body.displayName)"
}
Disconnect-MgGraph | Out-Null[
{
"displayName": "CA001-Admins-AllApps-RequirePhishingResistantMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeRoles": [
"62e90394-69f5-4237-9190-012177145e10",
"e8611ab8-c189-46e8-94e1-60213ab1f814",
"7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
"194ae4cb-b126-40b2-bd5b-6091b380977d",
"b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
"29232cdf-9323-42fd-ade2-1d097af3e4de",
"f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
"fe930be7-5e62-47db-91af-98c3a49a38b1",
"729827e3-9c14-49f7-bb1b-9608f156bbb8",
"c4e39bd9-1100-46d3-8c65-fb160da0071f",
"9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
"158c047a-c907-4556-b7ef-446551a6b5f7",
"3a2c62db-5318-420d-8d74-23affee5d9d5",
"b0f54661-2d74-4c50-afa3-1ec803f12efe"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"authenticationStrength": {
"id": "00000000-0000-0000-0000-000000000004"
}
}
},
{
"displayName": "CA002-AllUsers-AllApps-RequireMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"All"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"mfa"
]
}
},
{
"displayName": "CA003-AllUsers-LegacyAuth-Block",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"All"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"exchangeActiveSync",
"other"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"block"
]
}
},
{
"displayName": "CA004-Guests-AllApps-RequireMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"GuestsOrExternalUsers"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"mfa"
]
}
},
{
"displayName": "CA005-AllUsers-AzureManagement-RequireMFA",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeUsers": [
"All"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"797f4846-ba00-4fd7-ba43-dac1f8f63013"
]
},
"clientAppTypes": [
"all"
]
},
"grantControls": {
"operator": "OR",
"builtInControls": [
"mfa"
]
}
},
{
"displayName": "CA006-Admins-AllApps-SignInEvery4Hours",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": {
"includeRoles": [
"62e90394-69f5-4237-9190-012177145e10",
"e8611ab8-c189-46e8-94e1-60213ab1f814",
"7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
"194ae4cb-b126-40b2-bd5b-6091b380977d",
"b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
"29232cdf-9323-42fd-ade2-1d097af3e4de",
"f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
"fe930be7-5e62-47db-91af-98c3a49a38b1",
"729827e3-9c14-49f7-bb1b-9608f156bbb8",
"c4e39bd9-1100-46d3-8c65-fb160da0071f",
"9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
"158c047a-c907-4556-b7ef-446551a6b5f7",
"3a2c62db-5318-420d-8d74-23affee5d9d5",
"b0f54661-2d74-4c50-afa3-1ec803f12efe"
],
"excludeGroups": [
"{{BREAK_GLASS_GROUP_ID}}"
]
},
"applications": {
"includeApplications": [
"All"
]
},
"clientAppTypes": [
"all"
]
},
"sessionControls": {
"signInFrequency": {
"isEnabled": true,
"value": 4,
"type": "hours",
"frequencyInterval": "timeBased"
},
"persistentBrowser": {
"isEnabled": true,
"mode": "never"
}
}
}
]A starting baseline modelled on Microsoft’s recommended policies, not a complete design. Group IDs are filled in by the script; in the JSON they appear as {{placeholders}}. Role IDs and Graph schema checked against Microsoft Learn, December 2026. Nothing you choose leaves your browser.
P1 comes with Business Premium and E3; P2 with E5.
The defaults are a sensible baseline.
Policies are created in report-only mode.
Review the report-only results for a week, then switch policies on one at a time.
An emergency access account excluded from Conditional Access, so you can still sign in if a policy or MFA service goes wrong. Microsoft recommends two cloud-only accounts with strong passwords or FIDO2 keys, monitored for any sign-in.
Security defaults are free and require MFA for everyone and block legacy authentication. If you have Entra ID P1 or P2, Conditional Access gives you finer control. You can’t use both at once.
The policy is evaluated at every sign-in and the result is logged, but nothing is enforced. It shows exactly who would have been blocked or prompted before you switch it on.
Sign-in methods bound to the real website, such as FIDO2 security keys, passkeys and Windows Hello for Business, which can’t be relayed by phishing proxies the way app approvals and codes can.
Last updated 4 Dec 2026 · More in Microsoft 365 & Endpoint
Trace the hops and spot spoofing, locally
99.9% vs 99.99% in real minutes
What does 0x80070005 actually mean?