Add ALD Transition Console preview and Astra lab build workflow

This commit is contained in:
scandalist-trash committed 2026-10-27 10:50:43 -04:00
1 parent f330a3c00a
commit e5c6a2fc0e
199 files changed
+9866

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
Linux probes use fixed executable/argument pairs compiled in OperationRegistry.
No shell script is executed. Missing tools produce a separate missing-artifact
finding. Read-only probes: os-release, uname, dpkg-query, hostname, systemctl show,
ip address/route JSON, timedatectl show, resolv.conf, Yama runtime value.
No read-only probe installs, refreshes policy, starts a service or changes state.
+53
View File
@@ -0,0 +1,53 @@
{
"schema_version": 1,
"revision": 2,
"tasks": [
{
"id": "windows.discovery",
"path": "windows/discovery.ps1",
"sha256": "956ac1641eade610360c7f1417e75e916d46d8740cda81673d91e1050904ab24",
"purpose": "Read Windows edition/build/role, PS version and optional features",
"adapter_version": "0.1.0",
"state": "DOCUMENTED_NOT_TESTED",
"versions": [
"Windows 10 1809+",
"Server 2019",
"Server 2025"
],
"parameters": {},
"mutating": false,
"privilege": "Existing approved administrative SSH session; AD inventory requires RSAT ActiveDirectory",
"source_refs": [
"MS_OPENSSH"
],
"postcondition": "Validated structured JSON; every denied scope remains explicit",
"cancellation_class": "READ_ONLY_TERMINATE",
"recovery_class": "NONE",
"timeout_seconds": 120
},
{
"id": "ad.inventory",
"path": "windows/ad-inventory.ps1",
"sha256": "bc5cab0a1cb0e5a6e6b298ee9508fa833767767129ff4c97d078ce21534c69d5",
"purpose": "Bounded directory inventory from configured source DC",
"adapter_version": "0.1.0",
"state": "DOCUMENTED_NOT_TESTED",
"versions": [
"Windows Server 2019 AD DC: NOT_TESTED",
"Windows Server 2025 AD DC: NOT_TESTED"
],
"parameters": {},
"mutating": false,
"privilege": "Existing approved administrative SSH session; AD inventory requires RSAT ActiveDirectory",
"source_refs": [
"MS_OPENSSH",
"MS_AD_OBJECT",
"MS_AD_FOREST"
],
"postcondition": "Validated structured JSON; every denied scope remains explicit",
"cancellation_class": "READ_ONLY_TERMINATE",
"recovery_class": "NONE",
"timeout_seconds": 120
}
]
}
+44
View File
@@ -0,0 +1,44 @@
# Fixed read-only AD DC inventory; no credentials. See manifest and adapter contract.
$ErrorActionPreference = 'Stop'
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
Import-Module ActiveDirectory -ErrorAction Stop
$node = Get-CimInstance Win32_ComputerSystem
if ($node.DomainRole -lt 4) { throw 'Select the source AD domain controller.' }
$domain = Get-ADDomain -Server $node.Name
if ($domain.DNSRoot -ine 'corp.local') { throw 'Source domain must be corp.local.' }
$forest = Get-ADForest -Server $node.Name
$now = [DateTime]::UtcNow.ToString('o')
$source = $domain.ObjectGUID.ToString()
$objects = New-Object 'System.Collections.Generic.List[object]'
$truncated = $false
$allowed = @('objectSid','sAMAccountName','userPrincipalName','displayName','memberOf','groupType','userAccountControl','servicePrincipalName','gPLink','gPOptions')
Get-ADObject -Server $node.Name -LDAPFilter '(|(objectClass=user)(objectClass=group)(objectClass=organizationalUnit)(objectClass=groupPolicyContainer))' -SearchBase $domain.DistinguishedName -Properties $allowed -ResultSetSize 50001 | ForEach-Object {
if ($objects.Count -ge 50000) { $truncated = $true; return }
$item = $_
$sid = ''
if ($null -ne $item.objectSid) { $sid = [string]$item.objectSid }
$kind = [string]$item.ObjectClass
if ($kind -eq 'groupPolicyContainer') { $kind = 'gpo' }
if (@('user','group','organizationalUnit','computer','gpo') -notcontains $kind) { $kind = 'other' }
$attributes = @{}
foreach ($name in $allowed) {
if ($name -ne 'objectSid' -and $name -ne 'memberOf' -and $null -ne $item.$name) {
$attributes[$name] = @($item.$name | ForEach-Object { [string]$_ })
}
}
$objects.Add(@{
source_system_id = $source; object_guid = $item.ObjectGUID.ToString(); sid = $sid
dn = $item.DistinguishedName; object_type = $kind; attributes = $attributes
memberships = @($item.memberOf | ForEach-Object { [string]$_ }); observed_at = $now
})
}
@{
schema_version = 1; source_system_id = $source; source_domain = $domain.DNSRoot; synthetic = $false
scope = @{
description = ('Directory naming context: ' + $domain.DistinguishedName + '; forest mode: ' + $forest.ForestMode + '; domain mode: ' + $domain.DomainMode)
complete = $false
denied_or_unreachable = @('DNS/DHCP zone and lease content not collected','File data and ACLs not collected','GPO reports, SYSVOL and effective outcomes not collected','Service/application bindings and AD CS not collected','Password/profile continuity not evaluated',$(if ($truncated) { 'Object limit reached: partial inventory' } else { 'Directory ACL visibility must be verified by source owner' }))
categories = @('users','groups','ou','computers','gpo_links')
}
hosts = @(); objects = @($objects.ToArray())
} | ConvertTo-Json -Depth 16 -Compress
+34
View File
@@ -0,0 +1,34 @@
# ALD Transition Console / fixed read-only task / Windows PowerShell 5.1
# No PowerShell SSH subsystem, profile, background job or persistent task.
$ErrorActionPreference = 'Stop'
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
$errors = New-Object 'System.Collections.Generic.List[string]'
$os = Get-CimInstance -ClassName Win32_OperatingSystem
$computer = Get-CimInstance -ClassName Win32_ComputerSystem
$features = @()
try {
$features = @(Get-WindowsCapability -Online | Where-Object { $_.Name -like 'OpenSSH*' } | ForEach-Object {
@{ name = $_.Name; state = [string]$_.State }
})
} catch { $errors.Add('Optional-feature inventory unavailable: elevation or servicing prerequisite required.') }
$ssh = Get-Service -Name sshd -ErrorAction SilentlyContinue
$result = @{
schema_version = 1
task = 'windows.discovery'
observed_at = [DateTime]::UtcNow.ToString('o')
os_edition = $os.Caption
os_release = $os.Version
os_build = $os.BuildNumber
architecture = $os.OSArchitecture
domain_role = [int]$computer.DomainRole
part_of_domain = [bool]$computer.PartOfDomain
domain = $computer.Domain
name = $computer.Name
powershell_version = $PSVersionTable.PSVersion.ToString()
optional_features = $features
feature_inventory_complete = ($errors.Count -eq 0)
sshd_state = $(if ($null -eq $ssh) { 'NOT_INSTALLED' } else { [string]$ssh.Status })
errors = @($errors)
synthetic = $false
}
$result | ConvertTo-Json -Depth 8 -Compress