Skip to content

Feature/azdo tests update#1604

Merged
merill merged 5 commits intomaester365:mainfrom
SebastianClaesson:feature/azdo-tests-update
Apr 13, 2026
Merged

Feature/azdo tests update#1604
merill merged 5 commits intomaester365:mainfrom
SebastianClaesson:feature/azdo-tests-update

Conversation

@SebastianClaesson
Copy link
Copy Markdown
Contributor

Description

This PR adds two new Azure DevOps tests and fixes return logic in three existing tests.

New tests:

  • AZDO.1037 - Restrict Personal Access Token creation at the organization level
  • AZDO.1038 - Block extensions from accessing local network resources (SSRF prevention)

Bug fixes:

  • Test-AzdoExternalGuestAccess - Fixed inverted return value and improved result messages
  • Test-AzdoSSHAuthentication - Changed from effectiveValue to value and corrected swapped result messages
  • Test-AzdoThirdPartyAccessViaOauth - Corrected swapped result messages and fixed grammar

Other changes:

  • Added (Tenant) / (Organization) scope labels to tests AZDO.1032-1038 for clarity
  • Updated maester-config.json with new test entries and updated titles

Contribution Checklist

Before submitting this PR, please confirm you have completed the following:

  • 📖 Read the guidelines for contributing to this repository.
  • 🧪 Ensure the build and unit tests pass by running /powershell/tests/pester.ps1 on your local system.

SebastianClaesson and others added 3 commits April 7, 2026 21:07
… fix existing test logic

New tests:
- AZDO.1037: Restrict PAT creation at organization level
- AZDO.1038: Block extensions from accessing local network resources (SSRF)

Fixes:
- Corrected return values and result messages for ExternalGuestAccess,
  SSHAuthentication, and ThirdPartyAccessViaOauth tests
- Added (Tenant)/(Organization) scope labels to AZDO.1032-1038
@SebastianClaesson SebastianClaesson requested review from a team as code owners April 7, 2026 19:23
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 7, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional Azure DevOps security posture coverage and corrects pass/fail semantics in existing AZDO tests so that “secure configuration” consistently returns $true.

Changes:

  • Fixes return logic / message polarity in Test-AzdoThirdPartyAccessViaOauth, Test-AzdoSSHAuthentication, and Test-AzdoExternalGuestAccess (and updates Pester assertions accordingly).
  • Adds two new organization-scope tests: restricting PAT creation (AZDO.1037) and preventing extension local-network access (AZDO.1038).
  • Updates maester-config.json titles (adds scope labels) and exports the new cmdlets via the module manifest.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Maester/AzureDevOps/Test-Azdo.Tests.ps1 Updates expected booleans for fixed tests; adds AZDO.1037/1038; adds scope labels to AZDO.1032–1036.
tests/maester-config.json Adds entries for AZDO.1037/1038 and updates AZDO.1032–1036 titles with scope labels.
powershell/public/maester/azuredevops/Test-AzdoThirdPartyAccessViaOauth.ps1 Fixes result message polarity to match the returned boolean.
powershell/public/maester/azuredevops/Test-AzdoSSHAuthentication.ps1 Uses .value and corrects message polarity for the SSH policy result.
powershell/public/maester/azuredevops/Test-AzdoExternalGuestAccess.ps1 Fixes inverted return value and improves result messaging/grammar.
powershell/public/maester/azuredevops/Test-AzdoDisablePATCreation.ps1 New org-scope policy test for restricting PAT creation (AZDO.1037).
powershell/public/maester/azuredevops/Test-AzdoDisablePATCreation.md Documentation/remediation guidance for AZDO.1037.
powershell/public/maester/azuredevops/Test-AzdoAllowExtensionsLocalNetworkAccess.ps1 New org-scope policy test for extension local-network access (AZDO.1038).
powershell/public/maester/azuredevops/Test-AzdoAllowExtensionsLocalNetworkAccess.md Documentation/remediation guidance for AZDO.1038.
powershell/Maester.psd1 Exports the two new Test-Azdo* functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Maester/AzureDevOps/Test-Azdo.Tests.ps1 Outdated
Comment thread tests/Maester/AzureDevOps/Test-Azdo.Tests.ps1 Outdated
Comment thread tests/maester-config.json Outdated
Comment thread powershell/public/maester/azuredevops/Test-AzdoThirdPartyAccessViaOauth.ps1 Outdated
Comment thread powershell/Maester.psd1
SebastianClaesson and others added 2 commits April 8, 2026 13:54
- Fix "restrict ... to access" -> "restrict ... from accessing" grammar
  in AZDO.1000 test and ThirdPartyAccessViaOauth result messages
- Rename AZDO.1038 title from "Allow" to "Disallow" to reflect
  the expected secure configuration
- Sort module manifest exports alphabetically
Copy link
Copy Markdown
Contributor

@merill merill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thanks @SebastianClaesson!

@merill merill merged commit bd8a10c into maester365:main Apr 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants