-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from craddm/develop
update fix-error-messages branch
- Loading branch information
Showing
59 changed files
with
266 additions
and
640 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
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
param( | ||
[Parameter(Mandatory = $true, HelpMessage = "Enter SHM ID (e.g. use 'testa' for Turing Development Safe Haven A)")] | ||
[string]$shmId, | ||
[Parameter(Mandatory = $false, HelpMessage = "No-op mode which will not remove anything")] | ||
[Switch]$dryRun | ||
) | ||
|
||
Import-Module Az.Accounts -ErrorAction Stop | ||
Import-Module $PSScriptRoot/../common/AzureCompute -Force -ErrorAction Stop | ||
Import-Module $PSScriptRoot/../common/Configuration -Force -ErrorAction Stop | ||
Import-Module $PSScriptRoot/../common/Logging -Force -ErrorAction Stop | ||
|
||
# Get config | ||
# ------------------------------- | ||
$config = Get-ShmConfig -shmId $shmId | ||
$originalContext = Get-AzContext | ||
|
||
# Delete users not currently in a security group | ||
# ---------------------------------------------- | ||
$null = Set-AzContext -SubscriptionId $config.subscriptionName -ErrorAction Stop | ||
$script = "remote/Delete_Unassigned_Users.ps1" | ||
|
||
# Passing a param to a remote script requires it to be a string | ||
if ($dryRun.IsPresent) { | ||
Add-LogMessage -Level Info "Listing users not assigned to any security group from $($config.dc.vmName)..." | ||
$params = @{dryRun = "yes" } | ||
} else { | ||
Add-LogMessage -Level Info "Deleting users not assigned to any security group from $($config.dc.vmName)..." | ||
$params = @{dryRun = "no" } | ||
} | ||
$result = Invoke-RemoteScript -Shell "PowerShell" -ScriptPath $script -VMName $config.dc.vmName -ResourceGroupName $config.dc.rg -Parameter $params | ||
|
||
$null = Set-AzContext -Context $originalContext -ErrorAction Stop |
33 changes: 33 additions & 0 deletions
33
deployment/administration/remote/Delete_Unassigned_Users.ps1
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,33 @@ | ||
param( | ||
[Parameter(Mandatory = $true, HelpMessage = "yes/no determines whether users should actually be deleted")] | ||
[string]$dryRun | ||
) | ||
|
||
# Extract list of users | ||
$userOuPath = (Get-ADObject -Filter * | Where-Object { $_.Name -eq "Safe Haven Research Users" }).DistinguishedName | ||
$users = Get-ADUser -Filter * -SearchBase "$userOuPath" -Properties * | ||
foreach ($user in $users) { | ||
$groupName = ($user | Select-Object -ExpandProperty MemberOf | ForEach-Object { (($_ -Split ",")[0] -Split "=")[1] }) -join "|" | ||
if (!($groupName)) { | ||
$name = $user.SamAccountName | ||
if ($dryRun -eq "yes") { | ||
Write-Output "User $name would be deleted by this action" | ||
} else { | ||
Write-Output "Deleting $name" | ||
Remove-ADUser -Identity $name -Confirm:$false | ||
} | ||
} | ||
} | ||
|
||
# Force sync with AzureAD. It will still take around 5 minutes for changes to propagate | ||
if ($dryRun -eq "no") { | ||
Write-Output "Synchronising locally Active Directory with Azure" | ||
try { | ||
Import-Module -Name "C:\Program Files\Microsoft Azure AD Sync\Bin\ADSync" -ErrorAction Stop | ||
Start-ADSyncSyncCycle -PolicyType Delta | ||
} catch [System.IO.FileNotFoundException] { | ||
Write-Output "Skipping as Azure AD Sync is not installed" | ||
} catch { | ||
Write-Output "Unable to run Azure Active Directory synchronisation!" | ||
} | ||
} |
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
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
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
12 changes: 0 additions & 12 deletions
12
deployment/secure_research_desktop/cloud_init/resources/pyenv_pyproject_template.toml
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
deployment/secure_research_desktop/packages/deb-azuredatastudio.version
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
hash: c105a5286861ff1f312ab699d5810af7dc0e668917afb1f80c4eda3a58bb8d34 | ||
version: 1.45.1 | ||
hash: 6c75efb8596d25152bc44f6f59a4b96cd013219b0c87ae2365ca8f69fe29e206 | ||
version: 1.46.0 | ||
debfile: azuredatastudio-linux-|VERSION|.deb | ||
remote: https://sqlopsbuilds.azureedge.net/stable/88c21b1725a3e79440027bdb7b5a55fb036be0e2/|DEBFILE| | ||
remote: https://sqlopsbuilds.azureedge.net/stable/39449bbe88a0bc4092c9b205cad10d0a556beffd/|DEBFILE| |
4 changes: 2 additions & 2 deletions
4
deployment/secure_research_desktop/packages/deb-rstudio-focal.version
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
hash: 49e24a6956f9f12ffeded493f571cd39f3e6c89411fc60d3bb228661793320da | ||
version: 2023.06.1-524 | ||
hash: 981fcbb30d5dea283188fcef1a9cdf177bb51b83884a63fd3c9c224d1486b01e | ||
version: 2023.06.2-561 | ||
debfile: rstudio-|VERSION|-amd64.deb | ||
remote: https://download1.rstudio.org/electron/focal/amd64/|DEBFILE| |
4 changes: 2 additions & 2 deletions
4
deployment/secure_research_desktop/packages/deb-rstudio-jammy.version
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
hash: c030ec8338f1c76b3ae27997ec4411a0af43b2367dedb3d48e95c319b5425698 | ||
version: 2023.06.1-524 | ||
hash: bb6b3c21510abb18fd6e697567d7ff3d4135bf7980cf25536753e9ceac60c82c | ||
version: 2023.06.2-561 | ||
debfile: rstudio-|VERSION|-amd64.deb | ||
remote: https://download1.rstudio.org/electron/jammy/amd64/|DEBFILE| |
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
1 change: 1 addition & 0 deletions
1
deployment/secure_research_desktop/packages/packages-r-cran.list
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
arrow | ||
BiocManager | ||
caret | ||
csv | ||
|
Oops, something went wrong.