data-dot-all / dataall

A modern data marketplace that makes collaboration among diverse users (like business, analysts and engineers) easier, increasing efficiency and agility in data projects on AWS.
https://data-dot-all.github.io/dataall/
Apache License 2.0
230 stars 81 forks source link

Add dataall IAM AssetsFileRole to checkov baseline #1188

Open mourya-33 opened 5 months ago

mourya-33 commented 5 months ago

Describe the bug

CDK automatically creates an IAM Role - AssetsFileRole for managing the Assets stage in the main cicd code pipeline. However, this role has a default policy with the following unrestricted IAM permissions that are flagged by checkov scans.

{ "Action": [ "codebuild:BatchGetBuilds", "codebuild:StartBuild", "codebuild:StopBuild" ], "Effect": "Allow", "Resource": "*" }

This needs to be added to the checkov baseline until remediated.

How to Reproduce

While deploying dataall to AWS, after the cdk synth, scan the file - cdk.out/dataall-main-cicd-stack.template.json with checkov. Checkov will have a FAILURE with the following message

Check: CKV_AWS_111: "Ensure IAM policies does not allow write access without constraints" FAILED for resource: AWS::IAM::Policy.dataallmaincdkpipelineAssetsFileRoleDefaultPolicy{Hash} File: /dataall-main-cicd-stack.template.json: {line number} Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-iam-policies/ensure-iam-policies-do-not-allow-write-access-without-constraint

Expected behavior

Once the role is added to checkov baseline, the checkov scan should no longer have a FAILURE message for the AssetsFileRole.

Your project

No response

Screenshots

No response

OS

Mac

Python version

3.10

AWS data.all version

2.3

Additional context

This issue is related to https://github.com/data-dot-all/dataall/issues/877

dlpzx commented 5 months ago

Thanks for opening an issue @mourya-33. I assigned you to the issue, let us know if you need any support

mourya-33 commented 4 months ago

Thanks Adriana