> ## Documentation Index
> Fetch the complete documentation index at: https://cloudanix.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Shield Advanced Setting Should Be Set  To Auto Renew

### More Info:

Ensure auto renew is enabled for shield

### Risk Level

Medium

### Addresses

Configuration

### Compliance Standards

CBP

### Triage and Remediation

<Tabs>
  <Tab title="Remediation">
    ### Remediation

    <AccordionGroup>
      <Accordion title="Using Console" defaultOpen="true">
        To remediate the misconfiguration of AWS Shield Advanced setting not being set to auto-renew, follow these steps using the AWS Management Console:

        1. **Login to AWS Console**: Go to the AWS Management Console ([https://aws.amazon.com/](https://aws.amazon.com/)) and log in to your AWS account.

        2. **Navigate to AWS Shield Console**: In the AWS Management Console, search for "Shield" in the services search bar and click on "AWS Shield" under the Security, Identity, & Compliance category.

        3. **Select the Shield Advanced Service**: In the AWS Shield console, click on the "Shield Advanced" service.

        4. **Navigate to Advanced Settings**: In the Shield Advanced dashboard, locate the "Advanced settings" section and click on it to view the current settings.

        5. **Enable Auto-Renewal**: Look for the setting related to auto-renewal of the AWS Shield Advanced subscription. If it is not already set to auto-renew, you will see an option to enable auto-renewal. Click on the option to enable auto-renewal for the subscription.

        6. **Review and Confirm**: Review the changes you have made to ensure that the auto-renewal setting is now enabled for your AWS Shield Advanced subscription.

        7. **Save Changes**: Once you have confirmed that the auto-renewal setting is enabled, click on the "Save" or "Update" button to save the changes.

        By following these steps, you have successfully remediated the misconfiguration of AWS Shield Advanced setting not being set to auto-renew. This ensures that your AWS Shield Advanced subscription will automatically renew at the end of its term, providing continuous protection for your AWS resources against DDoS attacks.

        #
      </Accordion>

      <Accordion title="Using CLI">
        To remediate the misconfiguration of the Shield Advanced setting not being set to auto-renew in AWS using the AWS CLI, follow these steps:

        1. Open a terminal or command prompt window.

        2. Use the AWS CLI command to enable auto-renewal for Shield Advanced. Run the following command:

        ```bash theme={null}
        aws shield update-subscription --auto-renew
        ```

        3. Verify that the setting has been updated successfully by running the following command to describe the Shield subscription:

        ```bash theme={null}
        aws shield describe-subscription
        ```

        4. Check the output to confirm that the `AutoRenew` field is set to `True`, indicating that auto-renewal is now enabled for Shield Advanced.

        By following these steps, you have successfully remediated the misconfiguration by setting the Shield Advanced subscription to auto-renew using the AWS CLI.
      </Accordion>

      <Accordion title="Using Python">
        To remediate the misconfiguration of AWS Shield Advanced setting not being set to auto renew, you can use the AWS SDK for Python (Boto3) to update the Shield Advanced configuration. Here are the step-by-step instructions to remediate this issue:

        1. Install Boto3:
           Make sure you have Boto3 installed. You can install it using pip:
           ```
           pip install boto3
           ```

        2. Configure AWS Credentials:
           Ensure that you have AWS credentials configured on the machine where you will be running the Python script. You can set up your AWS credentials using AWS CLI by running:
           ```
           aws configure
           ```

        3. Write a Python script to update the Shield Advanced configuration:
           Create a Python script with the following code snippet to update the Shield Advanced configuration to enable auto-renewal:

           ```python theme={null}
           import boto3

           def update_shield_advanced_auto_renew():
               shield = boto3.client('shield')

               response = shield.update_subscription(
                   AutoRenew=True
               )

               print("Auto Renewal for Shield Advanced has been enabled successfully.")

           if __name__ == '__main__':
               update_shield_advanced_auto_renew()
           ```

        4. Run the Python script:
           Save the Python script with a meaningful name (e.g., `update_shield_auto_renew.py`) and run it using the following command:
           ```
           python update_shield_auto_renew.py
           ```

        5. Verify the Shield Advanced configuration:
           After running the script, verify that the Shield Advanced setting has been updated to auto-renew by checking the AWS Management Console or by running describe\_shield\_subscription API call.

        By following these steps, you can remediate the misconfiguration of AWS Shield Advanced setting not being set to auto renew using Python and Boto3.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>
