Skip to content

feat: Allow removing KMS and SSM permissions from EKS IRSA external secrets policy #550

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

Conversation

brycelowe
Copy link
Contributor

@brycelowe brycelowe commented Feb 10, 2025

Description

I'd like the option to remove access to KMS and SSM permissions on my IRSA roles while still providing the ability to use this module with the default encryption key provided by AWS. When I attempt to provide an empty list, the IAM policy is invalid because a resource definition is required.

Error: updating IAM Policy (arn:aws:iam:::policy/role-External_Secrets_Policy-20190815225516998100000001): MalformedPolicyDocument: Policy statement must contain resources.
	status code: 400, request id: <id>

Motivation and Context

Most of the secrets in my environment have been created with the default encryption key, so they don't need any special access to KMS or SSM. When attempting to remove this permission I ran into an error applying the configuration because the policy document was malformed.

Resolves #557

Breaking Changes

No, this is not a breaking change as the existing default remains intact.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@brycelowe brycelowe changed the title fix: resource error without kms or ssm arns fix: Resource error without kms or ssm arns Feb 10, 2025
@brycelowe brycelowe changed the title fix: Resource error without kms or ssm arns fix: MalformedPolicyDocument error without kms or ssm arns Feb 10, 2025
@brycelowe brycelowe marked this pull request as ready for review February 10, 2025 21:57
Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Mar 13, 2025
@brycelowe brycelowe force-pushed the bjl/fix/resource-error-without-kms-arns branch from be40269 to 549ea31 Compare March 13, 2025 00:22
@github-actions github-actions bot removed the stale label Mar 14, 2025
@brycelowe
Copy link
Contributor Author

Proposed fix for #557

Copy link

@rc-adammikolajczyk rc-adammikolajczyk left a comment

Choose a reason for hiding this comment

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

Just ran into this issue myself earlier today, this fix would be most welcome to see implemented! Thanks for your efforts!

I'd like the option to remove access to KMS and SSM permissions on my IRSA roles while still providing the ability to use this module with the default encryption key provided by AWS.  When I attempt to provide an empty list, the IAM policy is invalid because a resource definition is required.
@brycelowe brycelowe force-pushed the bjl/fix/resource-error-without-kms-arns branch from 549ea31 to 82eab62 Compare April 14, 2025 18:01
@bryantbiggs bryantbiggs changed the title fix: MalformedPolicyDocument error without kms or ssm arns feat: Allow removing KMS and SSM permissions from EKS IRSA external secrets policy Apr 14, 2025
@bryantbiggs bryantbiggs merged commit bfaa70d into terraform-aws-modules:master Apr 14, 2025
36 checks passed
antonbabenko pushed a commit that referenced this pull request Apr 14, 2025
## [5.55.0](v5.54.1...v5.55.0) (2025-04-14)

### Features

* Allow removing KMS and SSM permissions from EKS IRSA external secrets policy ([#550](#550)) ([bfaa70d](bfaa70d))
@antonbabenko
Copy link
Member

This PR is included in version 5.55.0 🎉

@brycelowe brycelowe deleted the bjl/fix/resource-error-without-kms-arns branch April 15, 2025 03:31
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 this pull request may close these issues.

Unable to remove KMS actions from External Secrets Policy
4 participants