Merged PR 53135: soc2 audit list changes

soc2 audit list changes #103958 #103959

Related work items: #103958, #103959
This commit is contained in:
Jurjen Ladenius
2024-09-11 11:36:02 +00:00
parent b92ce8b218
commit 1a9214db67
4 changed files with 68 additions and 3 deletions

View File

@@ -0,0 +1,65 @@
class PipelineInfo {
[string] $Id = ""
[string] $Name = ""
[string] $Path = ""
[string] $Type = ""
[string] $Author = ""
[string] $CreatedDate = ""
[string] $PipelineType = ""
[string] $PipelineEditUrl = ""
}
$token = "hyrvwxicogy37djvmhkwrcdexokcrpyudkk4j2n3n7gnjb5wsv5a"
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($token)"))
$organization = "effectory"
$project = "Survey%20Software"
$head = @{ Authorization =" Basic $token" }
function GetPipelineType {
param (
[int] $pipeLineId
)
$url = "https://dev.azure.com/$organization/$project/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=$pipeLineId&__rt=fps&__ver=2"
$response = Invoke-RestMethod -Uri $url -Method GET -Headers $head
return $response.fps.dataProviders.data."ms.vss-build-web.pipeline-detail-data-provider".definitionProcessType
}
[string] $date = Get-Date -Format "yyyy-MM-dd HHmm"
$fileName = ".\$date pipelines.csv"
Write-Host "========================================================================================================================================================================"
Write-Host "Creating service connection overview."
Write-Host "========================================================================================================================================================================"
$url="https://dev.azure.com/$organization/$project/_apis/build/definitions?api-version=7.1-preview.7"
$response = Invoke-RestMethod -Uri $url -Method GET -Headers $head
[PipelineInfo[]]$Result = @()
$response.value | ForEach-Object {
$definitionProcessType = GetPipelineType -pipeLineId $_.id
[PipelineInfo] $pipelineInfo = [PipelineInfo]::new()
$pipelineInfo.Id = $_.id
$pipelineInfo.Name = $_.name
$pipelineInfo.Path = $_.path
$pipelineInfo.Type = $_.type
$pipelineInfo.Author = $_.authoredby.DisplayName
$pipelineInfo.CreatedDate = $_.createdDate
$pipelineInfo.PipelineType = $definitionProcessType -eq 1 ? "Classic" : "Yaml"
$pipelineInfo.PipelineEditUrl = $definitionProcessType -eq 1 ?
"https://dev.azure.com/$organization/$project/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=$($_.id)" :
"https://dev.azure.com/$organization/$project/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=$($_.id)&branch=master"
$Result += $pipelineInfo
}
$Result | Export-Csv -Path $fileName -Append -NoTypeInformation
Write-Host "========================================================================================================================================================================"
Write-Host "Done."

View File

@@ -17,7 +17,7 @@ class PullRequest {
$fileName = ".\$date pull requests.csv" $fileName = ".\$date pull requests.csv"
Write-Host "========================================================================================================================================================================" Write-Host "========================================================================================================================================================================"
Write-Host "Creating repository overview." Write-Host "Creating pull request overview."
Write-Host "========================================================================================================================================================================" Write-Host "========================================================================================================================================================================"
$repos = az repos list --organization "https://dev.azure.com/effectory/" --project "survey software" | ConvertFrom-Json | Select-Object | Where-Object { $true -ne $_.isDisabled } $repos = az repos list --organization "https://dev.azure.com/effectory/" --project "survey software" | ConvertFrom-Json | Select-Object | Where-Object { $true -ne $_.isDisabled }

View File

@@ -21,7 +21,7 @@ class UserItem {
[string] $AuthenticationType = "" [string] $AuthenticationType = ""
} }
$serverList= @('c0m7f8nybr.database.windows.net','calculations.database.windows.net','effectory.database.windows.net','effectorycore.database.windows.net', 'logit-backup.database.windows.net', 'mhpfktialk.database.windows.net', 'participants.database.windows.net', 'signin-effectory.database.windows.net', 'sqlserver01prod.6a1f4aa9f43a.database.windows.net', 'teamie.database.windows.net') $serverList= @('c0m7f8nybr.database.windows.net','calculations.database.windows.net','effectory.database.windows.net','effectorycore.database.windows.net', 'logit-backup.database.windows.net', 'mhpfktialk.database.windows.net', 'participants.database.windows.net', 'signin-effectory.database.windows.net', 'sqlserver01prod.6a1f4aa9f43a.database.windows.net')
# 'sqlserver01test.164709c94fb0.database.windows.net', 'replication.database.windows.net', # 'sqlserver01test.164709c94fb0.database.windows.net', 'replication.database.windows.net',
@@ -40,7 +40,7 @@ select @@SERVERNAME as serverName,
type_desc as type, type_desc as type,
authentication_type_desc as authentication_type authentication_type_desc as authentication_type
from sys.database_principals from sys.database_principals
where type not in ('A', 'G', 'R', 'X') where type not in ('R')
and sid is not null and sid is not null
and name != 'guest' and name != 'guest'
order by name; order by name;

View File