Initial OfficeCom Sentinel client and deployment assets

This commit is contained in:
OfficeCom Codex
2026-07-17 00:39:28 +02:00
commit 7cdc0395c4
58 changed files with 6199 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
param(
[Parameter(Mandatory)]
[string]$SecretValue,
[string]$OutputPath = "C:\ProgramData\OCSentinel\secrets\ocsentinel-upload-secret.dat"
)
$ErrorActionPreference = "Stop"
Add-Type -AssemblyName System.Security
$outputFullPath = [System.IO.Path]::GetFullPath($OutputPath)
$outputDirectory = Split-Path -Parent $outputFullPath
if (-not [string]::IsNullOrWhiteSpace($outputDirectory)) {
New-Item -ItemType Directory -Force -Path $outputDirectory | Out-Null
}
$secretBytes = [System.Text.Encoding]::UTF8.GetBytes($SecretValue)
$protectedBytes = [System.Security.Cryptography.ProtectedData]::Protect(
$secretBytes,
$null,
[System.Security.Cryptography.DataProtectionScope]::LocalMachine
)
[System.IO.File]::WriteAllBytes($outputFullPath, $protectedBytes)
Write-Host "Protected secret written to $outputFullPath"