
Summary
Detection rule for AWS Bedrock prompts that request shell execution, filesystem access, or process spawning. It analyzes Bedrock invocation logs (logs-aws_bedrock.invocation-*) and inspects gen_ai.prompt for high-risk patterns such as /bin/sh, /bin/bash, sh -c, cmd.exe, powershell, exec(, os.system, subprocess, python -c, curl, wget, /dev/tcp, nc -e, ncat, socat, openssl s_client, perl -e, ruby -e, php -r, node -e, base64 -d, or bash -i. When matched, the event is flagged with high severity (risk_score 73) under MITRE ATT&CK T1059 (Command and Scripting Interpreter) with Execution as the tactic. The rule returns fields including @timestamp, user.id, cloud.account.id, gen_ai.request.model.id, gen_ai.prompt, and gen_ai.completion for investigation. Investigations should validate whether the prompt pattern is expected by legitimate AI agent workflows, correlate with other Bedrock invocations, check model and application context, and search for downstream execution artifacts (Lambda, SSM, EC2). False positives include legitimate tools referenced in prompts by AI coding assistants or security tooling. Remediation includes narrowing the Bedrock agent toolset, applying guardrails, improving prompt validation, rotating credentials if compromised, and auditing Bedrock/downstream activity. Prerequisites include enabling model invocation logging (logs-aws_bedrock.invocation-*).
Categories
- Cloud
- Application
Data Sources
- Application Log
- Cloud Service
ATT&CK Techniques
- T1059
Created: 2026-07-27