elastic / elastic/integrations
[aws_bedrock_agentcore] ECS GenAI Field Support for detections
- Dominant language
- Handlebars
- Stars
- 333
- Forks
- 647
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 209
Description
**Related issues:**
- https://github.com/elastic/integrations/issues/20737
- https://github.com/elastic/integrations/issues/20738
TRaDE is requesting that the following fields be added to this integration for security detections.
The `aws_bedrock_agentcore` package has two relevant data streams: `runtime_application_logs` (agent invocations) and `gateway_application_logs` (tool/gateway invocations). Unlike `aws_bedrock`, agentcore logs operate at the agent orchestration layer — they do not expose model-level fields (model name, token counts, temperature, etc.) since those live in the underlying Bedrock invocation logs.
## `runtime_application_logs` — Requested fields
| Field | Availability | Status |
|---|---|---|
| `gen_ai.provider.name` | ✅ Pipeline sets `"aws_bedrock_agentcore"` | ⚠️ Incorrect mapping — stored only in `aws.bedrock_agentcore.provider_name`; ECS `gen_ai.provider.name` never set |
| `gen_ai.operation.name` | ✅ Pipeline sets `"invoke_agent"` | ⚠️ Incorrect mapping — stored only in `aws.bedrock_agentcore.operation_name`; ECS `gen_ai.operation.name` never set |
| `gen_ai.conversation.id` | ✅ Available via `session_id` in source logs | ⚠️ Incorrect mapping — stored only in `aws.bedrock_agentcore.conversation_id`; ECS `gen_ai.conversation.id` never set |
| `gen_ai.agent.name` | ✅ Parsed from `resource.attributes["service.name"]` (e.g. `customersupport.DEFAULT` → `customersupport`) | ⚠️ Incorrect mapping — stored only in `aws.bedrock_agentcore.agent_name`; ECS `gen_ai.agent.name` never set |
| `gen_ai.input.messages` | ✅ Available in `body.request_payload.prompt` (string or object) | ❌ Not implemented — raw prompt stored in `aws.bedrock_agentcore.request_payload.prompt`; ECS `gen_ai.input.messages` structured array not populated |
| `gen_ai.output.messages` | ✅ Available in `body.response_payload` object | ❌ Not implemented — ECS `gen_ai.output.messages` not populated |
## `gateway_application_logs` — Requested fields
| Field | Availability | Status |
|---|---|---|
| `gen_ai.provider.name` | ✅ Pipeline sets `"aws_bedrock_agentcore"` | ⚠️ Incorrect mapping — stored only in `aws.bedrock_agentcore.gateway.provider_name`; ECS `gen_ai.provider.name` never set |
| `gen_ai.operation.name` | ✅ Pipeline sets `"invoke_gateway"` | ⚠️ Incorrect mapping — stored only in `aws.bedrock_agentcore.gateway.operation_name`; ECS `gen_ai.operation.name` never set |
| `gen_ai.tool.name` | ✅ Parsed via grok from log message (e.g. `"Processing request for tool DocumentRetrieval___fetch_order_details from target XYZPROD001"`) | ⚠️ Incorrect mapping — stored only in `aws.bedrock_agentcore.gateway.tool.name`; ECS `gen_ai.tool.name` never set |
| `gen_ai.tool.type` | ⚠️ Inferable as `"function"` for all gateway tool invocations | ❌ Not implemented |
## Not applicable to agentcore (verify on development)
| Field | Reason |
|---|---|
| `gen_ai.request.model` / `gen_ai.response.model` | Not present in agentcore logs — model invocation detail lives in `aws_bedrock` invocation logs |
| `gen_ai.usage.input_tokens` / `gen_ai.usage.output_tokens` | Not present in agentcore logs |
| `gen_ai.request.max_tokens`, `gen_ai.request.temperature`, `gen_ai.request.top_p`, `gen_ai.request.top_k` | Not present in agentcore logs |
| `gen_ai.response.finish_reasons` | Not present in agentcore logs |
| `gen_ai.response.id` | Not present in agentcore logs |
| `gen_ai.request.seed` | Not applicable |
| `gen_ai.token.type` | Not applicable |
| `gen_ai.system_instructions` | Not present in agentcore logs |
| `gen_ai.tool.call.id`, `gen_ai.tool.call.arguments`, `gen_ai.tool.call.result`, `gen_ai.tool.definitions` | Not present in standard agentcore gateway logs |
## Summary of changes needed
### Both data streams
- Add ECS `gen_ai.provider.name` field definition and pipeline processor to copy from the existing integration-specific field
- Add ECS `gen_ai.operation.name` field definition and pipeline processor to copy from the existing integration-specific field
### `runtime_application_logs`
- Add ECS `gen_ai.conversation.id` field definition and pipeline processor to copy from `aws.bedrock_agentcore.conversation_id`
- Add ECS `gen_ai.agent.name` field definition and pipeline processor to copy from `aws.bedrock_agentcore.agent_name`
- Add ECS `gen_ai.input.messages` field definition and pipeline processor to normalize `body.request_payload.prompt` into a structured array (handling both string and object variants)
- Add ECS `gen_ai.output.messages` field definition and pipeline processor to normalize `body.response_payload` into a structured array
### `gateway_application_logs`
- Add ECS `gen_ai.tool.name` field definition and pipeline processor to copy from `aws.bedrock_agentcore.gateway.tool.name`
- Add ECS `gen_ai.tool.type` field definition and set to `"function"` when a tool name is present
Contributor guide
Research direction
Start by inspecting the aws_bedrock_agentcore runtime_application_logs and gateway_application_logs entry points, including their existing integration-specific fields and pipelines. Verify the available source values, then add the requested ECS mappings and normalized message fields; done means both streams expose the applicable gen_ai fields while unsupported model and token fields remain absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100