AWS-SDK Auth problem on GuardDuty

0

I wrote a code with nodejs which uses createIntelSet method.

but It throws Error below: InternalServerErrorException: The request is rejected because the caller is not authorized to call this API.

I already added the 'AmazonGuardDutyFullAccess' policy to an account, but It's no use. any solutions for it? I maybe losing clue for the API auth...

gumtong
asked 10 months ago231 views
1 Answer
0
Accepted Answer

Hi, what you should probably do first is add a call to getCallerIdentity() . See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#getCallerIdentity-property

It will tell you under which security principal (IAM user or role) you make this GuardDuty request and then you check in this security principal has the credentials to this API that you want to call.

Hope it helps!

Didier

profile pictureAWS
EXPERT
answered 10 months ago
  • thank you, I wll try on this way.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions