-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(checks): Improve AVD-AWS-0345 #8752
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
Comments
just to confirm, is there any change needed in the check (AVD-AWS-0345) in order to leverage this? |
@nikpivkin in addition to checking for named IAM policies, we also need to check for conditions such as resource "aws_iam_role_policy" "ecs_task_role_s3_attachment_policy" {
name = "${local.iam_task_role_policy_name}"
role = "${aws_iam_role.stepfunction_ecs_task_role.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:put*",
"s3:get*",
"s3:list*"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"kinesis:DescribeStream",
"kinesis:GetRecords",
"kinesis:PutRecords"
],
"Resource": [
"${aws_kinesis_stream.stepfunction_ecs_kinesis_stream.arn}"
]
}
]
}
EOF
} I pushed some changes here aquasecurity/trivy-checks#398 |
@simar7, can you clarify what the concern with something like |
Agreed. The recent changes which trigger AVD-AWS-0345 when a policy has Please revert these latest changes to AVD-AWS-0345 as they make the check totally unusable. It should be looking for @simar7 can you please explain the rationale for triggering on |
Please see the following blurb from our research team:
For more details, please see our blog here: |
@simar7 I can't find the quote in the link. regardless, I can see how this might be confusing since the check is referring to "full access", "unrestricted acceess", etc, but is checking for any broad action (e.g Get*, right?). if we want to expand the check to alert not only for "full access" (do we?), then perhaps these cases should be treated differently (severity/description)? |
@simar7 I agree with @itaysk. The risk description and severity between And I believe the true takeaway from that article is that users should be more selective in their In the end what we're really protecting in a storage service like s3 is the data. So I'm at a loss to understand how I do see how |
Right - thanks that makes sense. I'll separate them out. Track #8845 |
Discussed in #8751
Originally posted by simar7 April 17, 2025
We should also be able to parse the following:
Check for specific Policy ARNs
Here
"arn:aws:iam::aws:policy/AmazonS3FullAccess"
equates to the following:Check for JSON Policy docs
An example is available here https://raw.githubusercontent.com/aws-samples/aws-stepfunctions-ecs-fargate-process/d748389c6ee443389a7275f9056f712f9359b178/templates/roles.tf
The text was updated successfully, but these errors were encountered: