Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/Netclaw.Actors.Tests/Tools/ShellApprovalCaseCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ public static class ShellApprovalCases
Approvals.PersistentAnywhere("pwsh", "Invoke-CustomAction", "Remove-Item"),
ExpectedApproval.Require([], isMessy: true, approvalChecks: 0)),
Case(
"pwsh-data-script-block-stays-strict",
Bash("pwsh -NoProfile -NonInteractive -Command 'Write-Output { Remove-Item victim.txt }'"),
"pwsh-corpus-418-data-script-block-stays-strict",
Bash("pwsh -NoProfile -NonInteractive -Command 'Write-Output { Remove-Item target.txt }'"),
Approvals.PersistentAnywhere("pwsh", "Write-Output", "Remove-Item"),
ExpectedApproval.Require([], isMessy: true, approvalChecks: 0)),
Case(
Expand Down Expand Up @@ -1050,6 +1050,22 @@ public static class ShellApprovalCases
Bash("deploy() { git push; }; deploy"),
Approvals.PersistentAnywhere("git push"),
ExpectedApproval.Require([], isMessy: true, approvalChecks: 0)),
Case(
"unknown-state-named-parameter-fails-closed",
Bash("printf '%s' \"$value\""),
Approvals.PersistentAnywhere("printf"),
ExpectedApproval.Require([], isMessy: true, approvalChecks: 0)),
Case(
"nameref-deferred-execution-fails-closed",
Bash("declare -a values; declare -n current='values[$(printf marker >&2)0]'; " +
"cat <<EOF\n${current}\nEOF"),
Approvals.PersistentAnywhere("declare", "printf", "cat"),
ExpectedApproval.Require([], isMessy: true, approvalChecks: 0)),
Case(
"source-builtin-payload-fails-closed",
Bash("source ./bootstrap.sh"),
Approvals.PersistentAnywhere("source"),
ExpectedApproval.Require([], isMessy: true, approvalChecks: 0)),
Case(
"exec-command-resolution-mutation-fails-closed",
Bash("exec git status"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
| pwsh-dynamic-child-fails-closed | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command 'git $operation' | persistent[anywhere]:pwsh, persistent[anywhere]:git | RequiresApproval | approval required | none | Yes |
| pwsh-command-resolution-mutation-fails-closed | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command 'Set-Alias git Remove-Item; git victim.txt' | persistent[anywhere]:pwsh, persistent[anywhere]:Set-Alias, persistent[anywhere]:git | RequiresApproval | approval required | none | Yes |
| pwsh-unknown-script-block-receiver-fails-closed | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command 'Invoke-CustomAction { Remove-Item victim.txt }' | persistent[anywhere]:pwsh, persistent[anywhere]:Invoke-CustomAction, persistent[anywhere]:Remove-Item | RequiresApproval | approval required | none | Yes |
| pwsh-data-script-block-stays-strict | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command 'Write-Output { Remove-Item victim.txt }' | persistent[anywhere]:pwsh, persistent[anywhere]:Write-Output, persistent[anywhere]:Remove-Item | RequiresApproval | approval required | none | Yes |
| pwsh-corpus-418-data-script-block-stays-strict | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command 'Write-Output { Remove-Item target.txt }' | persistent[anywhere]:pwsh, persistent[anywhere]:Write-Output, persistent[anywhere]:Remove-Item | RequiresApproval | approval required | none | Yes |
| pwsh-executable-script-block-prompts-for-body | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command '& { git push }' | persistent[anywhere]:pwsh | RequiresApproval | approval required | git push | No |
| pwsh-executable-script-block-hard-deny-wins | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command 'Invoke-Command { netclaw daemon stop }' | persistent[anywhere]:pwsh, persistent[anywhere]:Invoke-Command, persistent[anywhere]:netclaw daemon stop | Denied | hard_deny_self_destructive | none | Not applicable |
| pwsh-bash-decoding-cannot-hide-hard-deny | Personal | Project | Interactive | pwsh -NoProfile -NonInteractive -Command 'Write-Output '' ; netclaw daemon stop; #''' | persistent[anywhere]:pwsh, persistent[anywhere]:Write-Output, persistent[anywhere]:netclaw daemon stop | Denied | hard_deny_self_destructive | none | Not applicable |
Expand Down Expand Up @@ -167,6 +167,9 @@
| process-substitution-fails-closed | Personal | Project | Interactive | cat <(git push) | persistent[anywhere]:cat, persistent[anywhere]:git push | RequiresApproval | approval required | none | Yes |
| arithmetic-expansion-fails-closed | Personal | Project | Interactive | echo $((1 + 2)) | none | RequiresApproval | approval required | none | Yes |
| function-definition-fails-closed | Personal | Project | Interactive | deploy() { git push; }; deploy | persistent[anywhere]:git push | RequiresApproval | approval required | none | Yes |
| unknown-state-named-parameter-fails-closed | Personal | Project | Interactive | printf '%s' "$value" | persistent[anywhere]:printf | RequiresApproval | approval required | none | Yes |
| nameref-deferred-execution-fails-closed | Personal | Project | Interactive | declare -a values; declare -n current='values[$(printf marker >&2)0]'; cat <<EOF\n${current}\nEOF | persistent[anywhere]:declare, persistent[anywhere]:printf, persistent[anywhere]:cat | RequiresApproval | approval required | none | Yes |
| source-builtin-payload-fails-closed | Personal | Project | Interactive | source ./bootstrap.sh | persistent[anywhere]:source | RequiresApproval | approval required | none | Yes |
| exec-command-resolution-mutation-fails-closed | Personal | Project | Interactive | exec git status | persistent[anywhere]:exec, persistent[anywhere]:git status | RequiresApproval | approval required | none | Yes |
| hash-command-resolution-mutation-fails-closed | Personal | Project | Interactive | hash -p /usr/bin/git git && git status | persistent[anywhere]:hash, persistent[anywhere]:git status | RequiresApproval | approval required | none | Yes |
| alias-command-resolution-mutation-fails-closed | Personal | Project | Interactive | alias inspect='git status'; inspect | persistent[anywhere]:alias, persistent[anywhere]:inspect, persistent[anywhere]:git status | RequiresApproval | approval required | none | Yes |
Expand Down
Loading