Error: "FATAL failed to list objects from S3: NoCredentialProviders: no valid providers in chain" when using the s3sns tool from Panther
Last updated: May 20, 2025
Issue
When trying to run my s3sns data replay in Panther, the following error occurs:
"FATAL failed to list objects from S3: NoCredentialProviders: no valid providers in chain"
Resolution
To resolve this error, provide the following ENV variables and re-run your replay:
export AWS_ACCESS_KEY_ID="ACCESS_KEY_ID"
export AWS_SECRET_ACCESS_KEY="SECRET_ACCESS_KEY"
export AWS_SESSION_TOKEN="SESSION_TOKEN"If you still encounter the same error, double-check that your AWS user has the following policies:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ListAccessPointsForObjectLambda",
"s3:GetAccessPoint",
"sns:GetTopicAttributes",
"s3:ListAccessPoints",
"s3:GetBucketLogging",
"sns:CreateTopic",
"sns:ListTopics",
"s3:ListBucket",
"sns:SetTopicAttributes",
"s3:GetBucketNotification",
"s3:PutObject",
"sns:GetEndpointAttributes",
"sns:Publish",
"s3:ListAllMyBuckets",
"s3:DescribeJob",
"s3:PutBucketPolicy",
"sns:Subscribe",
"s3:CreateJob",
"s3:PutAccessPointPolicy",
"s3:GetBucketLocation"
],
"Resource": "*"
}
]
}Cause
This issue occurs when you run the s3sns commands without defining the ENV variables, or your user does not have the necessary permissions.