-
Notifications
You must be signed in to change notification settings - Fork 11
feat(security): add OBSERVE + BASH_HIGH coverage for outbound curl writes (#1280) #1302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,6 +189,33 @@ export const DESTRUCTIVE_PATTERNS: readonly DestructivePattern[] = [ | |
| tier: 'observe', | ||
| }, | ||
|
|
||
| // ── outbound HTTP writes (curl / wget) ───────────────────────────────────── | ||
| // | ||
| // Invariant: OBSERVE (not BLOCK) — curl writes are inner-loop for many agent | ||
| // workflows (posting to local dev servers, CI webhooks, self-hosted APIs). | ||
| // A hard block would generate unacceptable friction; OBSERVE records the event | ||
| // so audit logs capture outbound mutations without stopping the flow. | ||
| // | ||
| // Two patterns cover the common shapes: | ||
| // curl-write-method: explicit method override via -X (POST / PUT / PATCH / DELETE). | ||
| // curl-data-flag: body-payload flags (-d / --data / -F / --form) which imply | ||
| // a POST even when -X is omitted. | ||
| // | ||
| // wget --post-data is captured under curl-data-flag via a shared pattern that | ||
| // is checked after these two entries (see curl-data-flag regex). | ||
| // Regex uses [^|;&]* to stop at shell pipeline/compound boundaries so a piped | ||
| // command is not misattributed to the preceding curl invocation. | ||
| { | ||
| id: 'curl-write-method', | ||
| re: /\bcurl\b[^|;&]*\s-X\s+(POST|PUT|PATCH|DELETE)\b/i, | ||
| tier: 'observe', | ||
|
Comment on lines
+209
to
+211
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Normal sessions do not record Useful? React with 👍 / 👎. |
||
| }, | ||
| { | ||
| id: 'curl-data-flag', | ||
| re: /\bcurl\b[^|;&]*\s(-d\b|--data\b|-F\b|--form\b)|\bwget\b[^|;&]*\s(--post-data\b|--post-file\b)/i, | ||
| tier: 'observe', | ||
| }, | ||
|
|
||
| // ── infra / containers ─────────────────────────────────────────────────────── | ||
| // | ||
| // Invariant: docker-destructive and kubectl-delete stay OBSERVE because their | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In autonomous AFK sessions, these literal substrings only classify writes when the mutating flag immediately follows
curl; common valid commands such ascurl -H 'Content-Type: application/json' -X POST URL -d '{}'orcurl URL -X DELETEremainmedium, soafk-mode-gate.tsallows them without approval. The same gap affectscurl -Fandwget --post-file, which this commit explicitly recognizes as writes in the OBSERVE detector. Match curl/wget invocations and their write flags independently of option ordering rather than matching only these exact command prefixes.Useful? React with 👍 / 👎.