Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metricbeat is unable to connect to AWS OpenSearch service. ERROR 401 Unauthorized #38118

Open
nagachinni opened this issue Feb 23, 2024 · 4 comments
Labels
needs_team Indicates that the issue/PR needs a Team:* label

Comments

@nagachinni
Copy link

Metricbeat running on EC2 is failing with error: unable to connect to AWS OpenSearch service. ERROR 401 Unauthorized
My openSearch domain enabled fine-grain access control(FGAC) with IAM role as master user.
I have the access policy attached to EC2 IAM role already and mapped the opensearch role "all_access" so it should reach the domain endpoint. However, this is not working.

To Reproduce
Create AWS OpenSearch domain and enable FGAC.
Create an EC2 instance and attach the IAM policy to allow access to opensearch domain created above.

"Effect": "Allow",
"Action": [
    "es:*"
 ],
 "Resource": [
     "<domainarn>"
]

Update opensearch domain access policy as below.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": [
        "es:*"
      ],
      "Resource": "<domain_arn>"
    }
  ]
}

Install metricbeat-oss7.12.1 on EC2 instance and configure to push metrics to opensearch domain endpoint.
You'll receive error as stated above when running metricbeat.

Expected behavior
Metricbeat should be able to push metrics to opensearch endpoint.

Additional Details
Host/Environment (please complete the following information):

OS: Windows

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 23, 2024
@botelastic
Copy link

botelastic bot commented Feb 23, 2024

This issue doesn't have a Team:<team> label.

@nagachinni
Copy link
Author

Does metricbeat support AWS Sigv4 authentication? If so can someone please help how to enable this in the config?

@nagachinni
Copy link
Author

Hello Guys, if someone could help me with this would be great.!!

@g-bohncke
Copy link

https://github.com/awslabs/aws-sigv4-proxy

A Temp way around the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

No branches or pull requests

2 participants