Skip to content

Commit

Permalink
Updated nav for test reference
Browse files Browse the repository at this point in the history
  • Loading branch information
merill committed Mar 16, 2024
1 parent 1f63678 commit a68c42c
Show file tree
Hide file tree
Showing 122 changed files with 527 additions and 415 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<#
.Synopsis
Generates Maester tests for the Azure AD Attack Defense Security Config defined at https://github.com/Cloud-Architekt/AzureAD-Attack-Defense
Generates Maester tests for the Entra ID Security Config Analyzer defined at https://github.com/Cloud-Architekt/AzureAD-Attack-Defense
.DESCRIPTION
* Downloads the latest version from https://github.com/Cloud-Architekt/AzureAD-Attack-Defense/blob/AADSCAv3/config/AadSecConfig.json
* Generates Maester tests for each test defined in the JSON file
.EXAMPLE
Update-AadscTests -Verbose -TestFilePath ./tests/AADSCAv3/Test-AADSCA.Generated.Tests.ps1 -DocsPath ./docs/docs/tests/AADSC
./build/EIDSCA/Update-EidscaTests.ps1 -Verbose -TestFilePath ./tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 -DocsPath ./docs/docs/tests/EIDSCA
#>

param (
Expand Down Expand Up @@ -241,7 +241,7 @@ Function UpdateTemplate($template, $control, $controlItem, $docName, $isDoc) {
$aadsc = Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/Cloud-Architekt/AzureAD-Attack-Defense/AADSCAv3/config/AadSecConfig.json' | ConvertFrom-Json

$testTemplate = @'
It "AADSC: %ControlName% - %DisplayName%. See https://maester.dev/t/%DocName%" {
It "EIDSCA: %ControlName% - %DisplayName%. See https://maester.dev/test/%DocName%" {
$result = Invoke-MtGraphRequest -RelativeUri "%RelativeUri%" -ApiVersion %ApiVersion%
$result.%CurrentValue% | Should -Be %RecommendedValue% -Because "%RelativeUri%/%CurrentValue% should be %RecommendedValue% but was $($result.%CurrentValue%)"
}
Expand All @@ -257,7 +257,7 @@ foreach ($control in $aadsc) {

$testOutputList = [System.Text.StringBuilder]::new()
foreach ($controlItem in $control.Controls) {
$docName = "AADSC.$($control.GraphEndpoint).$($controlItem.Name)"
$docName = "EIDSCA.$($control.GraphEndpoint).$($controlItem.Name)"
$testOutput = UpdateTemplate -template $testTemplate -control $control -controlItem $controlItem -docName $docName
$docsOutput = UpdateTemplate -template $docsTemplate -control $control -controlItem $controlItem -docName $docName -isDoc $true

Expand All @@ -269,7 +269,7 @@ foreach ($control in $aadsc) {
}
}
if ($testOutputList.Length -ne 0) {
$header = 'Describe "%ControlName%" -Tag "AADSCA", "Security", "All" {'.Replace("%ControlName%", $control.ControlName)
$header = 'Describe "%ControlName%" -Tag "EIDSCA", "Security", "All" {'.Replace("%ControlName%", $control.ControlName)
[void]$sb.AppendLine($header)
[void]$sb.AppendLine($testOutputList)
[void]$sb.AppendLine("}")
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion docs/docs/commands/Invoke-MtGraphRequest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,20 @@ The version of Invoke-Graph request supports
* Ability to skip cache and go directly to Graph
* Specify consistency level as a parameter

:::info
Note: Batch requests don't support caching.
:::

## EXAMPLES

### EXAMPLE 1

```powershell
Get all users with a display name of "John Doe" and return the first 10 results.
Invoke-MtGraph -RelativeUri "users" -Filter "displayName eq 'John Doe'" -Select "displayName" -Top 10
```

Get all users with a display name of "John Doe" and return the first 10 results.

## PARAMETERS

### -RelativeUri
Expand Down
8 changes: 8 additions & 0 deletions docs/docs/commands/Test-MtCaAllAppsExists.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ https://learn.microsoft.com/entra/identity/conditional-access/plan-conditional-a
Test-MtCaAllAppsExists
```

Returns true if at least one conditional access policy exists that targets all cloud apps and all users.

### EXAMPLE 2

```powershell
Test-MtCaAllAppsExists -SkipCheckAllUsers
```

Returns true if at least one conditional access policy exists that targets all cloud apps and all users, but skips the check for all users.

## PARAMETERS

Expand Down
23 changes: 0 additions & 23 deletions docs/docs/tests/@readme.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/docs/tests/@template.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: %title%
description: %heading%
slug: /docs/tests/%title%
---

# %heading%
Expand Down
20 changes: 0 additions & 20 deletions docs/docs/tests/AADSC/index.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: %DocName%
description: %Name% - %DisplayName%
slug: /tests/%DocName%
---

# %DisplayName%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.activityBasedTimeoutPolicies.WebSessionIdleTimeout
title: EIDSCA.activityBasedTimeoutPolicies.WebSessionIdleTimeout
description: WebSessionIdleTimeout - Enable directory level idle timeout
slug: /tests/EIDSCA.activityBasedTimeoutPolicies.WebSessionIdleTimeout
---

# Enable directory level idle timeout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.allowExternalIdToUseEmailOtp
title: EIDSCA.authenticationMethodsPolicy.allowExternalIdToUseEmailOtp
description: allowExternalIdToUseEmailOtp - Allow external users to use email OTP
slug: /tests/EIDSCA.authenticationMethodsPolicy.allowExternalIdToUseEmailOtp
---

# Allow external users to use email OTP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignExcluded
title: EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignExcluded
description: authenticationMethodsRegistrationCampaignExcluded - Registration campaign - Excluded users/groups
slug: /tests/EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignExcluded
---

# Registration campaign - Excluded users/groups
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignIncluded
title: EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignIncluded
description: authenticationMethodsRegistrationCampaignIncluded - Registration campaign - Included users/groups
slug: /tests/EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignIncluded
---

# Registration campaign - Included users/groups
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignSnoozeDurationInDays
title: EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignSnoozeDurationInDays
description: authenticationMethodsRegistrationCampaignSnoozeDurationInDays - Registration campaign - Days allowed to snooze
slug: /tests/EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignSnoozeDurationInDays
---

# Registration campaign - Days allowed to snooze
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignState
title: EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignState
description: authenticationMethodsRegistrationCampaignState - Registration campaign - State
slug: /tests/EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignState
---

# Registration campaign - State
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignTargetedAuthenticationMethod
title: EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignTargetedAuthenticationMethod
description: authenticationMethodsRegistrationCampaignTargetedAuthenticationMethod - Registration campaign - Authentication Method
slug: /tests/EIDSCA.authenticationMethodsPolicy.authenticationMethodsRegistrationCampaignTargetedAuthenticationMethod
---

# Registration campaign - Authentication Method
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.authenticationModeConfiguration.rules
title: EIDSCA.authenticationMethodsPolicy.authenticationModeConfiguration.rules
description: authenticationModeConfiguration.rules - Authentication binding - Rules
slug: /tests/EIDSCA.authenticationMethodsPolicy.authenticationModeConfiguration.rules
---

# Authentication binding - Rules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.authenticationModeConfiguration.x509CertificateAuthenticationDefaultMode
title: EIDSCA.authenticationMethodsPolicy.authenticationModeConfiguration.x509CertificateAuthenticationDefaultMode
description: authenticationModeConfiguration.x509CertificateAuthenticationDefaultMode - Authentication binding - Protected Level
slug: /tests/EIDSCA.authenticationMethodsPolicy.authenticationModeConfiguration.x509CertificateAuthenticationDefaultMode
---

# Authentication binding - Protected Level
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.defaultLength
title: EIDSCA.authenticationMethodsPolicy.defaultLength
description: defaultLength - Length
slug: /tests/EIDSCA.authenticationMethodsPolicy.defaultLength
---

# Length
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.defaultLifetimeInMinutes
title: EIDSCA.authenticationMethodsPolicy.defaultLifetimeInMinutes
description: defaultLifetimeInMinutes - Default lifetime
slug: /tests/EIDSCA.authenticationMethodsPolicy.defaultLifetimeInMinutes
---

# Default lifetime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.displayAppInformationRequiredState
title: EIDSCA.authenticationMethodsPolicy.displayAppInformationRequiredState
description: displayAppInformationRequiredState - Show application name in push and passwordless notifications
slug: /tests/EIDSCA.authenticationMethodsPolicy.displayAppInformationRequiredState
---

# Show application name in push and passwordless notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.displayAppInformationRequiredStateExcluded
title: EIDSCA.authenticationMethodsPolicy.displayAppInformationRequiredStateExcluded
description: displayAppInformationRequiredStateExcluded - Excluded users/groups to show application name in push and passwordless notifications
slug: /tests/EIDSCA.authenticationMethodsPolicy.displayAppInformationRequiredStateExcluded
---

# Excluded users/groups to show application name in push and passwordless notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.displayAppInformationRequiredStateIncluded
title: EIDSCA.authenticationMethodsPolicy.displayAppInformationRequiredStateIncluded
description: displayAppInformationRequiredStateIncluded - Included users/groups to show application name in push and passwordless notifications
slug: /tests/EIDSCA.authenticationMethodsPolicy.displayAppInformationRequiredStateIncluded
---

# Included users/groups to show application name in push and passwordless notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.displayLocationInformationRequiredExcluded
title: EIDSCA.authenticationMethodsPolicy.displayLocationInformationRequiredExcluded
description: displayLocationInformationRequiredExcluded - Excluded users/groups to show geographic location in push and passwordless notifications
slug: /tests/EIDSCA.authenticationMethodsPolicy.displayLocationInformationRequiredExcluded
---

# Excluded users/groups to show geographic location in push and passwordless notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.displayLocationInformationRequiredState
title: EIDSCA.authenticationMethodsPolicy.displayLocationInformationRequiredState
description: displayLocationInformationRequiredState - Show geographic location in push and passwordless notifications
slug: /tests/EIDSCA.authenticationMethodsPolicy.displayLocationInformationRequiredState
---

# Show geographic location in push and passwordless notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.displayLocationInformationRequiredStateIncluded
title: EIDSCA.authenticationMethodsPolicy.displayLocationInformationRequiredStateIncluded
description: displayLocationInformationRequiredStateIncluded - Included users/groups to show geographic location in push and passwordless notifications
slug: /tests/EIDSCA.authenticationMethodsPolicy.displayLocationInformationRequiredStateIncluded
---

# Included users/groups to show geographic location in push and passwordless notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.excludeTargets
title: EIDSCA.authenticationMethodsPolicy.excludeTargets
description: excludeTargets - Excluded users/group from CBA
slug: /tests/EIDSCA.authenticationMethodsPolicy.excludeTargets
---

# Excluded users/group from CBA
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.includeTargets
title: EIDSCA.authenticationMethodsPolicy.includeTargets
description: includeTargets - Included users/groups from CBA
slug: /tests/EIDSCA.authenticationMethodsPolicy.includeTargets
---

# Included users/groups from CBA
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.isAttestationEnforced
title: EIDSCA.authenticationMethodsPolicy.isAttestationEnforced
description: isAttestationEnforced - Enforce attestation
slug: /tests/EIDSCA.authenticationMethodsPolicy.isAttestationEnforced
---

# Enforce attestation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.isOfficePhoneAllowed
title: EIDSCA.authenticationMethodsPolicy.isOfficePhoneAllowed
description: isOfficePhoneAllowed - Phone Options - Office
slug: /tests/EIDSCA.authenticationMethodsPolicy.isOfficePhoneAllowed
---

# Phone Options - Office
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.isSelfServiceRegistrationAllowed
title: EIDSCA.authenticationMethodsPolicy.isSelfServiceRegistrationAllowed
description: isSelfServiceRegistrationAllowed - Allow self-service set up
slug: /tests/EIDSCA.authenticationMethodsPolicy.isSelfServiceRegistrationAllowed
---

# Allow self-service set up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.isSoftwareOathEnabled
title: EIDSCA.authenticationMethodsPolicy.isSoftwareOathEnabled
description: isSoftwareOathEnabled - Allow use of Microsoft Authenticator OTP
slug: /tests/EIDSCA.authenticationMethodsPolicy.isSoftwareOathEnabled
---

# Allow use of Microsoft Authenticator OTP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.isUsableOnce
title: EIDSCA.authenticationMethodsPolicy.isUsableOnce
description: isUsableOnce - One-time
slug: /tests/EIDSCA.authenticationMethodsPolicy.isUsableOnce
---

# One-time
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.keyRestrictions.aaGuids
title: EIDSCA.authenticationMethodsPolicy.keyRestrictions.aaGuids
description: keyRestrictions.aaGuids - Restricted
slug: /tests/EIDSCA.authenticationMethodsPolicy.keyRestrictions.aaGuids
---

# Restricted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.keyRestrictions.enforcementType
title: EIDSCA.authenticationMethodsPolicy.keyRestrictions.enforcementType
description: keyRestrictions.enforcementType - Restrict specific keys
slug: /tests/EIDSCA.authenticationMethodsPolicy.keyRestrictions.enforcementType
---

# Restrict specific keys
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.keyRestrictions.isEnforced
title: EIDSCA.authenticationMethodsPolicy.keyRestrictions.isEnforced
description: keyRestrictions.isEnforced - Enforce key restrictions
slug: /tests/EIDSCA.authenticationMethodsPolicy.keyRestrictions.isEnforced
---

# Enforce key restrictions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: AADSC.authenticationMethodsPolicy.maximumLifetimeInMinutes
title: EIDSCA.authenticationMethodsPolicy.maximumLifetimeInMinutes
description: maximumLifetimeInMinutes - Maximum lifetime
slug: /tests/EIDSCA.authenticationMethodsPolicy.maximumLifetimeInMinutes
---

# Maximum lifetime
Expand Down
Loading

0 comments on commit a68c42c

Please sign in to comment.