-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from maester365/tn-EidscaMinorFixes
EIDSCA bug fixes and support for conditions and discovery
- Loading branch information
Showing
26 changed files
with
603 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Manages if registration of FIDO2 keys should be restricted. | ||
|
||
Restrict usage of FIDO2 from unauthorized vendors or platforms | ||
|
||
#### Test script | ||
``` | ||
https://graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2') | ||
.keyRestrictions.isEnforced = 'true' | ||
``` | ||
|
||
#### Related links | ||
|
||
- [Open in Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer?request=policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')&method=GET&version=beta&GraphUrl=https://graph.microsoft.com) | ||
- [fido2AuthenticationMethodConfiguration resource type - Microsoft Graph v1.0 | Microsoft Learn](https://learn.microsoft.com/en-us/graph/api/resources/fido2authenticationmethodconfiguration) | ||
|
||
|
||
<!--- Results ---> | ||
%TestResult% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks if Authentication Method - FIDO2 security key - Enforce key restrictions is set to 'true' | ||
.DESCRIPTION | ||
Manages if registration of FIDO2 keys should be restricted. | ||
Queries policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2') | ||
and returns the result of | ||
graph/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2').keyRestrictions.isEnforced -eq 'true' | ||
.EXAMPLE | ||
Test-MtEidscaAF04 | ||
Returns the result of graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2').keyRestrictions.isEnforced -eq 'true' | ||
#> | ||
|
||
Function Test-MtEidscaAF04 { | ||
[CmdletBinding()] | ||
[OutputType([bool])] | ||
param() | ||
|
||
$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta | ||
|
||
$tenantValue = $result.keyRestrictions.isEnforced | ||
$testResult = $tenantValue -eq 'true' | ||
|
||
if($testResult){ | ||
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**" | ||
} | ||
else { | ||
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**" | ||
} | ||
Add-MtTestResultDetail -Result $testResultMarkdown | ||
|
||
return $tenantValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
You can work with your Security key provider to determine the AAGuids of their devices for allowing or blocking usage. | ||
|
||
|
||
|
||
#### Test script | ||
``` | ||
https://graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2') | ||
.keyRestrictions.aaGuids -notcontains $null = 'true' | ||
``` | ||
|
||
#### Related links | ||
|
||
- [Open in Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer?request=policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')&method=GET&version=beta&GraphUrl=https://graph.microsoft.com) | ||
- [fido2AuthenticationMethodConfiguration resource type - Microsoft Graph v1.0 | Microsoft Learn](https://learn.microsoft.com/en-us/graph/api/resources/fido2authenticationmethodconfiguration) | ||
|
||
|
||
<!--- Results ---> | ||
%TestResult% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks if Authentication Method - FIDO2 security key - Restricted is set to 'true' | ||
.DESCRIPTION | ||
You can work with your Security key provider to determine the AAGuids of their devices for allowing or blocking usage. | ||
Queries policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2') | ||
and returns the result of | ||
graph/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2').keyRestrictions.aaGuids -notcontains $null -eq 'true' | ||
.EXAMPLE | ||
Test-MtEidscaAF05 | ||
Returns the result of graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2').keyRestrictions.aaGuids -notcontains $null -eq 'true' | ||
#> | ||
|
||
Function Test-MtEidscaAF05 { | ||
[CmdletBinding()] | ||
[OutputType([bool])] | ||
param() | ||
|
||
$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta | ||
|
||
$tenantValue = $result.keyRestrictions.aaGuids -notcontains $null | ||
$testResult = $tenantValue -eq 'true' | ||
|
||
if($testResult){ | ||
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**" | ||
} | ||
else { | ||
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**" | ||
} | ||
Add-MtTestResultDetail -Result $testResultMarkdown | ||
|
||
return $tenantValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
powershell/public/Get-MtAuthenticationMethodPolicyConfig.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<# | ||
.SYNOPSIS | ||
Get details of authentication methods | ||
.DESCRIPTION | ||
This function retrieves the configuration of authentication methods with specific state. | ||
.EXAMPLE | ||
Get-MtAuthenticationMethodPolicyConfig -State Enabled | ||
#> | ||
function Get-MtAuthenticationMethodPolicyConfig { | ||
|
||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $false)] | ||
[ValidateSet("Enabled", "Disabled")] | ||
[string]$State | ||
) | ||
|
||
Write-Verbose -Message "Getting authenticationMethodConfigurations from Authentication Methods Policy." | ||
if ($State) { | ||
return (Invoke-MtGraphRequest -RelativeUri 'policies/authenticationMethodsPolicy' -ApiVersion beta).authenticationMethodConfigurations | where-object {$_.state -eq $state} | ||
} else { | ||
return (Invoke-MtGraphRequest -RelativeUri 'policies/authenticationMethodsPolicy' -ApiVersion beta).authenticationMethodConfigurations | ||
} | ||
} |
Oops, something went wrong.