feat(electron): add autonomous Electron runtime analysis (#464)
* feat: add autonomous Electron runtime analysis * feat(electron): add lifecycle and boundary telemetry * feat(electron): capture runtime boundary evidence * fix(electron): package boundary hook helper * feat(electron): report active capture coverage * fix(electron): account for bring-your-own runtime * feat(electron): expand agent-owned runtime scenarios * fix(ghidra): keep fixture credentials out of argv * perf(test): serialize local test and docs workloads * fix(electron): harden active runtime capture * fix(inspector): require exact runtime target authorization * fix(docs): make managed manifest host independent * fix(ci): make generated catalog portable * fix: unblock autonomous command and electron flows * fix(electron): close popup and detached helper gaps
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
import type { AppConfig } from "../config.js";
|
||||
import type { AnalysisProfileCommitment } from "../domain/analysisProfile.js";
|
||||
import type { BinaryTarget } from "../domain/binaryTarget.js";
|
||||
import { jsonObjectSchema } from "../domain/jsonValue.js";
|
||||
import {
|
||||
AnalysisCancelledError,
|
||||
AnalysisCapabilityUnavailableError,
|
||||
@@ -61,6 +62,11 @@ import {
|
||||
windowsP0Limitations,
|
||||
limitationsFor,
|
||||
} from "./GhidraProviderCapabilities.js";
|
||||
import {
|
||||
WINDOWS_NATIVE_AUTHORITY_UNAVAILABLE_REASON,
|
||||
hasWindowsNativeAuthority,
|
||||
windowsNativeCapabilities,
|
||||
} from "../process/WindowsAuthority.js";
|
||||
|
||||
export { GHIDRA_PROVIDER_IDENTITY, GHIDRA_PROVIDER_TOOL_CONTRACTS };
|
||||
|
||||
@@ -98,6 +104,22 @@ export class GhidraProvider implements AnalysisProviderCandidate {
|
||||
inspectAvailability(): ProviderAvailability {
|
||||
const installation = this.#inspectInstallation();
|
||||
const diagnostics = ghidraInstallationDiagnostics(installation);
|
||||
if (
|
||||
installation.available &&
|
||||
installation.platform === "win32" &&
|
||||
!hasWindowsNativeAuthority(installation.platform)
|
||||
)
|
||||
return {
|
||||
status: "unavailable",
|
||||
code: "unsupported_host",
|
||||
reason: WINDOWS_NATIVE_AUTHORITY_UNAVAILABLE_REASON,
|
||||
diagnostics: {
|
||||
...diagnostics,
|
||||
windows_security: jsonObjectSchema.parse(
|
||||
windowsNativeCapabilities(installation.platform),
|
||||
),
|
||||
},
|
||||
};
|
||||
return installation.available
|
||||
? {
|
||||
status: "available",
|
||||
@@ -362,6 +384,17 @@ const ghidraClientPrerequisites = (
|
||||
diagnostics: ghidraInstallationDiagnostics(installation),
|
||||
}),
|
||||
);
|
||||
if (
|
||||
installation.platform === "win32" &&
|
||||
!hasWindowsNativeAuthority(installation.platform)
|
||||
)
|
||||
return err(
|
||||
new AnalysisCapabilityUnavailableError(
|
||||
"ghidra",
|
||||
"health",
|
||||
WINDOWS_NATIVE_AUTHORITY_UNAVAILABLE_REASON,
|
||||
),
|
||||
);
|
||||
if (profile === undefined || profile.provider.id !== "ghidra")
|
||||
return err(new ProviderAdapterError("ghidra", "health"));
|
||||
return ok({
|
||||
|
||||
@@ -2,6 +2,7 @@ import type {
|
||||
CapabilityDescriptor,
|
||||
ProviderIdentity,
|
||||
} from "../application/AnalysisProvider.js";
|
||||
import { WINDOWS_NATIVE_AUTHORITY_UNAVAILABLE_REASON } from "../process/WindowsAuthority.js";
|
||||
import { GENERATED_MCP_TOOL_CATALOG } from "../generatedMcpToolCatalog.js";
|
||||
import {
|
||||
GHIDRA_DECOMPILE_REQUEST_TIMEOUT_MS,
|
||||
@@ -67,7 +68,7 @@ export const healthLimitations = Object.freeze([
|
||||
export const windowsP0Limitations = Object.freeze([
|
||||
"Windows Ghidra P0 accepts approved native x86-64 PE applications only; DLL, managed, hostile, sensitive, and mutable-path targets are unsupported.",
|
||||
"The Windows bridge uses authenticated IPv4 loopback because Node path-based IPC does not expose Java AF_UNIX sockets; the endpoint file contains no bearer token.",
|
||||
"Windows P0 process-tree cleanup uses bounded taskkill termination and does not claim Job Object ownership, private DACL enforcement, or reparse-point-safe path authority.",
|
||||
"Windows P0 is not admitted until a native authority proves Job Object ownership, private DACL enforcement, and reparse-safe path admission; bounded taskkill cleanup and chmod(0700) do not prove those controls.",
|
||||
]);
|
||||
|
||||
/** Limitation text for one admitted operation, including the common base. */
|
||||
@@ -207,6 +208,9 @@ export const WINDOWS_P0_CAPABILITIES: readonly CapabilityDescriptor[] =
|
||||
CAPABILITIES.map((capability) =>
|
||||
Object.freeze({
|
||||
...capability,
|
||||
available: false,
|
||||
reason: WINDOWS_NATIVE_AUTHORITY_UNAVAILABLE_REASON,
|
||||
availabilityCode: "unsupported_host" as const,
|
||||
limitations: Object.freeze([
|
||||
...capability.limitations,
|
||||
...windowsP0Limitations,
|
||||
|
||||
Reference in New Issue
Block a user