Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,11 @@ Please follow the instructions before upgrading Cumulus
`producerGranuleId`.
- Users must ensure that `cumulus-tf` includes `cnm_response_version = "3.2.0"` or greater.

### Changes

- **CUMULUS-4416**
- sqs permissions granted to "\*" instead of "\<account\>/\*"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include (either in PR or here) justification for the change


### Added

- **CUMULUS-4059**
Expand Down
20 changes: 7 additions & 13 deletions tf-modules/cumulus/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ data "aws_iam_policy_document" "lambda_processing_policy" {
"states:SendTaskFailure",
"states:SendTaskSuccess",
"states:StartExecution",
"states:StopExecution"
"states:StopExecution",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider carefully if we want expanding the '*' resource. Generally we should be working to reduce wide-open perms as much as possible to reduce potential blast-radius.

Is there a sane way to limit scope/configure this, particularly with an eye to production?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is two fold:
#1 I would need to know the account ID in this place in order to update this permission to point at the "correct" sqs queue
#2 I would need to know the sqs queue itself. I can't point it at a queue named the same, because one queue can't point at multiple lambda functions. I need to create a new sqs queue in the daac legacy environment which ingest can be switched over to, and I need to somehow know that here

a big part of all of this is how we play well with cirrus, and this part is making me regret dealing with cirrus as it puts all of that configuration somewhere else.

"sqs:SendMessage",
"sqs:ReceiveMessage",
"sqs:ChangeMessageVisibility",
"sqs:DeleteMessage",
"sqs:GetQueueUrl",
"sqs:GetQueueAttributes",
]
resources = ["*"]
}
Expand Down Expand Up @@ -125,18 +131,6 @@ data "aws_iam_policy_document" "lambda_processing_policy" {

}

statement {
actions = [
"sqs:SendMessage",
"sqs:ReceiveMessage",
"sqs:ChangeMessageVisibility",
"sqs:DeleteMessage",
"sqs:GetQueueUrl",
"sqs:GetQueueAttributes",
]
resources = ["arn:aws:sqs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:*"]
}

statement {
actions = ["kms:Decrypt"]
resources = [module.archive.provider_kms_key_arn]
Expand Down