Skip to content
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

Azure Devops pipeline to Github workflow Migration #2

Merged
merged 87 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
efede91
initial commit for workflow
singhgss Nov 8, 2023
2759523
Added cleanup and deployment actions
singhgss Nov 8, 2023
924f030
fix indendtation
singhgss Nov 8, 2023
f30b293
update
singhgss Nov 14, 2023
bb9ba02
update
singhgss Nov 14, 2023
9f4d94a
update
singhgss Nov 14, 2023
8f7f838
update
singhgss Nov 14, 2023
6ba491f
update
singhgss Nov 14, 2023
92d24ed
update
singhgss Nov 14, 2023
4a5361d
update
singhgss Nov 14, 2023
c06172f
update
singhgss Nov 14, 2023
996a7f9
update
singhgss Nov 14, 2023
6418e37
update
singhgss Nov 14, 2023
b712d54
update
singhgss Nov 14, 2023
e315343
update
singhgss Nov 14, 2023
3cbd2a3
update
singhgss Nov 14, 2023
53ab4b4
update
singhgss Nov 14, 2023
6a70774
update
singhgss Nov 14, 2023
1da14eb
update
singhgss Nov 14, 2023
c10b9ca
update
singhgss Nov 14, 2023
a3fe5c7
update
singhgss Nov 14, 2023
786ea27
update
singhgss Nov 14, 2023
ab88dab
update
singhgss Nov 14, 2023
872186b
update
singhgss Nov 14, 2023
21493ee
update
singhgss Nov 14, 2023
9227ef8
update
singhgss Nov 14, 2023
be3b7f5
update
singhgss Nov 15, 2023
30aa6a8
update
singhgss Nov 15, 2023
fe0351f
update
singhgss Nov 15, 2023
a194b88
update
singhgss Nov 15, 2023
3963aaa
update
singhgss Nov 15, 2023
174a84f
update
singhgss Nov 15, 2023
bb66421
update
singhgss Nov 15, 2023
b916c24
update
singhgss Nov 15, 2023
ac1dd0f
update
singhgss Nov 16, 2023
859c446
update
singhgss Nov 16, 2023
65666e9
update
singhgss Nov 16, 2023
7964b94
update
singhgss Nov 17, 2023
1b5ce3d
update
singhgss Nov 17, 2023
f4599df
update
singhgss Nov 17, 2023
7bc73d8
update
singhgss Nov 17, 2023
6ceb9d0
update
singhgss Nov 17, 2023
0d12e24
update
singhgss Nov 17, 2023
716c16b
update
singhgss Nov 17, 2023
82fbd7c
update
singhgss Nov 17, 2023
75066a6
update
singhgss Nov 17, 2023
84dabbb
update
singhgss Nov 17, 2023
2f9f48f
update
singhgss Nov 17, 2023
894bd1f
update
singhgss Nov 20, 2023
aadb3ed
update
singhgss Nov 23, 2023
5d5f77f
empty change
singhgss Nov 23, 2023
b8aeca9
update
singhgss Nov 23, 2023
b945448
update
singhgss Nov 23, 2023
374e7e4
update
singhgss Nov 23, 2023
4a39f39
update
singhgss Nov 23, 2023
a45ed27
update
singhgss Nov 23, 2023
91409d1
update
singhgss Nov 23, 2023
947b799
update
singhgss Nov 23, 2023
f95bc63
update
singhgss Nov 23, 2023
2302b9b
update
singhgss Nov 23, 2023
a9eb25b
update
singhgss Nov 23, 2023
a1ce0ff
update
singhgss Nov 23, 2023
be8a97b
update
singhgss Nov 23, 2023
a865575
update
singhgss Nov 23, 2023
7743507
update
singhgss Nov 23, 2023
5a6e575
update
singhgss Nov 23, 2023
9976133
update
singhgss Nov 24, 2023
a651e14
update
singhgss Nov 24, 2023
821bc18
update
singhgss Nov 24, 2023
69465a6
update
singhgss Nov 24, 2023
932b48b
update
singhgss Nov 24, 2023
9957649
update
singhgss Nov 24, 2023
4f60490
update
singhgss Nov 24, 2023
e889db4
update
singhgss Nov 24, 2023
a0db094
update
singhgss Nov 24, 2023
0b5db08
update
singhgss Nov 24, 2023
0e63692
update
singhgss Nov 24, 2023
8d274ec
update
singhgss Nov 24, 2023
9e28f09
update
singhgss Nov 24, 2023
d97ac5e
update
singhgss Nov 24, 2023
7dd1495
update
singhgss Nov 24, 2023
821e6c3
update
singhgss Nov 24, 2023
f5bfbe6
update
singhgss Nov 27, 2023
3871ba2
fix tag json
singhgss Nov 27, 2023
493fea1
update tags
singhgss Nov 27, 2023
ff84e2a
trigger only when merge targets PR
singhgss Nov 29, 2023
2b74450
update
singhgss Nov 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
402 changes: 402 additions & 0 deletions .github/workflows/sign-scripts-development.yml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions setup/IaC/modules/automationaccount.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ resource guardrailsAC 'Microsoft.Automation/automationAccounts@2021-06-22' = if
properties: {
contentLink: {
uri: '${ModuleBaseURL}/Check-BreakGlassAccountOwnersInformation.zip'
version: '1.0.0'

version: '1.0.0'
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion setup/backend.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-GSAAutomationVariable {

Write-Verbose "Getting automation variable '$name'"
# when running in an Azure Automation Account
If ($ENV:AZUREPS_HOST_ENVIRONMENT -eq 'AzureAutomation/') {
If ($ENV:AZUREPS_HOST_ENVIRONMENT -eq 'AzureAutomation/' -or $PSPrivateMetadata.JobId) {
$value = Get-AutomationVariable -Name $name
return $value
}
Expand Down Expand Up @@ -44,6 +44,15 @@ try {
catch {
throw "Critical: Failed to connect to Azure with the 'Connect-AzAccount' command and '-identity' (MSI) parameter; verify that Azure Automation identity is configured. Error message: $_"
}

try {
$RuntimeConfig = Get-AzKeyVaultSecret -VaultName $KeyVaultName -Name 'gsaConfigExportLatest' -AsPlainText -ErrorAction Stop | ConvertFrom-Json | Select-Object -Expand runtime
Set-AzContext -SubscriptionId $RuntimeConfig.subscriptionId
}
catch {
throw "Failed to retrieve config json with secret name gsaConfigExportLatest from KeyVault '$KeyVaultName'. Error message: $_"
}

$SubID = (Get-AzContext).Subscription.Id
$tenantID = (Get-AzContext).Tenant.Id
try {
Expand Down
2 changes: 1 addition & 1 deletion setup/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Get-GSAAutomationVariable {

Write-Debug "Getting automation variable '$name'"
# when running in an Azure Automation Account
If ($ENV:AZUREPS_HOST_ENVIRONMENT -eq 'AzureAutomation/') {
If ($ENV:AZUREPS_HOST_ENVIRONMENT -eq 'AzureAutomation/' -or $PSPrivateMetadata.JobId ) {
$value = Get-AutomationVariable -Name $name
return $value
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Function Confirm-GSAConfigurationParameters {
# running in Cloud Shell, finding delegated user ID
$userId = (Get-AzAdUser -SignedIn).Id
}
ElseIf ($context.Account.Type -eq 'ServicePrincipal') {
ElseIf ($context.Account.Type -eq 'ServicePrincipal' -or $context.Account.Type -eq 'ClientAssertion') { # Federated Identity
$sp = Get-AzADServicePrincipal -ApplicationId $context.Account.Id
$userId = $sp.Id
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Function Confirm-GSAPrerequisites {
$uri = 'https://management.azure.com/providers/Microsoft.Management/managementGroups/{0}/providers/Microsoft.Authorization/roleAssignments/{1}?&api-version=2015-07-01' -f $lighthouseTargetManagementGroupID, '2cb8e1b1-fcf1-439e-bab7-b1b8b008c294'
$roleAssignments = Invoke-AzRestMethod -Uri $uri -Method GET | Select-Object -Expand Content | ConvertFrom-Json
If ($roleAssignments.id) {
Write-Verbose "role assignment: $(($roleAssignments).id)"
Write-Verbose "role assignment: '$roleAssignments.id'"
Write-Error "A role assignment exists with the name '2cb8e1b1-fcf1-439e-bab7-b1b8b008c294' at the Management group '$lighthouseTargetManagementGroupID'. This was likely
created by a previous Guardrails deployment and must be removed. Navigate to the Managment Group in the Portal and delete the Owner role assignment listed as 'Identity Not Found'"
Exit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Function Remove-GSACentralizedDefenderCustomerComponents {
Read-Host
}

$lighthouseTargetManagementGroupID = 'mb_co'
#$lighthouseTargetManagementGroupID = 'mb_co'
If ($lighthouseTargetManagementGroupID -eq (Get-AzContext).Tenant.Id) {
$assignmentScopeMgmtmGroupId = '/'
}
Expand Down
Loading