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

Add additional action permissions for Glue and Shield Advanced checks @lazize #995

Merged
merged 2 commits into from
Jan 20, 2022

Conversation

lazize
Copy link
Contributor

@lazize lazize commented Jan 20, 2022

Allows the shield:GetSubscriptionState action

Fix #994

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Allows the shield:GetSubscriptionState action
@toniblyx
Copy link
Member

In addition to iam/create_role_to_assume_cfn.yaml there are other files that require that change:

./iam/prowler-additions-policy.json
./util/codebuild/codebuild-prowler-audit-account-cfn.yaml
./util/terraform-kickstarter/main.tf

Would you mind to add it in those files as well? and if you add glue:GetSecurityConfiguration we can also close #988 :)

Thanks!

@toniblyx
Copy link
Member

And shield:DescribeProtection is also required.

@lazize
Copy link
Contributor Author

lazize commented Jan 20, 2022

shield:Describe* is already covered by managed policy SecurityAudit, so it should not be necessary to add it explicit.

./iam/create_role_to_assume_cfn.yaml

  • Missing glue:GetSecurityConfiguration, will add it
  • Added shield:GetSubscriptionState on previews commit

./iam/prowler-additions-policy.json

  • Missing glue:GetSecurityConfiguration, will add it
  • Already has shield:GetSubscriptionState

./util/codebuild/codebuild-prowler-audit-account-cfn.yaml

  • Missing glue:GetSecurityConfiguration, will add it
  • Already has shield:GetSubscriptionState

./util/terraform-kickstarter/main.tf

  • Missing glue:GetSecurityConfiguration, will add it
  • Already has shield:GetSubscriptionState

See below permission actions from all files above.
As you can see they don't match exactly, should they?

File ./iam/prowler-additions-policy.json has action glue:SearchTables which doesn't exist on others.

./iam/create_role_to_assume_cfn.yaml

              Action:
                - 'ds:ListAuthorizedApplications'
                - 'ec2:GetEbsEncryptionByDefault'
                - 'ecr:Describe*'
                - 'support:Describe*'
                - 'tag:GetTagKeys'
                - 'lambda:GetFunction'
                - 'glue:GetConnections'
                - 's3:GetAccountPublicAccessBlock'
                - 'shield:GetSubscriptionState'

./iam/prowler-additions-policy.json

            "Action": [
                "ds:ListAuthorizedApplications",
                "ec2:GetEbsEncryptionByDefault",
                "ecr:Describe*",
                "support:Describe*",
                "tag:GetTagKeys",
                "lambda:GetFunction",
                "glue:GetConnections",
                "glue:SearchTables",
                "s3:GetAccountPublicAccessBlock",
                "shield:GetSubscriptionState",
                "shield:DescribeProtection"
            ],

./util/codebuild/codebuild-prowler-audit-account-cfn.yaml

              - Action:
                  - s3:GetAccountPublicAccessBlock
                  - glue:GetConnections
                  - glue:SearchTables
                  - ds:ListAuthorizedApplications
                  - ec2:GetEbsEncryptionByDefault
                  - ecr:Describe*
                  - support:Describe*
                  - tag:GetTagKeys
                  - lambda:GetFunction
                  - shield:GetSubscriptionState
                  - shield:DescribeProtection

./util/terraform-kickstarter/main.tf

        Action =  [
                  "s3:GetAccountPublicAccessBlock",
                  "glue:GetConnections",
                  "glue:SearchTables",
                  "ds:ListAuthorizedApplications",
                  "ec2:GetEbsEncryptionByDefault",
                  "ecr:Describe*",
                  "support:Describe*",
                  "tag:GetTagKeys",
                  "lambda:GetFunction",
                  "shield:GetSubscriptionState",
                  "shield:DescribeProtection"
                  ]

@toniblyx
Copy link
Member

They all should be the same because are for the same purpose (11 lines).

Make sure all files where permission actions are necessary will have the same actions
@toniblyx
Copy link
Member

Awesome, great job @lazize!

@toniblyx toniblyx merged commit ed558c8 into prowler-cloud:2.7 Jan 20, 2022
@toniblyx toniblyx changed the title Add extra shield action permission Add additional action permissions for Glue and Shield Advanced checks @lazize Jan 20, 2022
@lazize lazize deleted the patch-1 branch January 20, 2022 15:51
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.

2 participants