Shield / Client / describe_attack_statistics

describe_attack_statistics#

Shield.Client.describe_attack_statistics()#

Provides information about the number and type of attacks Shield has detected in the last year for all resources that belong to your account, regardless of whether you’ve defined Shield protections for them. This operation is available to Shield customers as well as to Shield Advanced customers.

The operation returns data for the time range of midnight UTC, one year ago, to midnight UTC, today. For example, if the current time is 2020-10-26 15:39:32 PDT, equal to 2020-10-26 22:39:32 UTC, then the time range for the attack data returned is from 2019-10-26 00:00:00 UTC to 2020-10-26 00:00:00 UTC.

The time range indicates the period covered by the attack statistics data items.

See also: AWS API Documentation

Request Syntax

response = client.describe_attack_statistics()
Return type:

dict

Returns:

Response Syntax

{
    'TimeRange': {
        'FromInclusive': datetime(2015, 1, 1),
        'ToExclusive': datetime(2015, 1, 1)
    },
    'DataItems': [
        {
            'AttackVolume': {
                'BitsPerSecond': {
                    'Max': 123.0
                },
                'PacketsPerSecond': {
                    'Max': 123.0
                },
                'RequestsPerSecond': {
                    'Max': 123.0
                }
            },
            'AttackCount': 123
        },
    ]
}

Response Structure

  • (dict) –

    • TimeRange (dict) –

      The time range of the attack.

      • FromInclusive (datetime) –

        The start time, in Unix time in seconds.

      • ToExclusive (datetime) –

        The end time, in Unix time in seconds.

    • DataItems (list) –

      The data that describes the attacks detected during the time period.

      • (dict) –

        A single attack statistics data record. This is returned by DescribeAttackStatistics along with a time range indicating the time period that the attack statistics apply to.

        • AttackVolume (dict) –

          Information about the volume of attacks during the time period. If the accompanying AttackCount is zero, this setting might be empty.

          • BitsPerSecond (dict) –

            A statistics object that uses bits per second as the unit. This is included for network level attacks.

            • Max (float) –

              The maximum attack volume observed for the given unit.

          • PacketsPerSecond (dict) –

            A statistics object that uses packets per second as the unit. This is included for network level attacks.

            • Max (float) –

              The maximum attack volume observed for the given unit.

          • RequestsPerSecond (dict) –

            A statistics object that uses requests per second as the unit. This is included for application level attacks, and is only available for accounts that are subscribed to Shield Advanced.

            • Max (float) –

              The maximum attack volume observed for the given unit.

        • AttackCount (integer) –

          The number of attacks detected during the time period. This is always present, but might be zero.

Exceptions

  • Shield.Client.exceptions.InternalErrorException