Analyzing Traffic of LLM API Calls in Amazon Bedrock

Amazon Bedrock is a fully managed and serverless service that provides access to a range of foundation models (FMs) from top AI companies such as Amazon, Anthropic, Cohere, Meta, AI21 Labs, Mistral AI, Stability AI etc. through a single API call. It enables the development of AI applications on Amazon's cloud computing platform Amazon Web Services (AWS).

Network Traffic Analysis

The ATI team in Keysight has analyzed the network traffic (decrypted) of Amazon Bedrock API calls and found some interesting insights, which can be helpful for other researchers.

When we call Amazon Bedrock’s “Converse” and “InvokeModel” APIs using AWS’s “boto3” library, it generally sends a POST request to the Amazon Bedrock endpoint which utilizes TLS 1.3 (by default) for encryption and HTTP/1.1 for communication.

Let's take a detailed look at the decrypted traffic:

Request Components:

Figure 1: Sample Amazon Bedrock API Request

  1. Request Line

When we call the Amazon Bedrock API, the POST request URL (request line) structure looks like below:

/model/<model name>/<api_name>

Table 1: List of LLMs available in Amazon Bedrock service

  1. Headers

The POST request contains the following headers:

  1. Payload

The POST request body/payload contains the prompt that the users want to send to the Bedrock API server in JSON format. It can be of two types:

For Converse API, the JSON body looks like below -

Figure 2: Sample Amazon Bedrock API Request Payload for Converse API Call

For InvokeModel API, the JSON body looks like below -

Figure 3: Sample Amazon Bedrock API Request Payload for InvokeModel API Call

Inside the HTTP Response:

After the successful authentication and processing of the API request, the Amazon Bedrock API server responds with a 200 Ok HTTP response which looks like below –

Figure 4: Sample 200 OK Response from Amazon Bedrock API Server

The HTTP response header includes the following fields –

The response also contains the answer of the user prompt in JSON format. It also can be of two types:

For Converse API call, the response data looks like below:

A screen shot of a computer program Description automatically generated

Figure 5: Sample Amazon Bedrock API Response Payload for Converse API Call

For InvokeModel API call, the response data looks like below:

Figure 6: Sample Amazon Bedrock API Response Payload for InvokeModel API Call

Amazon Bedrock LLM API Calls Traffic Simulation in Keysight ATI

At Keysight Technologies, our Application and Threat Intelligence (ATI) team, researchers have examined the traffic pattern of Amazon Bedrock API call for various LLMs and added their support in ATI-2024-22 and ATI-2024-23 StrikePacks released on November 05, 2024 and November 22, 2024 respectively.

We have added 1 new Application “Amazon Bedrock API Call” and 11 new Superflows for different LLMs till now as shown below -

A screenshot of a computer Description automatically generated

Figure 7: Amazon Bedrock API Call and its Superflows in BPS

Here, the traffic for all the Superflows is customizable which allows the user to choose their own values for Hostname, Content Type, User Agent, Accept-Encoding, AWS Region Name, Model ID, API Endpoint Name, X-Amz-Security-Token, Authorization, amz-sdk-invocation-id, User Prompt and Response Prompt during the BreakingPoint System (BPS) simulation as shown below –

A screenshot of a computer Description automatically generated

Figure 8: Anthropic Claude 3 Haiku API Call Superflow in BPS

Leverage Subscription Service to Stay Ahead of Attacks

Keysight's Application and Threat Intelligence subscription provides daily malware and bi-weekly updates of the latest application protocols and vulnerabilities for use with Keysight test platforms. The ATI Research Centre continuously monitors threats as they appear in the wild. Customers of BreakingPoint now have access to attack campaigns for different advanced persistent threats, allowing BreakingPoint Customers to test their currently deployed security control's ability to detect or block such attacks.

limit
3