Add a `retain` block to privacy_policy.json (all on by default) so assessments show software, services, processes, tasks, shares/mounts and private peer IPs. Values pass an identifier-pattern filter (digit runs, SSN/phone, e-mail, charset, length, path depth). Accounts, command lines, child paths, filenames and public peer IPs stay omitted. Linux collector and Windows PowerShell collectors updated; tests cover retention, withholding and all-switches-off. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
31 lines
1.9 KiB
PowerShell
31 lines
1.9 KiB
PowerShell
function Get-SamsaraStorage {
|
|
param($Result)
|
|
Invoke-SamsaraRead $Result 'Fixed local disk metadata' {
|
|
$index = 0
|
|
$Result.data = @(Get-CimInstance -ClassName Win32_LogicalDisk -Filter 'DriveType = 3' -Property DeviceID,Size,FreeSpace,FileSystem -ErrorAction Stop | ForEach-Object {
|
|
$index++
|
|
[pscustomobject]@{ type = 'Volume'; name = $(if (Test-SamsaraRetain 'storage_names_and_roots' ([string]$_.DeviceID)) { [string]$_.DeviceID } else { 'Volume-' + $index })
|
|
path = Get-SamsaraApprovedRoot (([string]$_.DeviceID) + '\')
|
|
filesystem = [string]$_.FileSystem; capacity_gib = [math]::Round(([double]$_.Size / 1GB), 2)
|
|
free_gib = [math]::Round(([double]$_.FreeSpace / 1GB), 2) }
|
|
})
|
|
}
|
|
$Result.status = 'partial'
|
|
$Result.limitations += 'Fixed drive-letter disks only; labels and child paths not read. Mount-only volumes and external storage dependencies need review.'
|
|
}
|
|
|
|
function Get-SamsaraShares {
|
|
param($Result)
|
|
Invoke-SamsaraRead $Result 'Configured SMB share roots' {
|
|
$index = 0
|
|
$Result.data = @(Get-SmbShare -ErrorAction Stop | ForEach-Object {
|
|
$index++
|
|
$name = if ([string]$_.Name -match '^(ADMIN|IPC|[A-Z])\$$') { ([string]$_.Name).ToUpperInvariant() } elseif (Test-SamsaraRetain 'storage_names_and_roots' ([string]$_.Name)) { [string]$_.Name } else { 'Share-' + $index }
|
|
[pscustomobject]@{ type = 'SMB Share'; name = $name; path = Get-SamsaraApprovedRoot ([string]$_.Path)
|
|
capacity_gib = $null; free_gib = $null; special = [bool]$_.Special }
|
|
})
|
|
}
|
|
$Result.status = 'partial'
|
|
$Result.limitations += 'Configured roots only; exact approved local roots may be retained. No file enumeration, open-file activity, filenames, child paths, sessions or client identities are queried. Active share consumers remain unverified.'
|
|
}
|