Control: 1.21 Do not setup access keys during initial user setup for all IAM users that have a console password
Description
AWS console defaults the checkbox for creating access keys to enabled. This results in many access keys being generated unnecessarily. In addition to unnecessary credentials, it also generates unnecessary management work in auditing and rotating these keys.
Requiring that additional steps be taken by the user after their profile has been created will give a stronger indication of intent that access keys are [a] necessary for their work and [b] once the access key is established on an account that the keys may be in use somewhere in the organization.
Note: Even if it is known the user will need access keys, require them to create the keys themselves or put in a support ticket to have the created as a separate step from user creation.
Remediation
Perform the following to delete access keys that do not pass the audit:
- Login to the AWS Management Console:
- Click
Services
. - Click
IAM
. - Click on
Users
. - Click on
Security Credentials
. - As an Administrator
- Click on
Delete
for keys that were created at the same time as the user profile but have not been used.
- As an IAM User
- Click on
Delete
for keys that were created at the same time as the user profile but have not been used.
Via CLI
aws iam delete-access-key
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.cis_v120_1_21
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.cis_v120_1_21 --share
SQL
This control uses a named query:
iam_user_access_keys_and_password_at_setup