Skip to content

Commit

Permalink
Merge pull request #96 from maester365/tnh-EidscaFixResultType
Browse files Browse the repository at this point in the history
Minor fixes on EIDSCA for incorrect result (by boolean values) and lower case folder path
  • Loading branch information
merill authored Apr 16, 2024
2 parents 724e277 + 0895315 commit 176ad6e
Show file tree
Hide file tree
Showing 99 changed files with 118 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
* Generates Maester tests for each test defined in the JSON file
.EXAMPLE
./build/EIDSCA/Update-EidscaTests.ps1
./build/eidsca/Update-EidscaTests.ps1
#>

param (
# Folder where generated test file should be written to.
[string] $TestFilePath = "./tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1",

# Folder where docs should be generated
[string] $DocsPath = "./website/docs/tests/EIDSCA",
[string] $DocsPath = "./website/docs/tests/eidsca",

[string] $PowerShellFunctionsPath = "./powershell/public/EIDSCA",
[string] $PowerShellFunctionsPath = "./powershell/public/eidsca",

# Control name to filter on
[string] $ControlName = "*",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function %PSFunctionName% {

$result = Invoke-MtGraphRequest -RelativeUri "%RelativeUri%" -ApiVersion %ApiVersion%

$tenantValue = $result.%CurrentValue%
$tenantValue = $result.%CurrentValue% | Out-String -NoNewLine
$testResult = $tenantValue -eq %RecommendedValue%

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **%RecommendedValue%** for **%RelativeUri%**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **%RecommendedValue%** for **%RelativeUri%**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAF01 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta

$tenantValue = $result.state
$tenantValue = $result.state | Out-String -NoNewLine
$testResult = $tenantValue -eq 'enabled'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAF02 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta

$tenantValue = $result.isSelfServiceRegistrationAllowed
$tenantValue = $result.isSelfServiceRegistrationAllowed | Out-String -NoNewLine
$testResult = $tenantValue -eq 'true'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAF03 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta

$tenantValue = $result.isAttestationEnforced
$tenantValue = $result.isAttestationEnforced | Out-String -NoNewLine
$testResult = $tenantValue -eq 'true'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAF04 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta

$tenantValue = $result.keyRestrictions.isEnforced
$tenantValue = $result.keyRestrictions.isEnforced | Out-String -NoNewLine
$testResult = $tenantValue -eq 'true'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAF05 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta

$tenantValue = $result.keyRestrictions.aaGuids -notcontains $null
$tenantValue = $result.keyRestrictions.aaGuids -notcontains $null | Out-String -NoNewLine
$testResult = $tenantValue -eq 'true'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAF06 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta

$tenantValue = $result.keyRestrictions.aaGuids -notcontains $null -and ($result.keyRestrictions.enforcementType -eq 'allow' -or $result.keyRestrictions.enforcementType -eq 'block')
$tenantValue = $result.keyRestrictions.aaGuids -notcontains $null -and ($result.keyRestrictions.enforcementType -eq 'allow' -or $result.keyRestrictions.enforcementType -eq 'block') | Out-String -NoNewLine
$testResult = $tenantValue -eq 'true'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAG01 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta

$tenantValue = $result.policyMigrationState
$tenantValue = $result.policyMigrationState | Out-String -NoNewLine
$testResult = $tenantValue -eq 'migrationComplete'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'migrationComplete'** for **policies/authenticationMethodsPolicy**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'migrationComplete'** for **policies/authenticationMethodsPolicy**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAG02 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta

$tenantValue = $result.reportSuspiciousActivitySettings.state
$tenantValue = $result.reportSuspiciousActivitySettings.state | Out-String -NoNewLine
$testResult = $tenantValue -eq 'enabled'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'enabled'** for **policies/authenticationMethodsPolicy**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAG03 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta

$tenantValue = $result.reportSuspiciousActivitySettings.includeTarget.id
$tenantValue = $result.reportSuspiciousActivitySettings.includeTarget.id | Out-String -NoNewLine
$testResult = $tenantValue -eq 'all_users'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'all_users'** for **policies/authenticationMethodsPolicy**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'all_users'** for **policies/authenticationMethodsPolicy**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM01 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.state
$tenantValue = $result.state | Out-String -NoNewLine
$testResult = $tenantValue -eq 'enabled'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM02 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.state
$tenantValue = $result.state | Out-String -NoNewLine
$testResult = $tenantValue -eq 'enabled'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM03 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.featureSettings.numberMatchingRequiredState.state
$tenantValue = $result.featureSettings.numberMatchingRequiredState.state | Out-String -NoNewLine
$testResult = $tenantValue -eq 'enabled'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM04 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.featureSettings.numberMatchingRequiredState.includeTarget.id
$tenantValue = $result.featureSettings.numberMatchingRequiredState.includeTarget.id | Out-String -NoNewLine
$testResult = $tenantValue -eq 'all_users'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'all_users'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'all_users'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM06 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.featureSettings.displayAppInformationRequiredState.state
$tenantValue = $result.featureSettings.displayAppInformationRequiredState.state | Out-String -NoNewLine
$testResult = $tenantValue -eq 'enabled'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM07 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.featureSettings.displayAppInformationRequiredState.includeTarget.id
$tenantValue = $result.featureSettings.displayAppInformationRequiredState.includeTarget.id | Out-String -NoNewLine
$testResult = $tenantValue -eq 'all_users'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'all_users'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'all_users'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM09 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.featureSettings.displayLocationInformationRequiredState.state
$tenantValue = $result.featureSettings.displayLocationInformationRequiredState.state | Out-String -NoNewLine
$testResult = $tenantValue -eq 'enabled'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAM10 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

$tenantValue = $result.featureSettings.displayLocationInformationRequiredState.includeTarget.id
$tenantValue = $result.featureSettings.displayLocationInformationRequiredState.includeTarget.id | Out-String -NoNewLine
$testResult = $tenantValue -eq 'all_users'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'all_users'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'all_users'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAP01 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta

$tenantValue = $result.allowedToUseSSPR
$tenantValue = $result.allowedToUseSSPR | Out-String -NoNewLine
$testResult = $tenantValue -eq 'true'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'true'** for **policies/authorizationPolicy**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'true'** for **policies/authorizationPolicy**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAP04 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta

$tenantValue = $result.allowInvitesFrom
$tenantValue = $result.allowInvitesFrom | Out-String -NoNewLine
$testResult = $tenantValue -eq 'adminsAndGuestInviters'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'adminsAndGuestInviters'** for **policies/authorizationPolicy**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'adminsAndGuestInviters'** for **policies/authorizationPolicy**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Function Test-MtEidscaAP05 {

$result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta

$tenantValue = $result.allowedToSignUpEmailBasedSubscriptions
$tenantValue = $result.allowedToSignUpEmailBasedSubscriptions | Out-String -NoNewLine
$testResult = $tenantValue -eq 'false'

if($testResult){
$testResultMarkdown = "Well done. Your tenant has the recommended value of **'false'** for **policies/authorizationPolicy**"
}
else {
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'false'** for **policies/authorizationPolicy**"
}
Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down
Loading

0 comments on commit 176ad6e

Please sign in to comment.