-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
11 changed files
with
218 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
30 changes: 30 additions & 0 deletions
30
src/PSRule.Rules.AzureDevOps/en/Azure.DevOps.ServiceConnections.ClassicAzure.md
This file contains 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,30 @@ | ||
--- | ||
category: Microsoft Azure DevOps Service Connections | ||
severity: Severe | ||
online version: https://github.com/cloudyspells/PSRule.Rules.AzureDevOps/blob/main/src/PSRule.Rules.AzureDevOps/en/Azure.DevOps.ServiceConnections.ClassicAzure.md | ||
--- | ||
|
||
# Azure.DevOps.ServiceConnections.ClassicAzure | ||
|
||
## SYNOPSIS | ||
|
||
A Service connection should not use the Classic Azure service connection type. | ||
|
||
## DESCRIPTION | ||
|
||
A service connection is a securely stored object that contains information about how to | ||
connect to a service. Service connections are used during the build or release pipeline to | ||
connect to external and remote resources. The Classic Azure service connection type can not | ||
be scoped to a specific resource group or subscription. This means that any user with | ||
access to the service connection can deploy to any resource group or subscription. Also | ||
the Classic Azure service connection type does not support modern ways of authentication. | ||
|
||
## RECOMMENDATION | ||
|
||
Consider using a service connection type that can be scoped to a specific resource group | ||
with modern authentication. | ||
|
||
## LINKS | ||
|
||
- [Azure DevOps security best practices](https://learn.microsoft.com/en-us/azure/devops/organizations/security/security-best-practices?view=azure-devops#scope-service-accounts) | ||
- [Create a service connection](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-using-workload-identity-federation) |
29 changes: 29 additions & 0 deletions
29
src/PSRule.Rules.AzureDevOps/en/Azure.DevOps.ServiceConnections.GitHubPAT.md
This file contains 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,29 @@ | ||
--- | ||
category: Microsoft Azure DevOps Service Connections | ||
severity: Severe | ||
online version: https://github.com/cloudyspells/PSRule.Rules.AzureDevOps/blob/main/src/PSRule.Rules.AzureDevOps/en/Azure.DevOps.ServiceConnections.GitHubPAT.md | ||
--- | ||
|
||
# Azure.DevOps.ServiceConnections.GitHubPAT | ||
|
||
## SYNOPSIS | ||
|
||
A service connection should not use a GitHub Personal Access Token (PAT). | ||
|
||
## DESCRIPTION | ||
|
||
A service connection is a secure stored object that contains information about how to | ||
connect to a service. Service connections are used during the build or release pipeline | ||
to connect to external and remote resources. The GitHub PAT service connection type is | ||
linked to a personal account and cannot be traced back to the specific connection from | ||
Azure DevOps. This means any user with access to the service connection can impersonate | ||
the user who created the service connection. | ||
|
||
## RECOMMENDATION | ||
|
||
Consider using an oauth-based service connection. | ||
|
||
## LINKS | ||
|
||
- [Azure DevOps security best practices](https://learn.microsoft.com/en-us/azure/devops/organizations/security/security-best-practices?view=azure-devops#secure-github-integrations) | ||
- [Create a service connection](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/connect-to-azure?view=azure-devops) |
31 changes: 31 additions & 0 deletions
31
src/PSRule.Rules.AzureDevOps/nl/Azure.DevOps.ServiceConnections.ClassicAzure.md
This file contains 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,31 @@ | ||
--- | ||
category: Microsoft Azure DevOps Service Connections | ||
severity: Severe | ||
online version: https://github.com/cloudyspells/PSRule.Rules.AzureDevOps/blob/main/src/PSRule.Rules.AzureDevOps/nl/Azure.DevOps.ServiceConnections.ClassicAzure.md | ||
--- | ||
|
||
# Azure.DevOps.ServiceConnections.ClassicAzure | ||
|
||
## SYNOPSIS | ||
|
||
Een serviceverbinding mag niet het klassieke Azure-serviceverbindingstype gebruiken. | ||
|
||
## DESCRIPTION | ||
|
||
Een serviceverbinding is een veilig opgeslagen object dat informatie bevat over hoe u | ||
verbinding kunt maken met een service. Serviceverbindingen worden tijdens de build- of | ||
release-pijplijn gebruikt om verbinding te maken met externe en externe bronnen. Het | ||
klassieke Azure-serviceverbindingstype kan niet worden geschaald naar een specifieke | ||
resourcegroep of abonnement. Dit betekent dat elke gebruiker met toegang tot de | ||
serviceverbinding kan implementeren naar elke resourcegroep of elk abonnement. Ook het | ||
klassieke Azure-serviceverbindingstype ondersteunt geen moderne manieren van authenticatie. | ||
|
||
## RECOMMENDATION | ||
|
||
Overweeg om een serviceverbindingstype te gebruiken dat kan worden geschaald naar een | ||
specifieke resourcegroep met moderne authenticatie. | ||
|
||
## LINKS | ||
|
||
- [Azure DevOps security best practices](https://learn.microsoft.com/nl-nl/azure/devops/organizations/security/security-best-practices?view=azure-devops#scope-service-accounts) | ||
- [Create a service connection](https://learn.microsoft.com/nl-nl/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-using-workload-identity-federation) |
30 changes: 30 additions & 0 deletions
30
src/PSRule.Rules.AzureDevOps/nl/Azure.DevOps.ServiceConnections.GitHubPAT.md
This file contains 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,30 @@ | ||
--- | ||
category: Microsoft Azure DevOps Service Connections | ||
severity: Severe | ||
online version: https://github.com/cloudyspells/PSRule.Rules.AzureDevOps/blob/main/src/PSRule.Rules.AzureDevOps/nl/Azure.DevOps.ServiceConnections.GitHubPAT.md | ||
--- | ||
|
||
# Azure.DevOps.ServiceConnections.GitHubPAT | ||
|
||
## SYNOPSIS | ||
|
||
Een serviceverbinding zou geen GitHub-persoonlijke toegangstoken (PAT) moeten gebruiken. | ||
|
||
## DESCRIPTION | ||
|
||
Een serviceverbinding is een veilig opgeslagen object dat informatie bevat over hoe u | ||
verbinding kunt maken met een service. Serviceverbindingen worden tijdens de build- of | ||
release-pijplijn gebruikt om verbinding te maken met externe en externe bronnen. Het GitHub | ||
PAT-serviceverbindingstype is gekoppeld aan een persoonlijk account en kan niet worden | ||
getraceerd naar de specifieke verbinding vanuit Azure DevOps. Dit betekent dat elke | ||
gebruiker met toegang tot de serviceverbinding zich kan voordoen als de gebruiker die de | ||
serviceverbinding heeft gemaakt. | ||
|
||
## RECOMMENDATION | ||
|
||
Overweeg een oauth-gebaseerde serviceverbinding te gebruiken. | ||
|
||
## LINKS | ||
|
||
- [Azure DevOps security best practices](https://learn.microsoft.com/nl-nl/azure/devops/organizations/security/security-best-practices?view=azure-devops#secure-github-integrations) | ||
- [Create a service connection](https://learn.microsoft.com/nl-nl/azure/devops/pipelines/library/connect-to-azure?view=azure-devops) |
This file contains 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 |
---|---|---|
|
@@ -46,7 +46,7 @@ Rule 'Azure.DevOps.ServiceConnections.Scope' ` | |
-Ref 'ADO-SC-004' ` | ||
-Type 'Azure.DevOps.ServiceConnection' ` | ||
-Tag @{ release = 'GA'} ` | ||
-If { $TargetObject.data.scopeLevel -eq 'Subscription' } ` | ||
-If { $TargetObject.data.scopeLevel -eq 'Subscription' -and $TargetObject.type -eq 'azurerm' } ` | ||
-Level Information { | ||
# Description 'Service connection should have a scope that is not an entire subscription.' | ||
Reason 'The service connection is scoped to a subscription.' | ||
|
@@ -64,7 +64,7 @@ Rule 'Azure.DevOps.ServiceConnections.WorkloadIdentityFederation' ` | |
-Ref 'ADO-SC-005' ` | ||
-Type 'Azure.DevOps.ServiceConnection' ` | ||
-Tag @{ release = 'GA'} ` | ||
-If { $TargetObject.data.scopeLevel -eq 'Subscription' } ` | ||
-If { $TargetObject.data.scopeLevel -eq 'Subscription' -and $TargetObject.type -eq 'azurerm' } ` | ||
-Level Warning { | ||
# Description 'Service connection should should use Workload Idenity Federation.' | ||
Reason 'The service connection does not use Workload Idenity Federation.' | ||
|
@@ -89,3 +89,29 @@ Rule 'Azure.DevOps.ServiceConnections.ProductionBranchLimit' ` | |
$Assert.HasField($TargetObject, "Checks[[email protected] == 'Branch control'].settings.inputs.allowedBranches", $true) | ||
$Assert.HasFieldValue($TargetObject, "Checks[[email protected] == 'Branch control'].settings.inputs.allowedBranches") | ||
} | ||
|
||
# Synopsis: Service Connection should not be of the classic azure type | ||
Rule 'Azure.DevOps.ServiceConnections.ClassicAzure' ` | ||
-Ref 'ADO-SC-007' ` | ||
-Type 'Azure.DevOps.ServiceConnection' ` | ||
-Tag @{ release = 'GA'} ` | ||
-If { $TargetObject.type -match 'azure' } ` | ||
-Level Warning { | ||
# Description 'Service Connection should not be of the classic azure type.' | ||
Reason 'The service connection is of the classic azure type.' | ||
Recommend 'Use the Azure Resource Manager service connection type.' | ||
$Assert.NotIn($TargetObject, "type", "azure") | ||
} | ||
|
||
# Synposis: Service Connections of the GitHub type should not use a PAT | ||
Rule 'Azure.DevOps.ServiceConnections.GitHubPAT' ` | ||
-Ref 'ADO-SC-008' ` | ||
-Type 'Azure.DevOps.ServiceConnection' ` | ||
-If { $TargetObject.type -match 'github' } ` | ||
-Tag @{ release = 'GA'} ` | ||
-Level Warning { | ||
# Description 'Service Connections of the GitHub type should not use a PAT.' | ||
Reason 'The service connection uses a PAT.' | ||
Recommend 'Use a GitHub App instead of a PAT.' | ||
$Assert.NotIn($TargetObject, "authorization.scheme", "Token") | ||
} |
Oops, something went wrong.