Credential Access (TA0006)(external, opens in a new tab or window)
text code block:from logs-aws_bedrock.invocation-* metadata _id, _version, _index | where event.action in ("ConverseStream", "Converse") AND ( gen_ai.prompt rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*""" or gen_ai.completion rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*""" or gen_ai.prompt rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*""" or gen_ai.completion rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*""" or gen_ai.prompt rlike """.*ABSK[A-Za-z0-9+/=]{20}.*""" or gen_ai.completion rlike """.*ABSK[A-Za-z0-9+/=]{20}.*""" or gen_ai.prompt rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*""" or gen_ai.completion rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*""" or gen_ai.prompt rlike """.*github_pat_[A-Za-z0-9_]+.*""" or gen_ai.completion rlike """.*github_pat_[A-Za-z0-9_]+.*""" or gen_ai.prompt rlike """.*glpat-[A-Za-z0-9_\\-]+.*""" or gen_ai.completion rlike """.*glpat-[A-Za-z0-9_\\-]+.*""") | keep _id, _version, _index, @timestamp, gen_ai.*, aws_bedrock.*, user.*, cloud.*, event.*
Install detection rules in Elastic Security
Detect AWS Bedrock Model Prompt or Completion Containing Credentials in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).