Skip to content

Commit ed9b84d

Browse files
committed
feat: Enhance auto-provisioning checks for self-hosted agent pools
1 parent b3f0bdd commit ed9b84d

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

invoke-adoqr.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,9 +3878,18 @@ function Test-AgentPools {
38783878
$results.Add((New-ControlResult -Id "AP-02" -Status "NOT CHECKED" -Severity "Medium" -Control "Hardened OS Image" -Finding "$prefix — Self-hosted pool. Manual review required for OS hardening."))
38793879
}
38803880

3881-
# AP-04: Auto-provisioning
3882-
if ($pool.autoProvision -eq $true) {
3883-
$results.Add((New-ControlResult -Id "AP-04" -Status "FAIL" -Severity "High" -Control "Auto-Provisioning Disabled" -Finding "$prefix — Auto-provision is enabled. Disable and grant access per-project."))
3881+
# AP-04: Auto-provisioning.
3882+
# Only flag self-hosted pools. Microsoft-hosted pools (Azure Pipelines,
3883+
# Hosted macOS, Hosted Ubuntu, Hosted Windows, etc.) default to
3884+
# autoProvision=true by design — they are isolated, ephemeral VMs
3885+
# managed by Microsoft, so auto-provisioning to new projects does not
3886+
# expand the customer's attack surface in a meaningful way. The
3887+
# AzSK/SDL control targets self-hosted pools where auto-provision
3888+
# could expose a customer-managed build farm to new projects.
3889+
if ($pool.isHosted -eq $true) {
3890+
$results.Add((New-ControlResult -Id "AP-04" -Status "PASS" -Severity "High" -Control "Auto-Provisioning Disabled" -Finding "$prefix — Microsoft-hosted pool; auto-provision is Microsoft-managed and not a customer-side security concern."))
3891+
} elseif ($pool.autoProvision -eq $true) {
3892+
$results.Add((New-ControlResult -Id "AP-04" -Status "FAIL" -Severity "High" -Control "Auto-Provisioning Disabled" -Finding "$prefix — Auto-provision is enabled on a self-hosted pool. Disable and grant access per-project."))
38843893
} else {
38853894
$results.Add((New-ControlResult -Id "AP-04" -Status "PASS" -Severity "High" -Control "Auto-Provisioning Disabled" -Finding "$prefix — Auto-provision is disabled."))
38863895
}

0 commit comments

Comments
 (0)