-
Notifications
You must be signed in to change notification settings - Fork 63
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 queries to 'Other Compliance Checks' #678
Conversation
Co-authored-by: Khushboo <46913995+khushboo9024@users.noreply.github.com>
…pipe-mod-aws-compliance into extra-check-queries
Co-authored-by: Khushboo <46913995+khushboo9024@users.noreply.github.com>
Co-authored-by: Madhushree Ray <65847563+madhushreeray30@users.noreply.github.com>
conformance_pack/vpc.sp
Outdated
case | ||
when (select count(*) from vpc_region_list) > 1 then 'VPCs exist in ' || (select count(*) from vpc_region_list) || ' regions.' | ||
else 'VPC does not exist in more than one region.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khushboo9024 if there are NO subnets exists, then we can reason
ALARM: test_peering no subnet exists. ..................................................................................... us-east-2 123456781234
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khushboo9024 can you please have a look at the comments, thanks!
conformance_pack/iam.sp
Outdated
from | ||
aws_iam_policy as p | ||
left join bad_policies as b on p.arn = b.arn | ||
where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where | |
where |
conformance_pack/vpc.sp
Outdated
} | ||
|
||
control "vpc_subnet_public_and_private" { | ||
title = "VPCs both public and private subnets should be configured" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title = "VPCs both public and private subnets should be configured" | |
title = "VPCs should have both public and private subnets configured" |
conformance_pack/vpc.sp
Outdated
from | ||
aws_account as a | ||
left join vpc_count_in_account as v on v.account_id = a.account_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left join vpc_count_in_account as v on v.account_id = a.account_id | |
left join vpc_count_in_account as v on v.account_id = a.account_id; |
conformance_pack/iam.sp
Outdated
@@ -572,6 +572,36 @@ control "iam_policy_no_full_access_to_kms" { | |||
}) | |||
} | |||
|
|||
control "iam_role_cross_account_readonlyaccess_policy" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
control "iam_role_cross_account_readonlyaccess_policy" { | |
control "iam_role_cross_account_read_only_access_policy" { |
conformance_pack/iam.sp
Outdated
control "iam_role_cross_account_readonlyaccess_policy" { | ||
title = "IAM roles should not have read only access for external AWS accounts" | ||
description = "Ensure IAM Roles do not have ReadOnlyAccess access for external AWS account. The AWS-managed ReadOnlyAccess policy carries a high risk of potential data leakage, posing a significant threat to customer security and privacy." | ||
query = query.iam_role_cross_account_readonlyaccess_policy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query = query.iam_role_cross_account_readonlyaccess_policy | |
query = query.iam_role_cross_account_read_only_access_policy |
conformance_pack/iam.sp
Outdated
EOQ | ||
} | ||
|
||
query "iam_securityaudit_role" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query "iam_securityaudit_role" { | |
query "iam_security_audit_role" { |
conformance_pack/iam.sp
Outdated
|
||
query "iam_securityaudit_role" { | ||
sql = <<-EOQ | ||
with securityaudit_role_count as( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with securityaudit_role_count as( | |
with security_audit_role_count as( |
conformance_pack/iam.sp
Outdated
end as reason | ||
${local.common_dimensions_global_sql} | ||
from | ||
securityaudit_role_count; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
securityaudit_role_count; | |
security_audit_role_count; |
conformance_pack/iam.sp
Outdated
}) | ||
} | ||
|
||
control "iam_securityaudit_role" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
control "iam_securityaudit_role" { | |
control "iam_security_audit_role" { |
conformance_pack/iam.sp
Outdated
control "iam_securityaudit_role" { | ||
title = "IAM Security Audit role should be created to conduct security audits" | ||
description = "Ensure IAM Security Audit role is created. By creating an IAM role with a security audit policy, a distinct segregation of responsibilities is established between the security team and other teams within the organization." | ||
query = query.iam_securityaudit_role |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query = query.iam_securityaudit_role | |
query = query.iam_security_audit_role |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Checklist