Skip to main content

More Info:

Certificates tied with root accounts needs rotation.

Risk Level

Critical

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Startup Security Baseline
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

How to Prevent

Using Console

To prevent the misconfiguration of not rotating root account certificates in AWS IAM using the AWS Management Console, follow these steps:
  1. Navigate to IAM Dashboard:
    • Sign in to the AWS Management Console.
    • In the top right corner, click on your account name or number, and then select “My Security Credentials.”
    • Alternatively, you can directly go to the IAM Dashboard by searching for “IAM” in the AWS Management Console search bar.
  2. Access Security Credentials:
    • On the IAM Dashboard, click on “Users” in the left-hand navigation pane.
    • Select the root account (usually indicated by the account email address).
  3. Review and Rotate Certificates:
    • Under the “Security credentials” tab, locate the “X.509 Certificates” section.
    • Review the existing certificates and their expiration dates.
    • If a certificate is nearing expiration or has been in use for an extended period, generate a new certificate by clicking on “Manage X.509 Certificates” and then “Create Certificate.”
  4. Implement a Rotation Policy:
    • Establish a regular schedule for rotating root account certificates, such as every 90 days.
    • Document the rotation process and ensure that it is followed consistently.
    • Use AWS CloudWatch or AWS Config to set up alerts and notifications for certificate expiration dates to ensure timely rotation.
By following these steps, you can ensure that root account certificates are regularly rotated, reducing the risk of security vulnerabilities associated with outdated or compromised certificates.
To prevent the issue of root account certificates needing rotation in AWS IAM using the AWS CLI, you can follow these steps:
  1. Create a New Access Key for the Root Account:
    • First, create a new access key for the root account. This should be done to ensure that you have a new set of credentials before deleting the old ones.
  2. List Existing Access Keys:
    • List all the access keys associated with the root account to identify the old keys that need to be rotated.
  3. Delete the Old Access Key:
    • After ensuring that the new access key is working correctly, delete the old access key to complete the rotation process.
  4. Enable MFA for Root Account:
    • To add an additional layer of security, enable Multi-Factor Authentication (MFA) for the root account. This can be done by associating an MFA device with the root account.
By following these steps, you can ensure that the root account certificates are rotated regularly, thereby enhancing the security of your AWS environment.
To prevent the misconfiguration of not rotating root account certificates in IAM using Python scripts, you can follow these steps:
  1. Set Up AWS SDK (Boto3) for Python:
    • First, ensure you have the AWS SDK for Python (Boto3) installed. You can install it using pip if you haven’t already:
  2. Create a Python Script to Check Certificate Age:
    • Write a Python script that checks the age of the root account certificates. If the certificates are older than a specified threshold (e.g., 90 days), the script should trigger an alert or take action to rotate them.
  3. Automate the Script Execution:
    • Schedule the script to run at regular intervals (e.g., daily) using a task scheduler like cron (Linux) or Task Scheduler (Windows). This ensures continuous monitoring and timely alerts.
    Example cron job to run the script daily at midnight:
  4. Integrate with Notification System:
    • Enhance the script to send notifications (e.g., via email, Slack, or AWS SNS) when a certificate is due for rotation. This ensures that the responsible team is promptly informed.
    Example of sending an email notification using AWS SNS:
By following these steps, you can effectively prevent the misconfiguration of not rotating root account certificates in IAM using Python scripts.

Additional Reading: