inspec/test/integration/verify/controls/aws_iam_user.rb
Miles 69434fec48 Use terraform environments to avoid integration test collisions
* When running integration tests with Rakefile use terraform environment based on environment variable INSPEC_TERRAFORM_ENV
** If INSPEC_TERRAFORM_ENV is not provided, a random string will be used
* Use terraform environment as a namespace for AWS artifacts
* Use attribute file for inspec to be aware of the terraform environment used

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-05-06 14:14:53 -04:00

18 lines
No EOL
614 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')
describe aws_iam_user(mfa_not_enabled_user) do
its('has_mfa_enabled?') { should be false }
its('has_console_password?') { should be false }
end
describe aws_iam_user(console_password_enabled_user) do
its('has_console_password?') { should be true }
end