[Bug]: Checks failing in v3 when they shouldn't be #1789
Labels
bug
severity/low
Bug won't result in any noticeable breakdown of the execution.
status/waiting-for-revision
Waiting for maintainer's revision
What happened?
The following checks are failing for us in version 3, but they were passing in version 2. I don't believe they should be failing:
1. ec2_security_group_not_used
This check is failing for us because of our default security groups, which cannot be deleted. In version 2, there was a specific case to ensure that the default security groups would not cause a failure: https://github.com/prowler-cloud/prowler/blob/2.12.1/checks/check_extra75
This special case does not exist in the version 3 implementation: https://github.com/prowler-cloud/prowler/blob/master/prowler/providers/aws/services/ec2/ec2_securitygroup_not_used/ec2_securitygroup_not_used.py
I had a discussion open for this initially, but thought it might be better suited as a bug: #1781
2. iam_policy_no_administrative_privileges
In version 2, this check was checking to see if Action was equal to * and Resource was equal to *: https://github.com/prowler-cloud/prowler/blob/2.12.1/checks/check122#L35
In version 3, it is checking to see if * is contained in the Action and Resource: https://github.com/prowler-cloud/prowler/blob/3.1.2/prowler/providers/aws/services/iam/iam_policy_no_administrative_privileges/iam_policy_no_administrative_privileges.py#L21-L26
This is causing the check to fail with policies such as:
I don't think this should fail the check, as I believe only policies with full administrative privileges should fail, while this is limited to kms actions. The user guide in the aws doc states:
To me this sounds like it should only fail when policies have Action: * and Resource: * exactly.
3. iam_avoid_root_usage
This check is failing for us with the following reason: "Root user in the account was last accessed 370 days ago."
Looking at the implementation, it seems the intended behavior should be to ensure the user account was not accessed in the last day: https://github.com/prowler-cloud/prowler/blob/master/prowler/providers/aws/services/iam/iam_avoid_root_usage/iam_avoid_root_usage.py#L6
I'm not exactly sure where the issue is in the implementation, but I did notice that in the version 2 check, the value for the last accessed day of the account for us was -370, so the case of days_since_accessed > maximum_access_days was false and wouldn't fail. Seems like the implementation in version 3 needs to ensure the value for that is negative as well?
How to reproduce it
Steps to reproduce the behavior:
Expected behavior
From where are you running Prowler?
The text was updated successfully, but these errors were encountered: