| Briefly explain the importance of programmatic keys for accessing AWS services programmatically, which is often a prerequisite for pentesting.

1. Sign In to the AWS Management Console

   * Go to the [AWS Management Console](https://aws.amazon.com/console/)
   * Sign in with your account credentials

** 2. Accessing IAM in AWS Console**

   * In the console, locate and select “IAM” (Identity and Access Management) from the services' menu.

** 3. Navigate to User Details**

    * In the IAM dashboard, select “Users” from the left navigation pane. Choose the IAM user for which you want to generate access keys.
    * If you need to create a new user, click **Add user** and follow the prompts to set up the user with programmatic access.

** 4. Generate Access Keys**

    * Within the selected IAM user’s details page, navigate to the “Security credentials” tab.
    * In the “Access keys” section, click on the “Create access key” button.
    * Then select the **Command Line Interface (CLI)** and tick the confirmation to proceed to create an access key.
    * Then confirm and click “Next.

** 5. Download Access Key**

     * Once the access key is created, download the `.csv` file that contains the **Access Key ID** and **Secret Access Key**

Note: You will not be able to view the secret access key again after this step, so make sure to download and store it securely.

** 6. Set Permissions**

      * Ensure the user has the necessary permissions to perform actions required for your pentest. This may involve assigning specific I AM

policies or roles.

| If you encounter issues, ensure the user has the correct permissions and that the keys are properly configured in your tools.

Enable a virtual MFA device for an IAM user (console)

    **You can use IAM in the AWS Management Console to enable and manage a virtual MFA device for an IAM user in your account**

| Note: You must have physical access to the hardware that will host the user's virtual MFA device in order to configure MFA.

  1. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/

  2. In the navigation pane, choose Users.

  3. In the Users list, choose the name of the IAM user.

  4. Choose the Security Credentials tab. Under Multi-factor authentication (MFA), choose Assign MFA device.

  5. In the wizard, type a Device name, choose Authenticator app, and then choose Next.

  6. Open your virtual MFA app. For a list of apps that you can use for hosting virtual MFA devices, see Multi-Factor Authenticatio If the virtual MFA app supports multiple virtual MFA devices or accounts, choose the option to create a new virtual MFA device or account.

  7. Determine whether the MFA app supports QR codes, and then do one of the following:

  1. On the Set up device page, in the MFA code 1 box, type the one-time password that currently appears in the virtual MFA device. Wait up to 30 seconds for the device to generate a new one-time password. Then type the second one-time password into the MFA code 2 box. Choose Add MFA.

| Important: Submit your request immediately after generating the codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device is out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device.