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

IAM policy sample missing required Actions in documentation #32

Closed
rrix opened this issue Feb 2, 2017 · 1 comment · Fixed by #44
Closed

IAM policy sample missing required Actions in documentation #32

rrix opened this issue Feb 2, 2017 · 1 comment · Fixed by #44

Comments

@rrix
Copy link

rrix commented Feb 2, 2017

  • Version: current
  • Operating System:n/a

The documentation for both the sqs input and output plugins provide a sample IAM policy document which is missing Action keys listed directly above it in the docs:

The "consumer" identity must have the following permissions on the queue:
sqs:ChangeMessageVisibility
sqs:ChangeMessageVisibilityBatch
sqs:DeleteMessage
sqs:DeleteMessageBatch
sqs:GetQueueAttributes
sqs:GetQueueUrl
sqs:ListQueues
sqs:ReceiveMessage

yet the sample policy is missing DeleteMessage and DeleteMessageBatch:

{
  "Statement": [
    {
      "Action": [
        "sqs:ChangeMessageVisibility",
        "sqs:ChangeMessageVisibilityBatch",
        "sqs:GetQueueAttributes",
        "sqs:GetQueueUrl",
        "sqs:ListQueues",
        "sqs:SendMessage",
        "sqs:SendMessageBatch"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:sqs:us-east-1:123456789012:Logstash"
      ]
    }
  ]
}

There is a similar issue in the output plugin which I will open seperately, and imo an issue with the error handling of AccessDenied errors, since logstash doesnt log which action is attempting to be done, and Cloudtrail doesnt log SQS API calls.

Feb 02 18:27:11 ip-10-202-5-90 logstash[410]: {:timestamp=>"2017-02-02T18:27:11.273000+0000", :message=>"Aws::SQS::Errors::ServiceError ... retrying SQS request with exponential backoff", :queue=>"logstash_logs_us-west-1_staging_logstash-test-emitter", :sleep_time=>1, :error=>#<Aws::SQS::Errors::AccessDenied: Access to the resource https://sqs.us-west-1.amazonaws.com/[REDACTED]/logstash_logs_us-west-1_staging_logstash-test-emitter is denied.>, :level=>:warn}
@rrix
Copy link
Author

rrix commented Feb 2, 2017

Hrm, I was mistaken about the output plugin, the documentation matches there. However, I still think the error handling in bad IAM case could use improvement judging by logstash-plugins/logstash-output-sqs#17

nhumphreys added a commit to nhumphreys/logstash-input-sqs that referenced this issue Nov 16, 2017
guyboertje pushed a commit that referenced this issue Feb 9, 2018
Corrected sample IAM policy to match to match the documentation.

Fixes #32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant