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

feat: Add back in CloudWatch log group create deny policy to cluster IAM role #1974

Merged

Conversation

bryantbiggs
Copy link
Member

@bryantbiggs bryantbiggs commented Mar 29, 2022

Description

  • Add back in CloudWatch log group create deny policy to cluster IAM role. A note has been added and reference to original issue to better explain the issue that is being solved

Motivation and Context

Breaking Changes

  • No; to users the change will be functionally transparent but will show up in the next subsequent plan (if their use case creates an IAM role and CloudWatch log group)

How Has This Been Tested?

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

@bryantbiggs bryantbiggs marked this pull request as ready for review March 30, 2022 12:00
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

Cool solution!

@antonbabenko antonbabenko merged commit 98e137f into terraform-aws-modules:master Mar 30, 2022
antonbabenko pushed a commit that referenced this pull request Mar 30, 2022
## [18.17.0](v18.16.0...v18.17.0) (2022-03-30)

### Features

* Add back in CloudWatch log group create deny policy to cluster IAM role ([#1974](#1974)) ([98e137f](98e137f))
@antonbabenko
Copy link
Member

This PR is included in version 18.17.0 🎉

@bryantbiggs bryantbiggs deleted the feat/cloudwatch-log-deny branch March 30, 2022 12:59
@james-callahan
Copy link

For some reason terraform keeps showing this field as wanting to change; even after applying

  # module.eks.aws_iam_role.this[0] will be updated in-place
  ~ resource "aws_iam_role" "this" {
        # (13 unchanged attributes hidden)

      - inline_policy {}
      + inline_policy {
          + name   = "my-cluster"
          + policy = jsonencode(
                {
                  + Statement = [
                      + {
                          + Action   = [
                              + "logs:CreateLogGroup",
                            ]
                          + Effect   = "Deny"
                          + Resource = "arn:aws:logs:us-east-2:XXXXXXXXX:log-group:/aws/eks/my/cluster"
                        },
                    ]
                  + Version   = "2012-10-17"
                }
            )
        }
      + inline_policy {}
    }

spr-mweber3 pushed a commit to spring-media/terraform-aws-eks that referenced this pull request Apr 26, 2022
spr-mweber3 pushed a commit to spring-media/terraform-aws-eks that referenced this pull request Apr 26, 2022
## [18.17.0](terraform-aws-modules/terraform-aws-eks@v18.16.0...v18.17.0) (2022-03-30)

### Features

* Add back in CloudWatch log group create deny policy to cluster IAM role ([terraform-aws-modules#1974](terraform-aws-modules#1974)) ([98e137f](terraform-aws-modules@98e137f))
it-without-politics pushed a commit to it-without-politics/terraform-aws-eks that referenced this pull request May 23, 2022
it-without-politics pushed a commit to it-without-politics/terraform-aws-eks that referenced this pull request May 23, 2022
## [18.17.0](terraform-aws-modules/terraform-aws-eks@v18.16.0...v18.17.0) (2022-03-30)

### Features

* Add back in CloudWatch log group create deny policy to cluster IAM role ([terraform-aws-modules#1974](terraform-aws-modules#1974)) ([98e137f](terraform-aws-modules@98e137f))
baibailiha added a commit to baibailiha/terraform-aws-eks that referenced this pull request Sep 13, 2022
## [18.17.0](terraform-aws-modules/terraform-aws-eks@v18.16.0...v18.17.0) (2022-03-30)

### Features

* Add back in CloudWatch log group create deny policy to cluster IAM role ([#1974](terraform-aws-modules/terraform-aws-eks#1974)) ([d939034](terraform-aws-modules/terraform-aws-eks@d939034))
@macropin
Copy link

I note that this is implemented as an inline policy. The original implementation (#1594) used an attached policy.

Inline policies should not be used as they are not compliant with the CIS AWS Foundations Benchmark security standard.

This should be reverted to the original implementation.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants