Skip to content

[BUG] Unable to use the attached EC2 Instance Role to authenticate to Amazon-Bedrock #58

Description

@csmcguire

Description

Based on the docs here Cyberstrike IAM Role (EC2/ECS/Lambda), it would be expected that using the example config file would allow Cyberstrike to directly leverage the attached EC2 instance iam role (assuming it has the correct AWS permissions).
However when adding the config file per the docs (and after an edit to match expected provider correctly), an error asking for API credentials appears.

Error: AWS SigV4 authentication requires AWS credentials. Please provide either:

  1. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables
  2. Provide accessKeyId and secretAccessKey in options
  3. Use a credentialProvider function
  4. Use API key authentication with AWS_BEARER_TOKEN_BEDROCK or apiKey option
    Original error: AWS access key ID setting is missing. Pass it using the 'accessKeyId' parameter or the AWS_ACCESS_KEY_ID environment variable.
Image

Steps to reproduce

  1. Spin up AWS EC2 Instance (IAM Role attached with appropriate Bedrock permissions).
  2. Remotely access EC2 via ssh.
  3. Install Cyberstrike using the curl command from here curl -fsSL https://docs.cyberstrike.io/install.sh | sh
  4. Create config file in ~/.config/cyberstrike/config.json (location was chosen based on based on the instructions here.
{
  "provider": {    "bedrock": {
      "options": {
        "region": "us-east-1"
      }
    }
  }
}
  1. Replace "bedrock" with "amazon-bedrock" in the config file under the provider block. Skipping this step makes the selected provider unrecognizable. Also update region as needed.
{
  "provider": {
    "amazon-bedrock": {
      "options": {
        "region": "us-east-1"
      }
    }
  }
}
  1. Run cyberstrike (check path or installation directory for bin).
  2. Attempt to send a prompt, and error message appears.

Agent

No response

Interface

CLI / TUI

LLM Provider

Amazon Bedrock

CyberStrike version

1.1.15

Operating System

Amazon Linux 2023

Terminal

bash

Logs / Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions