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

Bug in aws_iam_users resource #899

Open
Rohit1509 opened this issue Apr 20, 2022 · 10 comments
Open

Bug in aws_iam_users resource #899

Rohit1509 opened this issue Apr 20, 2022 · 10 comments
Assignees

Comments

@Rohit1509
Copy link

Filtering not working for 'aws_iam_users' resource.

Describe the problem

Using aws_iam_users.where(has_inline_policies: true).usernames.each do |user_name| filtering in the control is giving out an error even if it is a valid filter defined.

image

Possible Solution

@sathish-progress sathish-progress self-assigned this Apr 21, 2022
@sathish-progress
Copy link
Contributor

Hey @Rohit1509, I tried this and works well for me
Screenshot 2022-04-21 at 2 40 02 PM

@sathish-progress
Copy link
Contributor

Could you may be try to remove the inspec.lock and try again?

@Rohit1509
Copy link
Author

@sathish-progress , I tried removing the inspec.lock file. This issue is not coming up in the previous version of resource pack (v1.81.16). I will give this a try again and update here. Thanks!

@sathish-progress
Copy link
Contributor

@Rohit1509 , the latest version is actually 1.83.16, best if you could point it to that version..

@Rohit1509
Copy link
Author

Hi @sathish-progress , I tried with updated version of resource pack as well (1.83.6) ans same issue again. I feel one possible issue could be the use case where there are no users that have inline policies attached because it returns 'nil' in that case. Can you try on your end if that use case still works ? Thanks!

@Rohit1509
Copy link
Author

There are no users that have inline policies attached and it returns this:

image

@sathish-progress
Copy link
Contributor

@Rohit1509 , for some reason am unable to replicate this issue!

Screenshot 2022-04-27 at 1 29 56 AM

@sathish-progress
Copy link
Contributor

I tested it in both inspec versions (4.52.9, 5.12.2) and am able to see things work..
Could you please give me your inspec.yml?

@Rohit1509
Copy link
Author

@sathish-progress , There is a user in our account for which we don't have access permissions. So essentially we can't get any API response of this user. Could this be possible reason for this not working on my end ?

@sathish-progress
Copy link
Contributor

Hmmm yeah, But ideally we should be using accounts that has access permissions so that inspec could read the data.

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

No branches or pull requests

2 participants