mirror of
https://github.com/inspec/inspec
synced 2024-12-22 19:13:24 +00:00
033bc13aa0
* Add aws_iam_users Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Adding Filter table and Collect User Details to aws_iam_users.rb Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Adding Filter table and Collect User Details to aws_iam_users.rb Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Adding Filter table and Collect User Details to aws_iam_users.rb Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Get an aws_iam_users integration test to pass Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Fix RuboCop issues and tests Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Improving code based on PR feedback Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
29 lines
866 B
Ruby
29 lines
866 B
Ruby
mfa_not_enabled_user = attribute(
|
|
'mfa_not_enabled_user',
|
|
default: 'default.mfa_not_enabled_user',
|
|
description: 'Name of IAM user mfa_not_enabled_user')
|
|
|
|
console_password_enabled_user = attribute(
|
|
'console_password_enabled_user',
|
|
default: 'default.console_password_enabled_user',
|
|
description: 'Name of IAM user console_password_enabled_user')
|
|
|
|
access_key_user = attribute(
|
|
'access_key_user',
|
|
default: 'default.access_key_user',
|
|
description: 'Name of IAM user access_key_user')
|
|
|
|
describe aws_iam_user(name: mfa_not_enabled_user) do
|
|
it { should_not have_mfa_enabled }
|
|
it { should_not have_console_password }
|
|
end
|
|
|
|
describe aws_iam_user(name: console_password_enabled_user) do
|
|
it { should have_console_password }
|
|
end
|
|
|
|
aws_iam_user(name: access_key_user).access_keys.each { |access_key|
|
|
describe access_key do
|
|
it { should be_active }
|
|
end
|
|
}
|