Skip to content

Commit

Permalink
fixed miscellaneous issues
Browse files Browse the repository at this point in the history
  • Loading branch information
netevert committed Feb 3, 2021
1 parent b0fec18 commit 408c0f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lab/files/install-utilities.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@ $domain = $fulldomain
$password = $adminpassword | ConvertTo-SecureString -asPlainText -Force
$username = $adminusername
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential
Add-Computer -DomainName $domain -Credential $credential
Restart-Computer
8 changes: 3 additions & 5 deletions lab/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ resource "azurerm_virtual_machine" "dc1" {
}

# Create active directory domain forest
# https://raw.githubusercontent.com/BlueTeamLabs/sentinel-attack/master/lab/files/create-ad.ps1
resource "azurerm_virtual_machine_extension" "create_ad" {
name = "create_ad"
virtual_machine_id = azurerm_virtual_machine.dc1.id
Expand All @@ -192,7 +191,7 @@ resource "azurerm_virtual_machine_extension" "create_ad" {
tags = var.tags
protected_settings = <<PROT
{
"fileUris": ["https://raw.githubusercontent.com/netevert/scripts/master/create-ad.ps1"],
"fileUris": ["https://raw.githubusercontent.com/BlueTeamLabs/sentinel-attack/master/lab/files/create-ad.ps1"],
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File create-ad.ps1 ${var.accounts.dc1_admin_password} ${var.prefix}.com ${var.prefix}"
}
PROT
Expand Down Expand Up @@ -272,7 +271,6 @@ resource "azurerm_virtual_machine" "pc1" {
}

# Install utilities on workstation 1 and join domain
# https://raw.githubusercontent.com/BlueTeamLabs/sentinel-attack/master/lab/files/install-utilities.ps1
resource "azurerm_virtual_machine_extension" "utils_pc1" {
name = "utils_pc1"
virtual_machine_id = azurerm_virtual_machine.pc1.id
Expand All @@ -282,8 +280,8 @@ resource "azurerm_virtual_machine_extension" "utils_pc1" {
tags = var.tags
protected_settings = <<PROT
{
"fileUris": ["https://raw.githubusercontent.com/netevert/scripts/master/install-utilities.ps1"],
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File install-utilities.ps1 ${var.prefix}.com ${var.accounts.dc1_admin_password} ${var.prefix}.com\${var.accounts.dc1_admin_user}"
"fileUris": ["https://raw.githubusercontent.com/BlueTeamLabs/sentinel-attack/master/lab/files/install-utilities.ps1"],
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File install-utilities.ps1 ${var.prefix}.com ${var.accounts.dc1_admin_password} ${var.prefix}.com\\${var.accounts.dc1_admin_user}"
}
PROT
depends_on = [azurerm_virtual_machine.pc1]
Expand Down

0 comments on commit 408c0f6

Please sign in to comment.