Plan device actions exclusively as approved scripts and provide reboot library revisions
This commit is contained in:
+2
-3
@@ -1,4 +1,4 @@
|
||||
import { Action, PlanInput, RecordValue, Session, planTargetPreviews, record, text, validateSystemService, validateWindowsReboot, windowsScriptProfile, logWindow, validateWindowsLogLimits, windowsEventLogFixtureSource, windowsEventLogFixtureChannel, windowsEventLogFixtureProvider, WindowsMsiManifest, MsiPostcondition, windowsMsi, windowsMsiManifest, windowsMsiAction, validateWindowsMsiInput, validateWindowsMsiLimits, msiUuid, fullMaintenanceScriptProfile, privilegedScriptProfile, validateScriptIdentityProfile } from './api';
|
||||
import { PlanInput, RecordValue, Session, planTargetPreviews, record, text, validateSystemService, validateWindowsReboot, windowsScriptProfile, logWindow, validateWindowsLogLimits, windowsEventLogFixtureSource, windowsEventLogFixtureChannel, windowsEventLogFixtureProvider, WindowsMsiManifest, MsiPostcondition, windowsMsi, windowsMsiManifest, windowsMsiAction, validateWindowsMsiInput, validateWindowsMsiLimits, msiUuid, fullMaintenanceScriptProfile, privilegedScriptProfile, validateScriptIdentityProfile } from './api';
|
||||
import { validateAgentUpdateAction } from './agent-updates';
|
||||
|
||||
import { bytes, hashPattern, parseStrictJson, sha256 } from './plan-bytes';
|
||||
@@ -6,10 +6,9 @@ import { verifyScriptPlan } from './script-console';
|
||||
export { bytes, hashPattern, parseStrictJson, sha256 } from './plan-bytes';
|
||||
export const rootWarning = 'HOHES RISIKO: root kann das Zielsystem verändern. Keine automatische Rechteerhöhung; eigener expliziter Plan, Scope, Helper und Genehmigung erforderlich.';
|
||||
export const systemWarning = 'SYSTEM: ausschließlich fest benannter Windows-Fixturedienst (running/stopped) oder eigenes festes MSI-Rezept. Eigenes system:execute, unabhängiger Helper und konkrete WebUI-Genehmigung erforderlich. Keine SYSTEM-Shell, kein impliziter Reboot oder Retry.';
|
||||
export const fullMaintenanceWarning = 'VOLLE HOSTWARTUNG · full_maintenance_v1: Das genehmigte Skript läuft als root/SYSTEM mit vollständiger Hostautorität, einschließlich Netzwerk, Dateisystem und Diensten. Es kann auch Agent, PKI und Schutzmechanismen ändern oder einen Neustart auslösen. Keine Sandbox- oder No-Reboot-Zusage. scripts:execute plus root:execute/system:execute, lokaler und zentraler Opt-in, passende Capability, unabhängiger Helper und konkrete WebUI-Genehmigung bleiben erforderlich.';
|
||||
export const adminScriptWarning = 'Das Skript erhält volle Administratorrechte. Es kann Dateien, Dienste, den Agenten und Gerätezertifikate ändern sowie das Gerät neu starten.';
|
||||
export function permissions(auth: Session): string[] | null { return auth.permissions ?? null; }
|
||||
export function allowed(auth: Session, permission: string): boolean { return permissions(auth)?.includes(permission) === true; }
|
||||
export function availableActions(auth: Session, base: readonly Action[]): Action[] { return base.filter(a => a !== 'apt_native_acceptance' || auth.principal.simulated === true); }
|
||||
|
||||
function exact(r: RecordValue, fields: string[]) { if (Object.keys(r).some(k => !fields.includes(k)) || fields.some(k => !(k in r))) throw new Error('Schemafelder fehlen oder sind unbekannt'); }
|
||||
function hash(v: unknown) { if (typeof v !== 'string' || !hashPattern.test(v) || /^0{64}$/.test(v)) throw new Error('Exakter SHA-256 fehlt/Platzhalter'); }
|
||||
|
||||
Reference in New Issue
Block a user