mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-24 07:01:49 +00:00
Security/Exec: persist inner commands for shell-wrapper approvals
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
evaluateShellAllowlist,
|
||||
recordAllowlistUse,
|
||||
requiresExecApproval,
|
||||
resolveAllowAlwaysPatterns,
|
||||
resolveExecApprovals,
|
||||
resolveSafeBins,
|
||||
type ExecAllowlistEntry,
|
||||
@@ -314,8 +315,13 @@ export async function handleSystemRunInvoke(opts: {
|
||||
}
|
||||
if (approvalDecision === "allow-always" && security === "allowlist") {
|
||||
if (analysisOk) {
|
||||
for (const segment of segments) {
|
||||
const pattern = segment.resolution?.resolvedPath ?? "";
|
||||
const patterns = resolveAllowAlwaysPatterns({
|
||||
segments,
|
||||
cwd: opts.params.cwd ?? undefined,
|
||||
env,
|
||||
platform: process.platform,
|
||||
});
|
||||
for (const pattern of patterns) {
|
||||
if (pattern) {
|
||||
addAllowlistEntry(approvals.file, agentId, pattern);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user