All Products
Search
Document Center

Security Center:AccessKey pair leak detection

Last Updated:Jul 01, 2026

Security Center monitors public GitHub source code in real time to detect whether AccessKey pairs (hereinafter referred to as AKs) belonging to your Alibaba Cloud account or RAM users are leaked, and provides alerts. This topic describes the principles of AccessKey pair leak detection and how to respond to leaks.

How it works

Scope

  • Detection platform: Only supports detecting AccessKey pair leaks in public source code on GitHub. Other code hosting platforms are not supported.

  • Detection targets: AccessKey pairs of Alibaba Cloud accounts (primary accounts) and RAM users, including both the AccessKey ID and AccessKey Secret.

Notification methods

Security Center uses different notification methods depending on whether the leaked AccessKey Secret (hereinafter referred to as SK) is still valid:

Important

A third party can exploit the AccessKey pair to gain control over all resources under your account only when both the AccessKey ID and AccessKey Secret are leaked.

Notification condition

Notification method

AccessKey ID is leaked, regardless of whether the AccessKey Secret is valid.

Alert on the AccessKey Leak Detection page

AccessKey Secret is leaked and still valid.

  • Console pop-up: A pop-up message appears when you visit the Alibaba Cloud console homepage or most product consoles.

  • Alert notification: Sent through the configured channels (internal message, email).

image

Configure AccessKey leak alert notifications

Security Center enables AccessKey leak alert notifications by default. Alerts can be sent through SMS, voice calls, email, and internal messages.

Modify notification methods

  1. Access the Security Center console - System Settings - Notification Settings. In the upper-left corner of the page, select the region where the assets to be protected are located: Chinese Mainland or Outside Chinese Mainland.

  2. On the Email/Internal Message tab, find AccessKey Leak Detection and select the required Notification Method.

Note

AccessKey leaks pose high risks. To ensure timely notifications, we recommend selecting all notification methods. For more information, see Configure alert notifications.

Add notification recipients

By default, only account contacts receive notifications. To add other recipients, use one of the following methods:

  • SMS, email, and internal message:

    On the Basic Receiving Management page, modify message recipients in the Security Message > Cloud Shield Security Information Notification section.

    Note

    After you modify message recipients here, the changes also apply to other notification items in Security Center, as well as to notification items for products such as Anti-DDoS and Web Application Firewall.

    For more information, see Configure event alerts.

Handle AccessKey pair leak events

After you receive an AccessKey pair leak alert, it means the AK and SK information of your Alibaba Cloud account or RAM user has been exposed. Handle it by following these steps:

Step 1: Manually handle the leak

Security Center does not support automatic handling of AccessKey pair leak events. You must first complete the following operations externally:

  1. Delete or hide the leaked content on GitHub: Contact the relevant personnel to delete or hide the files, repositories, or code that contain the AccessKey pair information.

  2. Handle the leaked AccessKey in the RAM console: Delete or disable the leaked AccessKey and create a new one, ensuring that core business operations are not affected. For more information, see Delete an AccessKey pair for a RAM user and Disable an AccessKey pair for a RAM user.

Step 2: Mark the handling status in the console

After you complete the manual handling, mark the status of the AccessKey alert event in the Security Center console:

  1. Access the Security Center console - Risk Administration - AK Leakage Detection.

  2. Click Handle in the Actions column of the target event, select one of the following handling methods, and then click Handle Now.

Handling method

Applicable scenario

Manually Deleted

The leaked AccessKey is no longer in use and has been deleted.

Manually Disabled AccessKey Pair

The leaked AccessKey still needs to be used but must be temporarily disabled. After you select this method, you can re-enable the AccessKey in the RAM console.

Note

If the AccessKey has already been disabled in the RAM console, Security Center automatically syncs the disabled state, and the AccessKey leak event status changes to Manually Disabled.

Add to Whitelist

The event is a false positive or can be safely ignored. After you select this option, the status changes to Added to Whitelist and the event moves to the handled list.

When you need to resume detection, go to the AccessKey pair leak details page from the handled list and remove the whitelist.

View AccessKey call records

By reviewing AccessKey call records, you can determine whether the leaked AccessKey was exploited by attackers and understand the scope of the impact. The following steps describe how to view AccessKey call events in chronological order through ActionTrail.

Note

To view the call records of an AccessKey accessing a specific cloud service, you can use the AccessKey audit feature in ActionTrail. For more information, see Query the logs of an AccessKey pair.

  1. On the Security Center console AccessKey Leak Detection page, obtain the AccessKey ID that you want to query.

  2. Log on to the ActionTrail console.

  3. In the left-side navigation pane, choose Events > Event Query.

  4. In the top navigation bar, select the region where you want to query events.

  5. Set the query type to AccessKey ID, enter the AccessKey ID to query, and specify a time range.

  6. View the list of events called by the AccessKey ID. Click View Details in the Actions column of the target event to view the detailed event records.

    For more information about the parameters of management events, see Management event structure.

Monitor for abnormal AccessKey calls

After you handle an AccessKey pair leak event, we recommend that you continuously monitor for abnormal AccessKey calls to prevent similar incidents, respond quickly when leaks occur, and minimize the impact.

Detect abnormal AccessKey calls from an attacker's perspective

Based on security attack-and-defense experience and large models, Security Center can detect common abnormal AccessKey calls. For example, the IP address that calls the AccessKey has launched attacks recently, the IP address calls AccessKey pairs of multiple users in batches on the cloud, the called API is sensitive and the AccessKey has been leaked before.

  1. Log on to the Security Center console.

  2. In the navigation pane on the left, select Detection and Response > Alert. In the upper-left corner of the console, select the region where your assets are located: Chinese Mainland or Outside Chinese Mainland.

    Note

    If you have activated Agentic SOC, select Agentic SOC > Manage > Alert.

  3. Set Alert Type to Malicious Process (Cloud Threat Detection) and check for any abnormal AccessKey call alerts.

    Note

    If an abnormal AccessKey call alert exists, view its details and promptly confirm whether the AccessKey call is a normal behavior.

  4. (Optional) Configure alert notifications: go to System Settings > Notification Settings, find Alert in the Notification Item column, and select your preferred methods.

    Note

    The Basic Edition supports only the internal message notification method.

Monitor for abnormal AccessKey calls by your Alibaba Cloud account

ActionTrail provides built-in alerts to monitor AccessKey calls by your Alibaba Cloud account and abnormal AccessKey calls. Enable the built-in alerts Abnormal Frequency of AccessKey Usage Alert and Root Account AccessKey Usage Detection in the ActionTrail console to receive notifications when abnormal AccessKey calls occur. For more information, see Query Insights events.

Detect abnormal AccessKey calls based on historical behavior

The Insights feature provided by ActionTrail analyzes AccessKey pairs with abnormal call rates based on historical behavior, helping you detect abnormal activities in a timely manner. For more information about how to enable and view Insights events, see Query Insights events in the ActionTrail console.

Recommendations

  • Do not use the AccessKey pair of your Alibaba Cloud account (primary account).

  • Avoid hard-coding AccessKey information in your code. You can manage AccessKey pairs by configuring environment variables. For more information, see Best practices to prevent AccessKey pair leaks.

  • Use private GitHub repositories to manage code, or set up an internal code hosting system within your enterprise to prevent source code and sensitive information leaks.

What's next