SQS queue policy allows all actions on the resource Affecting SQS service in AWS


Severity

0.0
high
0
10
Severity Framework
Snyk CCSS
Rule category
General/ Best Practices

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-ControlsCSA-CCMISO-27001SOC-2
  • Snyk IDSNYK-CC-00322
  • creditSnyk Research Team

Description

Using the wildcard action in an SQS policy grants permission to perform any action, which is against 'least privilege' principle.

How to fix?

Ensure that the Action field in the policy heredoc is set to specific actions, for examplesqs:SendMessage.

Example Configuration

resource "aws_sqs_queue_policy" "q" {
  policy = <<POLICY
{
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "sqs:SendMessage",
      # other required fields here
    }
  ]
}
POLICY
}

CloudFormation