Split into qemu and proxmox platforms over a shared content tree
platforms/qemu and platforms/proxmox each have their own lab.sh and lab.conf; content/ holds everything shared (roles, seed, site, helpers). The dispatcher, preflight and command implementations are common and take platform differences from the backend. Proxmox backend: qm create with q35/SATA/e1000, ISOs and seed ISOs in an ISO storage, provisioning over qm guest exec (no Python packages needed on the host), template + clone for reset, and peers/ to emit WireGuard configs. The role scripts now ride on the seed ISO, so provisioning transfers nothing. build-bundle.sh produces a self-contained tarball per platform, for hosts that cannot reach the git server. Both configs are generic: no absolute path from this machine remains.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Norbourg lab — WS01 stage 2: local privileges and the workstation flag.
|
||||
|
||||
. "$PSScriptRoot\..\lib\common.ps1"
|
||||
|
||||
$self = $PSCommandPath
|
||||
Write-LabLog 'ws01: post stage starting'
|
||||
|
||||
try {
|
||||
Wait-ForDomain 600
|
||||
|
||||
# svc_backup becomes a local admin through this domain group.
|
||||
try {
|
||||
Add-LocalGroupMember -Group 'Administrators' -Member '@@NETBIOS@@\WS Admins' -ErrorAction Stop
|
||||
Write-LabLog 'ws01: WS Admins added to local Administrators'
|
||||
} catch {
|
||||
Write-LabLog 'ws01: WS Admins already local admin'
|
||||
}
|
||||
|
||||
$flagDir = 'C:\flag'
|
||||
New-Item -ItemType Directory -Force -Path $flagDir | Out-Null
|
||||
$userFlag = Join-Path $flagDir 'user.txt'
|
||||
if (-not (Test-Path $userFlag)) {
|
||||
Set-Content -Path $userFlag -Value 'NORBOURG{w0rkst4t10n_l4t3r4l_m0v3}' -Encoding ascii
|
||||
}
|
||||
|
||||
$acl = Get-Acl $flagDir
|
||||
$acl.SetAccessRuleProtection($true, $false)
|
||||
foreach ($id in @('BUILTIN\Administrators', 'NT AUTHORITY\SYSTEM')) {
|
||||
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
||||
$id, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow')
|
||||
$acl.AddAccessRule($rule)
|
||||
}
|
||||
Set-Acl -Path $flagDir -AclObject $acl
|
||||
Write-LabLog 'ws01: user.txt in place'
|
||||
|
||||
Complete-Stage $self 'ok'
|
||||
} catch {
|
||||
Fail-Stage $self $_.Exception.Message
|
||||
}
|
||||
Reference in New Issue
Block a user