-
Notifications
You must be signed in to change notification settings - Fork 234
Feature/azdo #1371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feature/azdo #1371
Changes from all commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
de3bb1d
adding azdo test suit and preview module
SebastianClaesson 90404c8
Adding readme
SebastianClaesson 8d9f3c2
adding updated readme
SebastianClaesson aa8b936
Adding Azdo tests
SebastianClaesson 8d7318a
Updating readme and setting functions in the correct folder
SebastianClaesson 94d7523
Merge branch 'maester365:main' into feature/azdo
SebastianClaesson fc83a14
Relocating parent folder
SebastianClaesson 13c55d8
Merge branch 'feature/azdo' of https://github.com/SebastianClaesson/m…
SebastianClaesson 86125a8
updating readmes and powershell scripts
SebastianClaesson 0ba07d8
Fix typos and improve formatting in documentation
SamErde c12ab8b
Refine grammar in Test-AzdoArtifactsExternalPackageProtectionToken.md
SamErde bdfa2ff
Fix typo in description of security policy check
SamErde f4f68c7
Fix grammar and punctuation in Test-AzdoAuditStream.md
SamErde ca1d7da
Refine description for Test-AzdoAuditStream function
SamErde 6005abd
Fix grammar and clarity in Test-AzdoEnforceAADConditionalAccess.md
SamErde 0c4b342
Update README.md with clearer test descriptions
SamErde 25dcaff
Update powershell/public/maester/azdo/Test-AzdoOrganizationLimitJobAu…
SamErde 9d40147
Merge branch 'maester365:main' into feature/azdo
SebastianClaesson acd7ecc
Renaming Azdo to AzureDevOps
SebastianClaesson 2fa5cb3
Fixed typo and information
SebastianClaesson 046bfea
Updated description
SebastianClaesson 223fa56
Removing dot sourcing as the test cmdlets are to be part of the module
SebastianClaesson 5adefc1
Merge branch 'feature/azdo' of https://github.com/SebastianClaesson/m…
SebastianClaesson 0a4eb89
Fix typo in SSH authentication documentation
SamErde 09caf7f
Fix typo in Test-AzdoOrganizationStageChooser.md
SamErde 04fd334
Update powershell/public/maester/azuredevops/Test-AzdoOrganizationLim…
SamErde a7e76b6
Merge branch 'maester365:main' into feature/azdo
SebastianClaesson 0283fed
Corrected the remediation action, that it should toggle OFF.
SebastianClaesson ce324f0
Adding logic to manage region specific decimal separator.
SebastianClaesson 3db1a0a
Changed function calls to be singular and not plural
SebastianClaesson 9703bf6
Updating description and action
SebastianClaesson a1c92df
Removing white-space
SebastianClaesson 4228988
Adding correct value returned by function to define success or fail
SebastianClaesson 9f715eb
Removed whitespace
SebastianClaesson aa9fc65
Fixed typo
SebastianClaesson 0d320a0
Added invert logic to keep cleaner code.
SebastianClaesson ed5968d
Fixed typo
SebastianClaesson a7cde22
Fixed typo
SebastianClaesson 34c59e2
Removed whitespace
SebastianClaesson 91d9279
Merge branch 'main' into feature/azdo
merill 0c8dc85
Fixed missing comma, after merging conflicts
merill 1f6f48a
Fix typo in remediation action for SSH policy
SamErde ec241a9
Fix spelling error in Test-AzdoOrganizationOwner.ps1
SamErde cf2a3d7
Clean up comments and documentation in PowerShell script
SamErde 9667b94
Added severity configuration to maester-config instead
SebastianClaesson 4bff7a1
Merge branch 'feature/azdo' of https://github.com/SebastianClaesson/m…
SebastianClaesson 0fdb4f6
Fixed connection check, Fixed typos, Fixed grammar issues
SebastianClaesson 08f7481
Fixed more grammar issues
SebastianClaesson d1c6100
Changing title to Maester contributor
SebastianClaesson 4e3521c
Adding rowbreak in between to make the message look nicer
SebastianClaesson 19a7c57
Adding whitespace
SebastianClaesson 7c484f8
Fixed grammar and new instructions for Azure DevOps suite
SebastianClaesson e30c0e5
Changing severity and adding new tests
SebastianClaesson a724202
Adding more tests.
SebastianClaesson 6142352
Adding WIP
SebastianClaesson 9b7c637
Fix punctuation and wording in installation.md
SamErde 0d0b169
Adding blogpost and proof read content
SebastianClaesson c109973
Merge branch 'feature/azdo' of https://github.com/SebastianClaesson/m…
SebastianClaesson edca956
Adding another iteration
SebastianClaesson 3a6ecdd
Reverting maester-config
SebastianClaesson 5f499e2
Adding azdo.1036
SebastianClaesson 4138d8f
Fix typo in maester-config.json title
SamErde 70946d7
Adding updated files, with grammar checks and spellchecks. Removed in…
SebastianClaesson e46b514
Merge branch 'feature/azdo' of https://github.com/SebastianClaesson/m…
SebastianClaesson 3d5114c
Removing trailing backslashes.
SebastianClaesson c69daa4
Added logic for "AccessDeniedException".
SebastianClaesson ab1bcee
Update tests/Maester/AzureDevOps/Test-AzdoEnforceAADConditionalAccess…
SamErde ff2ae53
Update Test-Azdo.Tests.ps1
SebastianClaesson a414df8
Fix verbose output for group member descriptor
SamErde 868bf2f
Remove Azure DevOps test entries from FunctionsToExport in module man…
SamErde 5d8976e
Added ADOPS module availability check (Get-Command + Get-ADOPSConnect…
SebastianClaesson 1ebcbc3
Update error handling for Get-ADOPSConnection command
SamErde a334f1c
Add 'NotConnectedAzureDevOps' to SkippedBecause parameter
SamErde c1cea53
Moving powershell helper functions
SebastianClaesson 7a2e267
Add Azure DevOps functions to FunctionsToExport in module manifest
SebastianClaesson 963a5af
Refactor currentQuantity assignment for backwards compatibility
SamErde e70c279
refactor: result handling for organization owner fetch failure
SamErde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
17 changes: 17 additions & 0 deletions
17
powershell/public/maester/azuredevops/Test-AzdoAllowRequestAccessToken.md
This file contains hidden or 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,17 @@ | ||
| Request access to Azure DevOps by e-mail notifications to administrators **should be** disabled. | ||
|
|
||
| Rationale: Access control to Azure DevOps is to be a controlled process where access is granted and tracked. | ||
|
|
||
| #### Remediation action: | ||
| Disable the policy to stop these requests and notifications. | ||
| 1. Sign in to your organization. | ||
| 2. Choose Organization settings. | ||
| 3. Select Policies, locate the Request Access policy and toggle it to off. | ||
| 4. Provide the URL to your internal process for gaining access. Users see this URL in the error report when they try to access the organization or a project within the organization that they don't have permission to access. | ||
|
|
||
| **Results:** | ||
| When users try to access a project without the required permissions, the error message includes the request access URL. This link is shown on the error page to maintain confidentiality, regardless of whether the project exists. | ||
|
|
||
| #### Related links | ||
|
|
||
| * [Azure DevOps Security - Disable your organization's Request Access policy](https://go.microsoft.com/fwlink/?linkid=2113172) | ||
46 changes: 46 additions & 0 deletions
46
powershell/public/maester/azuredevops/Test-AzdoAllowRequestAccessToken.ps1
This file contains hidden or 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,46 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .DESCRIPTION | ||
| Checks the status of the 'Request Access' policy in Azure DevOps to prevent users from requesting access to your organization or projects. | ||
| When this policy is enabled, users can request access, and administrators receive email notifications for review and approval. | ||
| Disabling the policy stops these requests and notifications, helping you control access more tightly. | ||
|
|
||
| https://go.microsoft.com/fwlink/?linkid=2113172 | ||
|
|
||
| .EXAMPLE | ||
| ``` | ||
| Test-AzdoAllowRequestAccessToken | ||
| ``` | ||
|
|
||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-AzdoAllowRequestAccessToken | ||
| #> | ||
|
|
||
| function Test-AzdoAllowRequestAccessToken { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
|
|
||
| if ($null -eq (Get-ADOPSConnection)['Organization']) { | ||
| Write-Verbose 'Not connected to Azure DevOps' | ||
| Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason 'Not connected to Azure DevOps' | ||
| return $null | ||
| } | ||
|
|
||
| $UserPolicies = Get-ADOPSOrganizationPolicy -PolicyCategory 'User' -Force | ||
| $Policy = $UserPolicies.policy | where-object -property name -eq 'Policy.AllowRequestAccessToken' | ||
| $result = $Policy.effectiveValue | ||
| if ($result) { | ||
| $resultMarkdown = "When enabled, this policy allows users to request access, triggering email notifications to administrators for review and approval." | ||
| } else { | ||
| $resultMarkdown = "Disabling the policy stops these requests and notifications." | ||
| } | ||
|
|
||
| Add-MtTestResultDetail -Result $resultMarkdown | ||
|
|
||
| return $result | ||
| } |
17 changes: 17 additions & 0 deletions
17
...ll/public/maester/azuredevops/Test-AzdoAllowTeamAdminsInvitationsAccessToken.md
This file contains hidden or 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,17 @@ | ||
| Access to Azure DevOps **should be** a controlled process managed by the IAM team or the appropriate Azure DevOps administrator roles. | ||
|
|
||
| Rationale: By default, all administrators can invite new users to their Azure DevOps organization. Disabling this policy prevents Team and Project Administrators from inviting new users. | ||
| Project Collection Administrators (PCAs) can still add new users to the organization regardless of the policy status. Additionally, if a user is already a member of the organization, Project and Team Administrators can add that user to specific projects. | ||
|
|
||
| #### Remediation action: | ||
| Disable the policy to stop these invitations. | ||
| 1. Sign in to your organization. | ||
| 2. Choose Organization settings. | ||
| 3. Select Policies, locate the **Allow team and project administrators to invite new users** policy and toggle it to off. | ||
| 4. Now, only Project Collection Administrators can invite new users to Azure DevOps. | ||
|
|
||
| > Project and Team Administrators can directly add users to their projects through the permissions blade. However, if they attempt to add users through the Add Users button located in the Organization settings > Users section, it's not visible to them. Adding a user directly through Project settings > Permissions doesn't result in the user appearing automatically in the Organization settings > Users list. For the user to be reflected in the Users list, they must sign in to the system. | ||
|
|
||
| #### Related links | ||
|
|
||
| * [Azure DevOps Security - Restrict administrators from inviting new users](https://aka.ms/azure-devops-invitations-policy) |
47 changes: 47 additions & 0 deletions
47
powershell/public/maester/azuredevops/Test-AzdoAllowTeamAdminsInvitationsAccessToken.ps1
This file contains hidden or 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,47 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .DESCRIPTION | ||
| By default, all administrators can invite new users to their Azure DevOps organization. | ||
| Disabling this policy prevents Team and Project Administrators from inviting new users or adding Entra groups. | ||
| However, Project Collection Administrators (PCAs) can still add new users and Entra groups to the organization regardless of the policy status. | ||
| Additionally, if a user is already a member of the organization, Project and Team Administrators can add that user to specific projects. | ||
|
|
||
| https://aka.ms/azure-devops-invitations-policy | ||
|
|
||
| .EXAMPLE | ||
| ``` | ||
| Test-AzdoAllowTeamAdminsInvitationsAccessToken | ||
| ``` | ||
|
|
||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-AzdoAllowTeamAdminsInvitationsAccessToken | ||
| #> | ||
|
|
||
| function Test-AzdoAllowTeamAdminsInvitationsAccessToken { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
|
|
||
| if ($null -eq (Get-ADOPSConnection)['Organization']) { | ||
| Write-Verbose 'Not connected to Azure DevOps' | ||
| Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason 'Not connected to Azure DevOps' | ||
| return $null | ||
| } | ||
|
|
||
| $PrivacyPolicies = Get-ADOPSOrganizationPolicy -PolicyCategory 'User' -Force | ||
| $Policy = $PrivacyPolicies.policy | where-object -property name -eq 'Policy.AllowTeamAdminsInvitationsAccessToken' | ||
| $result = $Policy.effectiveValue | ||
| if ($result) { | ||
| $resultMarkdown = "Team and project administrators are allowed to invite new users" | ||
| } else { | ||
| $resultMarkdown = "Enrolling to your Azure DevOps organization should be a controlled process." | ||
| } | ||
|
|
||
| Add-MtTestResultDetail -Result $resultMarkdown | ||
|
|
||
| return $result | ||
| } |
24 changes: 24 additions & 0 deletions
24
.../public/maester/azuredevops/Test-AzdoArtifactsExternalPackageProtectionToken.md
This file contains hidden or 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,24 @@ | ||
| Externally sourced package versions **should be** manually approved for internal use to prevent malicious packages from a public registry being inadvertently consumed. | ||
|
|
||
| Rationale: Previously, Azure Artifacts feeds presented package versions from all of its upstream sources. This includes package versions that were originally pushed to an Azure Artifacts feed (internally sourced) and package versions from common public repositories like npmjs.com, NuGet.org, Maven Central, and PyPI (externally sourced). | ||
|
|
||
| Configure a policy for additional security for your private feeds by limiting access to externally sourced packages when internally sourced packages are already present. This change provides a new layer of protection and prevents malicious packages from a public registry being inadvertently consumed. It does not affect any package versions that are already in use or cached in your feed. | ||
|
|
||
| #### Remediation action: | ||
|
|
||
| Enable the policy to opt-in for additional protective behavior. | ||
|
|
||
| 1. Sign in to your organization. | ||
| 2. Choose Organization settings. | ||
| 3. Select policies under the security section | ||
| 4. In the security policies section, toggle on ‘Additional protections when using public package registries’ | ||
|
|
||
| **Results:** | ||
| The security behavior applies: | ||
| when an internally sourced version is already in your feed, or | ||
| when consuming a package from your feed for the first time (i.e. it is not yet in your feed), and at least one of the versions available from an upstream is internally sourced. | ||
| With the new behavior, any versions from the public registry will be blocked and not made available to download. You are able to configure the upstream behavior to allow externally sourced package versions if you choose to. | ||
|
|
||
| #### Related links | ||
|
|
||
| * [Microsoft Devblogs - Changes to Azure Artifacts Upstream Behavior](https://devblogs.microsoft.com/devops/changes-to-azure-artifact-upstream-behavior/) |
46 changes: 46 additions & 0 deletions
46
powershell/public/maester/azuredevops/Test-AzdoArtifactsExternalPackageProtectionToken.ps1
This file contains hidden or 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,46 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .DESCRIPTION | ||
| Checks the policy for additional security for your private feeds by limiting access to externally sourced packages when internally sourced packages are already present. | ||
| This provides a new layer of security, which prevents malicious packages from a public registry being inadvertently consumed. | ||
| These changes will not affect any package versions that are already in use or cached in your feed. | ||
|
|
||
| https://devblogs.microsoft.com/devops/changes-to-azure-artifact-upstream-behavior | ||
|
|
||
| .EXAMPLE | ||
| ``` | ||
| Test-AzdoArtifactsExternalPackageProtectionToken | ||
| ``` | ||
|
|
||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-AzdoArtifactsExternalPackageProtectionToken | ||
| #> | ||
|
|
||
| function Test-AzdoArtifactsExternalPackageProtectionToken { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
|
|
||
| if ($null -eq (Get-ADOPSConnection)['Organization']) { | ||
| Write-Verbose 'Not connected to Azure DevOps' | ||
| Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason 'Not connected to Azure DevOps' | ||
| return $null | ||
| } | ||
|
|
||
| $SecurityPolicies = Get-ADOPSOrganizationPolicy -PolicyCategory 'Security' -Force | ||
| $Policy = $SecurityPolicies.policy | where-object -property name -eq 'Policy.ArtifactsExternalPackageProtectionToken' | ||
| $result = $Policy.effectiveValue | ||
| if ($result) { | ||
| $resultMarkdown = "Your Azure DevOps tenant limits access to externally sourced packages when internally sourced packages are already present." | ||
| } else { | ||
| $resultMarkdown = "Your tenant should prefer to use internal source packages when present" | ||
| } | ||
|
|
||
| Add-MtTestResultDetail -Result $resultMarkdown | ||
|
|
||
| return $result | ||
| } |
24 changes: 24 additions & 0 deletions
24
powershell/public/maester/azuredevops/Test-AzdoAuditStream.md
This file contains hidden or 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,24 @@ | ||
| Audit logs **should be** retained according to your organization's needs and protected from purging. | ||
|
|
||
| Rationale: Send auditing data to other Security Incident and Event Management (SIEM) tools and open new possibilities, such as the ability to trigger alerts for specific events, create views on auditing data, and perform anomaly detection. Setting up a stream also allows you to store more than 90-days of auditing data, which is the maximum amount of data that Azure DevOps keeps for your organizations. | ||
|
|
||
| #### Remediation action: | ||
|
|
||
| Create an audit stream, which sends data to other locations for further processing. | ||
|
|
||
| 1. Sign in to your organization. | ||
| 2. Choose Organization settings. | ||
| 3. Select Auditing. | ||
| > If you don't see Auditing in Organization Settings, then auditing is not currently enabled for your organization. Someone in the organization owner or Project Collection Administrators (PCAs) group must enable Auditing in Organization Policies. You will then be able to see events on the Auditing page if you have the appropriate permissions. | ||
| 1. Go to the Streams tab, and then select New stream. | ||
| 2. Select the stream target that you want to configure, and then select from the following instructions to set up your stream target type. | ||
| 1. Splunk | ||
| 2. Event Grid | ||
| 3. Azure Monitor Log | ||
|
|
||
| **Results:** | ||
| Audit streams represent a pipeline that flows audit events from your Azure DevOps organization to a stream target. At least every half hour, new audit events are bundled and streamed to your targets. | ||
|
|
||
| #### Related links | ||
|
|
||
| * [Azure DevOps Security - Create audit streaming](https://learn.microsoft.com/en-us/azure/devops/organizations/audit/auditing-streaming?view=azure-devops) |
62 changes: 62 additions & 0 deletions
62
powershell/public/maester/azuredevops/Test-AzdoAuditStream.ps1
This file contains hidden or 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,62 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .DESCRIPTION | ||
| Sends auditing data to Security Incident and Event Management (SIEM) tools and opens new possibilities, | ||
| such as the ability to trigger alerts for specific events, create views on auditing data, and perform | ||
| anomaly detection. Setting up a stream also allows you to store more than 90-days of auditing data, | ||
| which is the maximum amount of data that Azure DevOps keeps for your organizations. | ||
|
|
||
| https://learn.microsoft.com/en-us/azure/devops/organizations/audit/auditing-streaming?view=azure-devops | ||
|
|
||
| .EXAMPLE | ||
| ``` | ||
| Test-AzdoAuditStream | ||
| ``` | ||
|
|
||
| Returns a boolean depending on the configuration. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-AzdoAuditStream | ||
| #> | ||
|
|
||
| function Test-AzdoAuditStream { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
|
|
||
| if ($null -eq (Get-ADOPSConnection)['Organization']) { | ||
| Write-Verbose 'Not connected to Azure DevOps' | ||
| Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason 'Not connected to Azure DevOps' | ||
| return $null | ||
| } | ||
|
|
||
| $AuditStreams = Get-ADOPSAuditStreams -ErrorAction SilentlyContinue | ||
|
|
||
| if ($null -eq $AuditStreams) { | ||
| $Message = "Audit Streams was not found. This may be due to insufficient permissions or the Azure DevOps Organization is not backed by an Entra ID tenant. | ||
| Please see [Manage Audit Streams](https://learn.microsoft.com/en-us/azure/devops/organizations/audit/auditing-streaming?view=azure-devops#prerequisites)" | ||
| Write-Verbose $Message | ||
| Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason $Message | ||
| return $null | ||
| } else { | ||
| if ($AuditStreams) { | ||
| if ('Enabled' -in $AuditStreams.status) { | ||
| $resultMarkdown = "Audit logs have been configured for long-term storage and purge protection." | ||
| $result = $true | ||
| } else { | ||
| $resultMarkdown = "Audit Streams have been configured for long-term storage and purge protection but is not enabled." | ||
| $result = $false | ||
| } | ||
| } else { | ||
| $resultMarkdown = "Audit Streams have not been configured for long-term storage and purge protection." | ||
| $result = $false | ||
| } | ||
|
|
||
| Add-MtTestResultDetail -Result $resultMarkdown | ||
|
|
||
| return $result | ||
| } | ||
|
|
||
| } |
35 changes: 35 additions & 0 deletions
35
powershell/public/maester/azuredevops/Test-AzdoDisableGlobalPATCreation.md
This file contains hidden or 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,35 @@ | ||
| Restrict creation of global Personal Access Tokens (PATs) **should be** enabled. | ||
|
|
||
| #### Prerequisites | ||
|
|
||
| - Your organization must be linked to a Microsoft Entra tenant. | ||
| - You must be an Azure DevOps Administrator to configure tenant policies. | ||
|
|
||
| #### Rationale | ||
|
|
||
| Global PATs can be used across all accessible organizations. Restricting their creation ensures tokens are confined to a single org, enforcing least privilege and reducing cross-org exposure risk. | ||
|
|
||
| #### Remediation action | ||
|
|
||
| Enable the tenant policy to stop creation of global PATs. | ||
| 1. Sign in to your organization (https://dev.azure.com/{Your_Organization}). | ||
| 2. Select Organization settings (gear icon). | ||
| 3. Select Microsoft Entra, locate the "Restrict global personal access token creation" policy. | ||
| 4. Move the toggle to On. | ||
|
|
||
| #### Allowlist and exceptions | ||
|
|
||
| - Add Microsoft Entra users or groups to the allowlist to exempt them from the restriction. | ||
| - Prefer groups over individual users to avoid identity residency problems. | ||
|
|
||
| **Existing PATs:** | ||
|
|
||
| Existing global PATs remain valid until they expire; the policy affects only newly created tokens. | ||
|
|
||
| **Results:** | ||
|
|
||
| When enabled, new PATs must be associated with a single Azure DevOps organization. Users not on the allowlist cannot create global tokens. | ||
|
|
||
|
|
||
| #### Related links | ||
| * [Learn - Restrict creation of global PATs (tenant policy)](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/manage-pats-with-policies-for-administrators?view=azure-devops#restrict-creation-of-global-pats-tenant-policy) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.