Skip to main content

Description

The AWS console defaults to no checkboxes selected when creating a new IAM user. When creating IAM user credentials, you have to determine what type of access they require.

Programmatic access: The IAM user might need to make API calls, use the AWS CLI, or use the Tools for Windows PowerShell. In that case, create an access key (access key ID and a secret access key) for that user.

AWS Management Console access: If the user needs to access the AWS Management Console, create a password for the user.

Rationaleโ€‹

Requiring the additional steps to be taken by the user for programmatic access after their profile has been created provides 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, 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 submit a support ticket to have them created as a separate step from user creation.

Auditโ€‹

Perform the following to determine if access keys were created upon user creation and are being used and rotated as prescribed:

From Consoleโ€‹

  1. Log in to the AWS Management Console.
  2. Click Services.
  3. Click IAM.
  4. Click on a user where the Password age and Access key age columns are not set to None.
  5. Click the Security credentials tab.
  6. Compare the user Creation time to the Access Key Created date.
  7. For any that match, the key was created during initial user setup.
  • Keys that were created at the same time as the user profile and do not have a last used date should be deleted. Refer to the remediation below.

From Command Lineโ€‹

  1. Run the following command to generate a list of all IAM users along with their access keys utilization:

    aws iam generate-credential-report
    aws iam get-credential-report --query 'Content' --output text | base64 -d | cut -d, -f1,4,9,11,14,16
  2. The output of this command will produce a table similar to the following:

    userpassword_enabledaccess_key_1_activeaccess_key_1_last_used_dateaccess_key_2_activeaccess_key_2_last_used_date
    elisefalsetrue2015-04-16T15:14:00+00:00falseN/A
    brandontruetrueN/AfalseN/A
    rakeshfalsefalseN/AfalseN/A
    helenefalsetrue2015-11-18T17:47:00+00:00falseN/A
    parastruetrue2016-08-28T12:04:00+00:00true2016-03-04T10:11:00+00:00
    anithatruetrue2016-06-08T11:43:00+00:00trueN/A
  3. For any user with password_enabled set to true and access_key_last_used_date set to N/A, refer to the remediation.

Referencesโ€‹

  1. https://docs.aws.amazon.com/cli/latest/reference/iam/delete-access-key.html
  2. https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html

Additional Informationโ€‹

The credential report does not appear to contain Key Creation Date.